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

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
11224
accept rate: 0%

edited 03 Dec '20, 03:55

maxerickson's gravatar image

maxerickson
12.7k1083176


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.7k1083176
accept rate: 32%

edited 03 Dec '20, 03:56

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:

×63
×5
×3

question asked: 02 Dec '20, 11:58

question was seen: 1,292 times

last updated: 03 Dec '20, 03:56

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