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

Hi everyone,

I have created around 100 protected areas in Iran over last few months, in order to complete the wiki page regarding these areas, I want to show them in a list with their name and OSM ids in the wiki page. Is there a way to extract Ids of objects in a .osm file? or even better is there a query which can be used to list object's Id based on a specific search criteria?

By the way I have tried Spatial Manger it shows all the tags except Ids.

Thanks

asked 13 Sep '16, 08:49

Adib%20Yz's gravatar image

Adib Yz
291101219
accept rate: 0%


Use overpass turbo and enter “boundary=protected_area in Iran” in the wizard. You'll have the data displayed on a map, and the corresponding json on the "data" tab. You can export that to a format of your liking.

Optionally, replace the "print results" section with "out ids;" so that only ids are returned (ignore the "repair query" suggestion). That might make parsing the data easier.

permanent link

answered 13 Sep '16, 11:09

Vincent%20de%20Phily's gravatar image

Vincent de P... ♦
17.3k18152249
accept rate: 19%

2

Also, avoid linking to object id's whenever possible. See http://wiki.openstreetmap.org/wiki/Overpass_API/Permanent_ID

(14 Sep '16, 14:23) joost schouppe

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:

×147
×55
×5

question asked: 13 Sep '16, 08:49

question was seen: 2,944 times

last updated: 14 Sep '16, 14:23

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