1

I downloaded the geonames file for my city. Then I used osmfilter to keep my nodes of interest (those with name tags in this case). I am trying to construct some sort of dictionary which maps location tags to long/lat pairs. However in my .osm file which I get from osmfilter, only node elements are associated with long/lat data. However, when I use the Nomiantim website to reverse geocode, and I enter the name of a street that actually is specified as a way element in osm, Nominatim gives me the coordinates of the center point of the street (how does Nominatim do this, what extra data does it use?). My question is whether I can calculate/access center point coordinates for "ways" through the data I have in my osm file.

I should add that I don't want to work with Nominatim. The idea is to rely on the .osm file for the construction of this dictionary/map.

2
  • If I understand you right, perhaps this answer is enough? gis.stackexchange.com/a/181335/9073
    – oskarlin
    Oct 13, 2017 at 15:49
  • Thank you for the link. I found the answer to my question in the osmconvert tutorial. But qgis will definitely come on handy.
    – Miluleh
    Oct 17, 2017 at 11:58

1 Answer 1

2

I found the answer to my question. When converting .osm to .o5m or .csv format by means of osmconvert there is an option to turn all ways and relations to nodes, and assign to them the lon and lat of their centers. This is simply done by adding --all-to-nodes to the osmconvert command.

For example:

osmconvert hamburg.pbf --all-to-nodes -o=hamburg_nodes.osm 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.