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

Hi. Have some questions:

  1. Can i get list of admin_level=4 territories?
  2. How to get selected territory boundary via osm_id or something like that?

asked 05 Jun '23, 09:35

Dmitry2023's gravatar image

Dmitry2023
11112
accept rate: 0%

edited 05 Jun '23, 11:32

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866


To reply to point 1:

If you want all of them you can use sophox with the following query:

SELECT ?bound ?name ?wikidata WHERE {
  ?bound osmt:admin_level "4" .
  ?bound osmt:type "boundary" .
  ?bound osmt:name ?name .
  ?bound osmt:wikidata ?wikidata
}

Try it

Or with overpass if you want a bounding box selection with the query:

[out:json][timeout:25];
// gather results
(
  relation[admin_level=4]({{bbox}});
);
// print results
out body;
>;
out skel qt;

Try it

With overpass you can download the result of the query in different formats using the button "Export" which maybe replies to point 2.

permanent link

answered 07 Jun '23, 10:09

ernsterwinwg's gravatar image

ernsterwinwg
112
accept rate: 0%

edited 07 Jun '23, 10:24

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:

×10

question asked: 05 Jun '23, 09:35

question was seen: 616 times

last updated: 07 Jun '23, 10:24

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