0

The goal is to construct a data structure that takes the id of a node/way/relation and returns the pair of lat/lon or the collection of lat/lon coordinates assigned to it. So far, I have downloaded the osm file of my city, gotten rid of superfluous nodes like those pointing to amenities, and then used osmconvert with the all-to-nodes feature to construct a csv file that contains the columns @Id@name@lat@lon. This approach does work to construct a look up system for id(of node)->lat/lon. But not for id(of relation/way)--> List of lat/lons. Does anybody know if there is a osmconvert feature or another way to retrieve this kind of list or csv file.

  • Ways and relations don't have coordinates itself. Only nodes have coordinates. If you want to obtain coordinates for ways and relations you have to look at all of their nodes. – scai May 31 '18 at 13:00
  • that's exactly what I'm trying to do with osmconvert or osmfilter, collect the list of nodes that are bundled together as a relations, retrieve their center points and return them as a list of lat/lons. The information is all there in the osm file so there must be a way to not do it manually. – Miluleh May 31 '18 at 13:12
  • 1
    Duplicate post: forum.openstreetmap.org/viewtopic.php?id=62512 – mmd Jun 1 '18 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.