I am working on project where i need the boundaries at admin level 6 in geojson format. I am using the following query. but the output of the query also includes "admin_centre". I dont want admin_centre in my output. how can i archive this?

Query:

[out:json][timeout:25];
{{geocodeArea: india}}->.searchArea;
(
    relation(area.searchArea)["type"="boundary"][admin_level = 6];
);
out geom;

asked 02 Dec '20, 11:58

PramodG's gravatar image

PramodG
1114
accept rate: 0%

edited 03 Dec '20, 03:55

maxerickson's gravatar image

maxerickson
12.4k1079174


Build up the data directly instead of using out geom;:

[out:json][timeout:25];
{{geocodeArea: Indiana}}->.searchArea;
rel(area.searchArea)["type"="boundary"][admin_level = 6];
out;
(
  way(r);
  node(w);
);
out skel;

http://overpass-turbo.eu/s/10NK

The first out; is the boundaries and then the out skel; only includes the parts of the ways and nodes that are needed to construct the geometries.

(Note that I've used "Indiana" to make the example query complete faster)

permanent link

answered 03 Dec '20, 03:53

maxerickson's gravatar image

maxerickson
12.4k1079174
accept rate: 31%

edited 03 Dec '20, 03:56

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:

×59
×3
×2

question asked: 02 Dec '20, 11:58

question was seen: 169 times

last updated: 03 Dec '20, 03:56

powered by OSQA