You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
handling square might not be trivial, and are probably mostly important for pedestrian routing. so this might be for a future version.
the thing with a square is that you can cross it in any way. unfortunately squares can have odd shapes, so it's not always possible go in a straight line from where you enter to where you leave. for example a building might be in the way if the square has a hour-glass shape.
if i set up a pedestrain speedprofile, which includes 'pedestrian=5', osrm will route at the edge of the square. this is will get me across the square, but in a somewhat odd fashion.
one option would be to add routes connecting all entries to the square to all others. another would be to connect all entries to a central point. perhaps these to options could be improved by checking that routes are only added if they don't cross the square boundary.
a third option would be be still route along the edge of the square, but insert the route some reasonably distance from the edge, since in reality you cant walk right at the edge of the building.
Reacted by Andrew Harvey, Justin Ormont, Waldir Pimenta, David Auer, FireFragment, dieterdreist and luna-cant-code
another idea for handling areas: find all nodes along the edge that is also part of a way with a highway=* tag, or another area. then divide this polygon using standard subdidivision algorithms. this might provide a good balance between not adding too many lines, while still providing significant a pretty good route across any type of square.
Yes, at least the simple approach won't do for multipolygons. Have a look at these examples in the context of area routing via creating artificial ways.
@daniel-j-h Note that the osmium::Area::is_multipolygon() call will only check whether the area has more than one outer ring. What you seem to be interested in is that it doesn't have any inner rings. You'd have to call num_rings() for that.
regarding tag combinations, we should reuse as much of the usual way processing as possible, to handle tags like access, foot, bicycle, car, surface, smoothness, construction, impassable, status, amenity, platform, railway, service, steps, etc.
tags related to direction will not apply to squares, like oneway, *:forward and *:backward and should be ignored (and would be invalid tagging anyways). same with tags related to lanes and width.
turn restrictions to/from a square probably doesn't apply either.
What is the reason that this issue about pedestrian routing through areas has such low priority?
I'm asking because mappers obviously continue to add "virtual" ways over areas in OSM. This is unncessary and like "tagging for the router". In addition it looks weird in renderers, because such pedestrian ways can't be distinguished from "real" ones without guessing...
FWIW, it's not "tagging for the renderer/router". That means putting incorrect information in to achieve the desired effect: for example, tagging a golf course bunker as a beach so it shows up as sand, even though it's not a beach. Adding centrelines or virtual ways is perhaps duplicate information, but it's been done since the very earliest days of OSM (on rivers).
If you give the ExtractionWayhere a new property maybe is_area and expose it to the profiles through the scripting environment here you can parse a way's area tag in the Lua profiles and set the attribute accordingly.
You probably also want to expose is_closed on the osmium::Way in the scripting environment here because you only care for closed ways (=> areas).
Once you have the attribute on the ExtractionWay and inside C++-land you can modify the ExtractorCallbacks here to compute e.g. the visibility graph and add edges.
Activity
emiltin commentedon Feb 13, 2012
another idea for handling areas: find all nodes along the edge that is also part of a way with a highway=* tag, or another area. then divide this polygon using standard subdidivision algorithms. this might provide a good balance between not adding too many lines, while still providing significant a pretty good route across any type of square.
emiltin commentedon Sep 23, 2012
how OTP solved it: http://blog.openplans.org/2012/06/b-roll-david-solves-the-plaza-problem-with-help-from-de-berg-and-matt-conway/
DennisOSRM commentedon Sep 23, 2012
Yes, very standard modelling.
[-]squares (area=yes)[/-][+]Route through squares (area=yes)[/+]TheMarex commentedon May 24, 2015
Brain dump on how to do this:
AFAIK there is an algorithm in deBerg that routes through cell centers, but I would need to look this up.
lbud commentedon Jun 10, 2015
this would also be awesome for, say, indoor routing :)
danpat commentedon Jun 10, 2015
Example indoor routing use-case: http://en.wikipedia.org/wiki/Edmonton_Pedway
Some of the walkways are in OSM, but it doesn't look complete: https://www.openstreetmap.org/#map=17/53.54259/-113.49257
10 remaining items
daniel-j-h commentedon Mar 27, 2017
Yes, at least the simple approach won't do for multipolygons. Have a look at these examples in the context of area routing via creating artificial ways.
joto commentedon Mar 27, 2017
@daniel-j-h Note that the
osmium::Area::is_multipolygon()call will only check whether the area has more than one outer ring. What you seem to be interested in is that it doesn't have any inner rings. You'd have to callnum_rings()for that.emiltin commentedon Jun 9, 2017
regarding tag combinations, we should reuse as much of the usual way processing as possible, to handle tags like access, foot, bicycle, car, surface, smoothness, construction, impassable, status, amenity, platform, railway, service, steps, etc.
tags related to direction will not apply to squares, like oneway, *:forward and *:backward and should be ignored (and would be invalid tagging anyways). same with tags related to lanes and width.
turn restrictions to/from a square probably doesn't apply either.
sfkeller commentedon Oct 8, 2017
What is the reason that this issue about pedestrian routing through areas has such low priority?
I'm asking because mappers obviously continue to add "virtual" ways over areas in OSM. This is unncessary and like "tagging for the router". In addition it looks weird in renderers, because such pedestrian ways can't be distinguished from "real" ones without guessing...
daniel-j-h commentedon Oct 9, 2017
Mainly two reasons
and @emiltin is working on all things bike routing for his own use-case
if you have a use-case for this and see a need here we're more than happy to guide you along.
emiltin commentedon Oct 9, 2017
This is highly relevant for bicycle routing as well (which is why I opened the issue originally), since:
But unfortunately I don't have time to implement it.
systemed commentedon Oct 9, 2017
FWIW, it's not "tagging for the renderer/router". That means putting incorrect information in to achieve the desired effect: for example, tagging a golf course bunker as a beach so it shows up as sand, even though it's not a beach. Adding centrelines or virtual ways is perhaps duplicate information, but it's been done since the very earliest days of OSM (on rivers).
andrewharvey commentedon Oct 9, 2017
natural=beachfor the walking profile. Beaches don't normally have a path going through them but you can walk along them.sfkeller commentedon Oct 9, 2017
@systemed: I'm talking about not-existing and misleading (sic!) footways which have been added only to enhance a router, like on this place "Helvetiaplatz, Zurich" (http://www.openstreetmap.org/way/4533221 ). There you also see that these unnecessary footways are only partially working since the route from east to west side is missing...

saerdnaer commentedon May 18, 2018
@daniel-j-h Can you give some pointers how to start implementing this issue? Which classes have to be modified? (besides #64 (comment) )
daniel-j-h commentedon May 18, 2018
If you give the
ExtractionWayhere a new property maybeis_areaand expose it to the profiles through the scripting environment here you can parse a way's area tag in the Lua profiles and set the attribute accordingly.You probably also want to expose
is_closedon the osmium::Way in the scripting environment here because you only care for closed ways (=> areas).Once you have the attribute on the ExtractionWay and inside C++-land you can modify the ExtractorCallbacks here to compute e.g. the visibility graph and add edges.
Hope that helps
dreirund commentedon Apr 23, 2025
See also #4176 and #7146.
emiltin commentedon Aug 12, 2026
nice to see this ancient issue completed 👍