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

Hi to all,

I want to get geojson value for a region(city/state/country). I tried as http://nominatim.openstreetmap.org/search?q=chennai,India&polygon_geojson=1&format=json&limit=1 But it did not give geojson(return geojson for few regions only). If I remove limit, http://nominatim.openstreetmap.org/search?q=chennai,India&polygon_geojson=1&format=json It will return multiple values, geojson also available for type = administrative. So Now i want to a single API for get geojson for a region with type=adminstrative. Any suggestions?

Thanks Rajavelu

asked 30 Jun '15, 08:22

Rajavelu_M's gravatar image

Rajavelu_M
253454858
accept rate: 33%

edited 30 Jun '15, 08:25


For smallish areas use Overpass-Turbo. The client side code in Overpass-Turbo enables the queried OSM data to saved directly as geojson. Once the data gets too big you run into problems both with server-side timeouts (and potentially blocks), and/or client-side memory issues.

This is an example of a simple Overpass-Turbo query for admin units around Chennai. It can be refined by asking only for certain levels of admin units, and by using the area feature to restrict the request to a specific polygon.

permanent link

answered 30 Jun '15, 10:30

SK53's gravatar image

SK53 ♦
28.1k48268433
accept rate: 22%

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:

×710
×689
×193
×37
×36

question asked: 30 Jun '15, 08:22

question was seen: 4,612 times

last updated: 30 Jun '15, 10:30

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