Friday, 20 May 2016

java - What does `findCloseEdges` do in osm2po?


I have something like this:


int[] edges = graph.findCloseEdges(lat, lon, 1); // returns only one element

RoutingResultSegment rrs = graph.lookupSegment(edges[0]);
LatLon[] latlons = rrs.getLatLons()

For the red dot in the image (with lat/lon), array latlons contains the blue points. I would instead expect "close edge" to be a segment of the A3/E70 road.


Here is the image (I don't have enough reputation to post images apparently).


What is the third integer argument in findCloseGraph and what does this method return? I need to do simple "snap to road".



Answer



Oh, this is a very expert question ;-)


graph.findCloseEdges(lat, lon, x)


finds x close Edges that are not necessarily the closest ones. What you are going to find is clear. Use TouchPoint.create(...) instead.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...