Open dooley opened 2 years ago
Small components are decided at data processing time - you can use osrm-extract --small-component-size 0
to prevent any edges being marked as individual small components. Note that this will likely lead to an increase in NoRoute
results for route
requests, as OSRM will simply snap to the nearest edge then try to route. In a table
request, this will result in null
entries.
This will lead to possible problems later in our toolchain. Do we have access to the attribute "is_small" for a way in lua?
Where can i find which elements in way/result-objects are available in the lua, so i can print the values?
@dooley well, you can't have your cake and eat it too. If the overall goal is to reduce NoRoutes, and you are less sensitive to accuracy, you can try increasing the small component limit - it defaults to 1000.
The way snapping works in OSRM is as follows:
The idea here is that if you drop one coordinate near a disconnected, say, park, we'll shift the coordinate a bit so it's routable to the rest and you'll get results.
One downside to this is that for some situations, you might actually want a NoRoute
- like if a point is dropped on an island that is not actually connected, you probably don't want the coordinate shifted many miles just so it becomes routable.
By default, isolated regions that have <1000 nodes will be flagged as small components. If a region is isolated from the network at large, but has 1001 nodes, it won't be flagged as small, and will be used in step (1) above as the "not small component" snapping candidate.
By increasing the small component size limit, you'll start to flag those larger areas as "small components", and this will cause the snapping logic to likely not snap to them if other points in your request lie elsewhere.
There's a limit to this - we picked 1000 because it's generally larger than most isolated regions - they tend to be small. It sounds like perhaps you're encountering regions of disconnect that are >1000 edges in size. This seems odd within the general road network, there should be very very few of these - are you dealing with extracts from OSM where perhaps you've cut off portions near the border?
This issue seems to be stale. It will be closed in 30 days if no further activity occurs.
Is there a way to remove all small components from routing graph for all nearest/table/... requests?
Now and then we see results, where the matching coordinates are linked to routing islands, which made our solutions fail (very automated jobs)