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

0
1

Hi,

I'm looking to get a list of states or regions for countries. I'm using Overpass Turbo to get the list of data. From searching the various questions, I found that someone used this specific code:

[timeout:900]; area["ISO3166-1"="us"]["admin_level"="2"];(rel(area)["admin_level"="4"];); out qt;

When I input this into Overpass Turbo it fails.

Can anyone help with generating the correct code to get a list of states or regions for a country? Thanks!

asked 20 Oct '16, 17:49

michael_arrivalist's gravatar image

michael_arri...
21112
accept rate: 0%


I can't get the Overpass Turbo query to work but this site may do it for you. https://wambachers-osm.website/boundaries/ The documentation link explains the process well

permanent link

answered 21 Oct '16, 01:05

nevw's gravatar image

nevw
9.8k2690178
accept rate: 9%

edited 05 Jul '17, 08:10

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273

If you really mean you need a list, something like this should work:

[out:csv(::type, ::id, name)][timeout:120];
{{geocodeArea:Belgium}}->.searchArea;
(
relation["admin_level"="4"](area.searchArea);
);
out body;

This might even actually work for the whole US. If you need the geometry too, this is quite a heavy query to ask. It might like look something like this, but if it doesn't time out, it is sure to crash your browser. If you want the data without crashing your browser, check the answer here.

But if you need a map, you're probably better of with either the Boundaries tool or extract the data yourself (which I would do like this, but there are many ways up the mountain)

permanent link

answered 24 Oct '16, 10:02

joost%20schouppe's gravatar image

joost schouppe
3.4k245087
accept rate: 12%

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:

×14

question asked: 20 Oct '16, 17:49

question was seen: 7,304 times

last updated: 05 Jul '17, 08:10

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