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

i want to download the china map boundary from OSM and get shapefile;

1.Get the whole china country doudary with province level (a whole country boudary line and province lines)

2.Get the whole china country boundary with city level(a whole country boudary line and with province and city lines)

3.Get the whole china country boundary with area level(a whole country boudary line and with province and city and area lines)

How can i make it with overpass API;

thanks for your help

asked 18 Jan '20, 14:03

red_o_sun's gravatar image

red_o_sun
11114
accept rate: 0%


All of the solutions seem to be -very- complicated compared to simply using https://wambachers-osm.website/boundaries/

permanent link

answered 19 Feb '20, 09:32

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

thanks i ll tried this; @Simon

(19 Feb '20, 09:54) red_o_sun

Hi,Simon:

 i can not open your website these days? why? can you open it ?
(05 Mar '20, 08:50) red_o_sun

Hi,Simon: i tried to download all boundaries i need ,then it notice me: "Too many boundaries selected. Please use the CLI with parameters like &from_al, &to_al and &exportLayout. For help press Info/Help button."

(13 Mar '20, 15:11) red_o_sun

Hi,

You could test with http://overpass-turbo.eu/, using wizard tool to build your request.

For instance, for your first point "1.Get the whole china country boundary with province level (a whole country boudary line and province lines)", you could use these expressions for wizard:

name='中国' AND type=boundary AND boundary=administrative AND admin_level=2 AND type:relation

type=boundary AND boundary=administrative AND admin_level=4 IN China

You may have to increase default timeout (25).

You can try QuickOSM in QGIS to get it in shapefile, or import your overpass json result in QGIS to convert it.

You can also try to download your data from http://download.geofabrik.de/asia/china.html directly in shapefile and filter it later (but the shapefile is really big for China).

To know which admin_level to use to request data, have a look at Wiki OSM - Tag:boundary=administrative (see China entry in the table)

Good luck !

Augustin

permanent link

answered 18 Jan '20, 21:16

augustind's gravatar image

augustind
1663413
accept rate: 10%

edited 18 Jan '20, 21:18

Hi,augustind:

 thanks very much for you great help ;

emm; but i need detail code like this to run in wizard tool(but it always failed to run ):

relation
  ["boundary"="administrative"]
  ["admin_level"="2"]
  ["name:en"="People's Republic of China"];
(._;>;);
out body;

So maybe i need a code that really come to run successfully ;

thanks

(19 Jan '20, 03:44) red_o_sun

Maybe

Below requests works for me.

  • Get the whole china country boundary

[out:json][timeout:25]; // gather results ( relation ["boundary"="administrative"] ["admin_level"="2"] ["name:UN:en"="China"]; ); out body; (._;>;); out skel qt;

  • Get the province level [out:json][timeout:25]; {{geocodeArea:China}}->.searchArea; ( relation["type"="boundary"]["boundary"="administrative"]["admin_level"="4"](area.searchArea); ); out body; (._;>;); out skel qt;

You could be able to union these requests to get results in one shot

permanent link

answered 19 Jan '20, 10:09

augustind's gravatar image

augustind
1663413
accept rate: 10%

edited 19 Jan '20, 10:12

Hi,augustind:

 i use : https://overpass-turbo.eu/

 input your code:

  ![alt text][1]

 Notice mE:

 /missing translation/
 /missing translation/

 /missing translation/

Is this my network problem?

thanks

(20 Jan '20, 03:23) red_o_sun

I don't understand what you mean by ![alt text][1]

(20 Jan '20, 13:18) augustind

Oh, that's a picture can not work; Hi,augustind:

Some times it can be work normally ,and show the boundary in map;

How do i download the "map" data query from the website:https://overpass-turbo.eu/ Thanks

(21 Jan '20, 08:31) red_o_sun

Hi,augustind:

it's really a problem for me to use the website ; the export button can not work at all.

so follow your advice :

download your data from http://download.geofabrik.de/asia/china.html directly in shapefile and filter it later (but the shapefile is really big for China).

year ,it's really a big file to import to QGIS tool. this file contains so many lines or builds polygeon...

so if i just only want to filter all the area ,how do i do?

it means i only want to filter the level of boudary like changed the :

["admin_level"="4"] to ["admin_level"="6"] or ["admin_level"="8"]

how do i do ?

Thanks

(22 Jan '20, 07:21) red_o_sun

Hi, You say "it's really a problem for me to use the website ; the export button can not work at all.": what is your web browser ? maybe try another one ?

(22 Jan '20, 20:41) augustind

Hi,augustind:

Long time no see coz china serious Novel Coronavirus Pneumonia.

i has tried chrome ,IE,firefox ,all of them the button "export" can not work

(19 Feb '20, 09:25) red_o_sun

i upload the pic for this @augustind

(19 Feb '20, 09:48) red_o_sun

and i want to get the boudary lat/lon as format xxx.geojson file;@auguistind

(19 Feb '20, 09:52) red_o_sun

Hi,augustind , can you help to check it why ?or can help to download the boudaries for me ? thanks

(05 Mar '20, 09:11) red_o_sun
showing 5 of 10 show 5 more comments

alt text

permanent link

answered 19 Feb '20, 09:48

red_o_sun's gravatar image

red_o_sun
11114
accept rate: 0%

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:

×4

question asked: 18 Jan '20, 14:03

question was seen: 4,201 times

last updated: 13 Mar '20, 15:11

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