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

1
1

Xapi will give me such a list, but I have to download the objects themselves. For relations it's even worse: xapi not only gives you the relations but all the elements.

So how would I get, for instance, a list of all relations with network=US:US?

asked 16 Jul '10, 06:11

NE2's gravatar image

NE2
1.4k333954
accept rate: 9%


The API has a search method that you can use for this. The request to use in your example would look like this:

http://api.openstreetmap.org/api/0.6/relations/search?type=network&value=US:US

This is little known and little used because unlike XAPI, it does not support bounding box queries so you will always find all objects, world-wide, that match your request. (The same request works for ways or nodes if you replace "relations" accordingly in the query.)

This query will return the matching objects, but not referenced objects (i.e. no nodes in ways or members in relations).

The request is documented on the Wiki but for some reason it has not made it onto the API 0.6 page.

permanent link

answered 16 Jul '10, 07:56

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Exactly what I wanted. Thanks :)

(16 Jul '10, 10:52) NE2

Now wait a second. I don't remember what happened yesterday, but I downloaded that query today and it's incomplete. For example, relation 112245 is missing.

(16 Jul '10, 23:50) NE2
Your answer
toggle preview

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
×32
×16

question asked: 16 Jul '10, 06:11

question was seen: 9,482 times

last updated: 16 Jul '10, 23:50

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