How to draw boundaries for a city coming from database?

my question is city coming from database . for that city i need to draw boundaries for that city like a dotted line on map . it is some what related to javascript and php .simply i can make pointer for the city with lat and lang but what i want is boundaries .for that i need to purchse a api .

Hi shivajyothikondapart welcome to the forum

What you are looking for is “polylines”. For a simple rectangle only four points are required, one for each corner. For shapes that are more complex, eg. a river, a gerrymandered district, it could be painstaking to define all of the necessary points.

Personally I would likely prefer to use a “map app” like QGIS to create images and use those because many times the work of determining the shapes points has already been done.

JavaScript map APIs like Google Maps and OpenStreetMap support polylines but I don’t know if what you would need is available or you would need to write your own.

It depends on what and how many of these polylines you need.

1 Like

i use open street map and get the boundaries like list points . after some hits to the link it is not supporting i need to purchase any api for that to get the boundaries .
please suggest a link for boudaries

As I posted, it depends on what you want. There is some chance it already exists but you will need to look for it.

https://wiki.openstreetmap.org/wiki/Downloading_data

Specifically, what data are you wanting to have?

Hi,

For example
i have city it is dynamic from database . ex it is hyderabad i get the lat and lang .
from that i want boundaries to show a dotted line on hyderabad of a map .every time city changes the map also change with boundaries

.

One way would be to download the entire “planet” dataset and use what you need from it.

https://planet.openstreetmap.org/

Though if a 74GB download is excessive you may be able to find a less heavy extract

Extracts & Mirrors

The complete planet is very large, so you may prefer to use one ofseveral periodic extracts (individual countries or states) from third parties. GeoFabrik.de and BBBike.org are two providers of extracts with up-to-date worldwide coverage.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.