This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

extracting street data from osm files

0

Hi Iam quite new to open street map so have a pretty basic question

How would I go about extracting all the street data from an osm file.

Eg

Street number , street name, suburb, post code , long, lat

Regards Adrian

asked 24 May '13, 17:24

adrian's gravatar image

adrian
11112
accept rate: 0%


2 Answers:

1

The tag you'll find most streets under is highway. There are lots of different used values for highway, e.g. highway=motorway, highway=residential.

Also, what is the lat/lon of a street in your context - the middle node?

Suburbs and postcodes are not connected to streets other than through their respective geographic location, which means you need at least some kind of GIS-like functionality to get the suburb for a street (or hope there are addresses that reference the street).

Probably you need to load a suitable OSM extract into a PostGIS database and work from there. You can start with https://wiki.openstreetmap.org/wiki/Osm2pgsql and read on from there.

Also, note that OSM street data is not complete and that suburb data quality and quantity and suburb tagging may vary from country to country.

So no, thats not a basic question.

answered 24 May '13, 19:08

gormo's gravatar image

gormo
2.9k32660
accept rate: 13%

-1

You are not the first one asking this question.

Please type keywords like "extract street" or similar in the searchbox of this FAQ site, and you will get a number of hints about your aim.

answered 25 May '13, 20:06

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Source code available on GitHub .