Closed xiaozhi12345678 closed 5 years ago
Without a code snippet, I can only speculate what you did wrong. Did you try computing the distance between the point and the outline of the lanelet that you were expecting? If it is lage (several thousand kilometers) it might be that you used inconsistent transformations for loading the map and transforming the point. If it is smaller, then it might be that there is something wrong with the map or that ther actually is a lanelet which bounding box is closer.
So, how can I locate the GPS point in which lanelet? Looking forward to your reply, thank you.
Should I create a R-tree to solve this problem?
Sorry, I don't understand what you mean. If you want to locate the Lanelet that is closest to some gps point you could do (in python):
gpsPoint = lanelet2.core.GPSPoint(45,8)
plocal = myProjector.forward(gpsPoint)
lanelets = lanelet2.geometry.findNearest(myMap.laneletLayer, plocal, 1)
where myProjector is a projector object that was used to load the map (myMap) and gpsPoint is the coordinate you are searching with.
Hi,I use the function findnearest to locate GPS point in which lanelet,but it didn't find correct lanelet id. And my osm map is in China,I modify the origin in code. I selected GPS point in my osm map with JOSM,in JOSM I use utm 50N projection,but I think the projection doesn't matter because I make comparing with different projection in JOSM with same location and their GPS similarily. Is there something I need modify?How can I get the right lanelet id?thank you!