This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

List of States or Regions for a Country

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%


2 Answers:

3

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

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

2

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)

answered 24 Oct '16, 10:02

joost%20schouppe's gravatar image

joost schouppe
3.4k245087
accept rate: 12%

Source code available on GitHub .