Creating polygons over maps and extract the latitude/longitude?

Software Recommendations Asked by Maria on September 22, 2020

I’m looking for software recommendations in order to do the following:

  • Create a polygon (by clicking with a mouse) over an area on a map
  • Extract an array of latitudes/longitudes from the polygon points

Then ideally:

  • List cities within that polygon
  • Determine whether a given lat/long is within the polygon or not.

Have looked over several python libraries (Shapely, matplotlib, geopandas) and the Google Maps Javascript API but was hoping for more recommendations.

One Answer

Both the Bing Maps and Google Maps APIs could be coded to do the first (draw polygon and fetch vertices).

Points in polygons are more difficult if you are attached to a web page interface. If you are happy to put the polygons in a proper database, then Postgres/PostGIS, SQL Server, and Oracle can all do proper spherical point-in-polygon tests.

If the polygon is small (so that a Euclidean approximation is acceptable), then it can be easily coded up yourself. Point-in-polygon on a sphere is more involved - I've coded it up in C# in the past (been there, done that...)

Finally, querying cities: The Geonames database ( ) is useful. You could easily filter the data to extract the city coordinates (ie. discard other features, POIs etc), and store those in a data file to query or in the database.

Answered by winwaed on September 22, 2020

Add your own answers!

Related Questions

Generic diagram generator from markup language

0  Asked on September 25, 2021 by trevor-keith


Android app for logging screentime sessions

1  Asked on February 25, 2021 by hugorune


Search for massive offline file collections

0  Asked on February 24, 2021 by grismar


C++ constexpr math (header-only) library

3  Asked on February 18, 2021 by einpoklum


Alternative package for cheerio

0  Asked on February 15, 2021 by dante-dante


Android: open drawer by swipe

0  Asked on February 15, 2021


PDF as flip book on website

5  Asked on February 13, 2021


Set custom DNS servers in Google Chrome?

3  Asked on February 11, 2021


Customisable countdown app

1  Asked on February 10, 2021 by judith


File hosting service with simple API

0  Asked on February 9, 2021 by steve-bennett


Any photoshop plugin to convert layers to css3

0  Asked on January 31, 2021 by knownow


Converting Visual Basic Code to .NET Framework

2  Asked on January 30, 2021 by tasdid_24


Client training scheduler

1  Asked on January 28, 2021 by user34347


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP