I'm looking for a way to grab the capital of a relation, for which I have the OSM ID.

I can print out the relation like this:

out body;

and I have the data (node with "role": "admin_centre"), however I would then need to parse the JSON myself which is:

  • a waste of bandwidth for everyone involved.
  • needless processing on my side
  • I would then need to make another query to OSM to get data for the node

What I need is the data found here https://www.openstreetmap.org/node/26761400 , but in JSON format and through the API. I don't have the OSM ID of the node, only the relation.

So I would like to know if there is a way to get just the node data.


asked 14 Jan '19, 19:55

ianare's gravatar image

accept rate: 0%

edited 14 Jan '19, 19:56

You need a recurse filter:

out body;

Here's a demo.

permanent link

answered 15 Jan '19, 01:37

maxerickson's gravatar image

accept rate: 31%

Perfect, thank you! I had seen the recurse filter in the docs but did not understand it.

(15 Jan '19, 09:44) ianare
Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 14 Jan '19, 19:55

question was seen: 765 times

last updated: 15 Jan '19, 09:44

powered by OSQA