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

Hello, Is there a way to get information about the current zone from OpenStreetMap shapefile ? I mean, I need info whether I am inside the city or outside the city. Is there an attribute that I could use for that ?

asked 07 Feb '13, 11:11

LukaszP's gravatar image

accept rate: 0%

LukaszP, could you tell more about this question ? What do you mean by the city limits, administration borders or other limits ? And secondly what the apparatus youre using ? Greetz

(07 Feb '13, 11:33) Hendrikklaas

From the gheofabrik shapefiles (assuming you use geofabrik shapes) there is no easy way, as they don't contain admin boundaries.

If you had a shapefile with each city as a polygon you could use standard GIS Software (e.g. QGis, ArcGIS) or command line OGR tools (don't know which, though) to determine if your point is inside the "city" polygon.

What's your application/use for the information? Maybe there is a better way.

permanent link

answered 07 Feb '13, 12:35

gormo's gravatar image

accept rate: 13%

city limits : e.g. rural or urban, it's something like administration borders

I've found Tag:boundary=administrative, does it mean that when the value of admin_level = 8 then i'm inside the city, and <> 8 means outside ?

I am using to get shapefiles. One shapefile per country, not per city.

(07 Feb '13, 12:40) LukaszP

Hi Lukasz, just a hint: data downloads from seem to be very outdated, from December 2011!

Have a look at ... they offer up-to-date data files.

(07 Feb '13, 22:43) stephan75

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 07 Feb '13, 11:11

question was seen: 2,809 times

last updated: 07 Feb '13, 22:44

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