GraphHopper.com | Forum | GitHub | Maps | Blog

Cannot route correctly in Route Optimization


#1

When I optimize using Route Optimization API, some addresses are not optimizing correctly.
When I test in Graphhopper Map also, it’s not working correctly.
I attached Graphhopper Map result and Google Map result.


#2

It seems as though it cannot connect the destination (red marker) to the nearest road. Would you mind to post the coordinates of the red marker here? Thanks.

EDIT: Ah ok, if I zoom into the images, I can see the coordinates. We ll let you know as soon as we can give you more info.


#3

The network on Juron Island is not connected to the main network at all (e.g. 1.280831,103.713684).

EDIT: It is obviously a data problem: https://www.openstreetmap.org/directions?engine=osrm_car&route=1.2767%2C103.7168%3B1.3143%2C103.7331#map=13/1.3002/103.7205 (mapzen cant find it either)


#4

it is due to the gate barrier:


#5

I tried from 1.326998,103.800238 to 1.282351,103.715583 in Openstreet Map, route is shown almost Jurong Island. But in Graphhopper Map, the route is showing totally incorrect. How can I try to show nearest place although there is gate barrier.

Thanks for all replies.


#6

We basically snap coordinates to the nearest road elements and so most routers do:

Let me find out how gate barriers are handled internally. For the time being, I can only suggest you to map all points on Juron Island to 1.310306,103.710122 like this

https://graphhopper.com/maps/?point=1.309147%2C103.733585&point=1.310306%2C103.710122&locale=de&vehicle=car&weighting=fastest&elevation=true&use_miles=false&layer=Omniscale


#7

Thanks for reply

We are not targeting only Singapore for Rout Optimization, trying to route globally. So how can we handle this kind of issue? Is there any way to notify user?


#8

I assume that this is a special case (usually very rare). Additionally, I think that it does not influence the results of the optimization that much. When it comes to notification, you will only be notified if a coordinate cannot be connected at all.


#9

@myominlin If you have customers there or have local knowledge you can directly change the map data to e.g. explicitely allow motor vehicles going through the mentioned gate. The good thing is that we update our data quickly and so this will be fixed in 1-3 days instead of months compared to some alternative providers.


#10

Thanks all for answering my question. Currently, I will just inform to users that location is not available for optimization.