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

I have admin_level=8 for South Oxfordshire District. I wish to obtain admin_level=10 civil parishes within that boundary.

asked 23 Oct '17, 13:01

silver%20mapper's gravatar image

silver mapper
256262735
accept rate: 0%


I think this should do it:

http://overpass-turbo.eu/s/sy3

For queries like in South Oxfordshire, Overpass Turbo looks up the name using the service at http://nominatim.openstreetmap.org/. It takes the first result, which for "South Oxfordshire District" is not the area you want to search in: http://nominatim.openstreetmap.org/search.php?q=South+Oxfordshire+District&polygon_geojson=1&viewbox=

Here removing "district" does the trick. Overpass API also has some ways of retrieving an area created from a specific OpenStreetMap feature: http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#By_area_.28area.29

So area(3600299097)->.searchArea; or area[admin_level=8][name="South Oxfordshire"]->.searchArea; should also work to retrieve the area. These methods can be useful if Nominatim doesn't match a search or to move the query out of Overpass Turbo.

permanent link

answered 23 Oct '17, 14:13

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

Max

I thank you for your prompt and informative reply.

I realised my post should have read "admin_level"=8 and name="South Oxfordshire", and wanted to edit it but your reply beat me to it. Running your suggestion gives me a result but there are straight lines connecting certain points in addition to the boundaries themselves. The appearance is a mixture of white and yellow areas, suggesting some sort of overlap. This is the same result as I have achieved, myself, which is why I asked the question. Copying the result as a .kml file into uMap replicates all lines. Opening an exported and saved .kml file into JOSM displays the boundaries alone, however. Importing that saved .kml file into uMap gives the same result as copying it.

Looking into it further, my impression is this: each admin level 10 boundary is formed of a number of sections, as we contributors choose. The straight lines appear to run between the ends of such sections, when I view and select sections in JOSM.

(23 Oct '17, 16:33) silver mapper

I expect the tools you are using expect the relations to be in a certain order, which isn't something OSM has treated as important.

You can use http://overpass-turbo.eu/s/syd to download the OSM data directly into JOSM and see that it is able to process the areas reasonably. The relation editor window also has a feature where it visualizes how the ways are connected.

If you are looking for a KML file, the easiest solution is probably out geom; which will cause Overpass API to generate the areas (instead of Overpass Turbo): http://overpass-turbo.eu/s/sye

(23 Oct '17, 16:58) maxerickson

Max

Between times, I thought the result was because the administrative boundaries are not closed ways.

I thank you for your further information and help, and http://overpass-turbo.eu/s/sye does give me what I seek, indeed. This answers my post.

(23 Oct '17, 18:24) silver mapper

Hi there, I want to get the city, district and Xian boundaries on that website too. I'm allergic to code, tried change number 10 to 5 in your link but not work. I want to draw the city, district, and County(Xian in China) level boundaries of those cities: Shanghai, Suzhou, Wuxi, Changzhou, Huzhou, Jiaxing, Hangzhou, Shaoxing and Ningbo. Please help. What should I code to achieve that, please

(27 Apr '20, 03:53) CliffHU
1

@CliffHU, please ask a new question. Do not use comments to ask new questions.

(27 Apr '20, 04:36) escada
showing 5 of 6 show 1 more comments

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:

×228
×2

question asked: 23 Oct '17, 13:01

question was seen: 10,065 times

last updated: 27 Apr '20, 07:05

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