I am wondering if there are examples for using custom edge filters for road snapping. Currently I am using
QueryResult queryResult = hopper.getLocationIndex().findClosest(latitude, longitude, EdgeFilter.ALL_EDGES);
Examples for custom edge filters would be snaps based on OSM tags or edges of certain lengths / max velocities.
At least filtering by edge distance is very simple:
index.findClosest(latitude, longitude, edgeState -> edgeState.getDistance() > 1000);
For OSM tags, velocity etc. you need to read the edge properties using
EncodedValue. For example speed:
double speedFwd = edgeState.get(encoder.getAverageSpeedEnc());
double speedBwd = edgeState.getReverse(encoder.getAverageSpeedEnc());
Looks very useful. I guess this will be released with the next GH version? Is there a release cycle? When do you plan to make the next release?
Yes. You can already use a pre version or wait until 0.13 is released in ~2 months
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.