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

Using OsmApi, how can I extract data of an entire region?

1

Hi!

I'm using python with OsmApi - a beautiful python api that let's me directly connect and download data as lists of dictionary objects based on things like nodes, ways, and relations.

I'm trying to extract all the data in a region using its relation id, but since the way it works is to retrieve the boundary way objects of the region, I'm not too sure on how to get all the ways/nodes inside it efficiently.

Any help would be greatly appreciated :)

asked 29 Sep '14, 01:51

jmoak3's gravatar image

jmoak3
21223
accept rate: 0%


2 Answers:

2

If that just front-ends the main OSM API (as the wiki page suggests) I wouldn't use it AT ALL for large downloads. What you need is something that front-ends something like Overpass. Perhaps ask the authors of your Python framework how they suggest that you do that?

answered 29 Sep '14, 08:59

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

I was afraid of that, all roads always point to Overpass haha

Thanks, I'll send them some emails and look into how to integrate Overpass with my current python project :)

(29 Sep '14, 18:37) jmoak3

0

If you want to download all nodes, ways etc. inside the area using osmapi, all you can do at the moment is using a so called "bounding box", this means you simply specify a rectangle, and you get everything that's inside that rectangle. To do this, use the Map function.

But finally if you have a very specific area and you only want ways inside it, then you're better of to import the OpenStreetMap data in a database (e.g. PostgreSQL with PostGIS), and then you can use the full query power to achieve exactly what you want.

answered 07 Oct '14, 17:05

Odi's gravatar image

Odi
111
accept rate: 0%

Source code available on GitHub .