Hello Guys,
Is there a way to setup snap to road distance/range is graphhopper 9.x? What the default value used in graphhopper for snapping?
Hello Guys,
Is there a way to setup snap to road distance/range is graphhopper 9.x? What the default value used in graphhopper for snapping?
in version 10.x (I am not sure if its there in version 9.x) you can use the max region search, its a bit confusing how it works, but essentially from what I can work out when you snap to a location it searches in regions of 300x300m, and you can set the number of these tiled regions it will search, so with the below code (in Kotlin),
val TILE_RADIUS = 10
// sets the radius of tiles (300x300 m squares) to search when looking up a road from a gps location
(hopper.locationIndex as LocationIndexTree).setMaxRegionSearch(TILE_RADIUS)
You will be setting it to have a radius of 10 (i.e. a diameter of 20) thus it will create a 20 x 20 grid of 300m x 300m squares, i.e. the total search area size will be 6000m x 6000m.
I may be wrong, but from what I can work out this is what its doing
To limit the snap distance more precisely it is best to fetch the edges from the location index and then filter them based on their distance.
Hello guys,
Thanks for your help. I was looking for a way to provide this in the config.yml. But thanks the @MeirR reply, I found the key must be provided in graphhopper 9.x. I’ll try it later.
Thank you