Is there any Google API (or any other) which can provide boundary information (i.e. Lat, Lng) for a particular location. Location can be a city, district or a region with in a city. For Example Dammam city (Saudi Arabia), Al-Azizia (District of Dammam) etc

Currently my requirement is, data for, Ta'if. I want Lat, Lng coordinates because I want to draw polygon around region.

Here is another similar question, which dosen't provide complete answer. Seeking neighborhood boundaries for Saudi Arabia?

  • 1
    There are some boundaries in OpenStreetMap: osm.org/go/w~ViL?node=1933393717 but I don't know if they have enough detail or completeness for your needs. If there is enough detail, you could extract boundaries from OverPass API.
    – BradHards
    Commented Feb 23, 2015 at 10:27

2 Answers 2


If JavaScript is an option for you, you can use the geocoding service of Google maps API. When you send a geocoding request, you get in response a GeocoderResults object. One if its properties is a geometry object, which in turn has a property called bounds. This is actually a LatLngBounds object, that represnts the area of the geocoding result.

This method will only give you the general area of your location, of course. If you need the actual boundaries as an accurate polygon, you will have to look for that data in other sources.

See here for more details: https://developers.google.com/maps/documentation/javascript/geocoding#GeocodingResults

  1. This link can help you get up to district level boundaries in longitude/latitude. They are in a specific format, you can encode them.

  2. Government provides this website for panchayat/village/district/state boundaries and also provides an API to download the images by defining image box corner points. We can extract the loops from images using python libraries like open-cv. Then it becomes a simple task to map loop pixel boundaries using latitude/longitude. A Python library will give us the loops in terms of pixel coordinates and as we know the image corners, we can relate longitude/latitude using pixel coordinates with linear equations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.