NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello,

I would like to download the coordinates of all parks in my region. From what I can tell I need to find all nodes that are tagged with "leisure"->"park".

The only way I can tell to do this is by using the API to parse through the xml of every single node in my region. For example, I am doing the following:

  1. I download the data from a url like this : http://api.openstreetmap.org/api/0.6/map?bbox=-122.1414,37.7206,-122.1365,37.9042
  2. I parse the XML data and find any node, way, relation with leisure->park as one of its tags

My plan is to do the above over 60,000 times, which is quite resource intensive. Is there a better way to find all nodes of a certain tag in a certain region?

Thanks, James

asked 16 Aug '11, 05:09

jamesmcb's gravatar image

jamesmcb
1111
accept rate: 0%

I looked into this a little farther and found some documentation on the XAPI to run a command like this:

http://xapi.openstreetmap.org/api/0.6/node[lesiure=park][bbox=-122.27323,37.8395,-122.25428,37.85097] http://xapi.openstreetmap.org/api/0.6/way[lesiure=park][bbox=-122.27323,37.8395,-122.25428,37.85097]

But nothing appeared :-(

If you look at this call to the normal api:

http://openstreetmap.org/api/0.6/map?bbox=-122.27323,37.8395,-122.25428,37.85097

You will see that there is at least 1 node and 1 way. I am definitely getting closer.

(16 Aug '11, 05:42) jamesmcb

If you do not want to hammer the API servers you can also download the raw OSM data of your desired area via the sources listed at Planet.osm . I would recommend geofabrik.de or cloudmade.com

Process that data with Osmosis or Osmfilter which seems to be a bit easier to handle IMHO.

permanent link

answered 16 Aug '11, 16:20

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

The answer is a call like this:

http://www.overpass-api.de/api/xapi?node[leisure=park][bbox=-123.076,37.059,-121.436,38.529]

Unfortunately xapi.openstreetmap.org is down right now and in my previous queries I was spelling leisure incorrectly.

permanent link

answered 16 Aug '11, 06:34

jamesmcb's gravatar image

jamesmcb
1111
accept rate: 0%

1

There is more than one XAPI server, take a look at the XAPI wiki page. The XAPI server by mapquest is said to be working well and there is also the JXAPI.

(16 Aug '11, 07:13) scai ♦

XAPI request is probably the easiest solution for that but unfortunatelly, XAPI servers are often out-of-service.
Another way is that you download an extract from the whole planet database ([1]) and use the java tool Osmosis ([2]) to limit your search in a bounding box or polygon ([3]) and filter with your specific tag (key/value pair)([4]).

[1] http://wiki.openstreetmap.org/wiki/Planet#Mirrors (in particular, check Geofabrik or Cloudmade producing smaller daily extracts by state, region or country)
[2] http://wiki.openstreetmap.org/wiki/Osmosis
[3] http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage_0.38#Area_Filtering_Tasks
[4] http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage_0.38#--node-key-value_.28--nkv.29

permanent link

answered 16 Aug '11, 10:11

Pieren's gravatar image

Pieren
9.8k2083157
accept rate: 15%

Mapquest Open also has a XAPI running against OSM data, and it's up reliably, and has a GUI.

(16 Aug '11, 22:42) Baloo Uriza

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×930

question asked: 16 Aug '11, 05:09

question was seen: 5,711 times

last updated: 16 Aug '11, 22:42

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum