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.

  • This is the correct site to ask your question, but since you are new, please know that gis.stackexchange.com might help you with some other GIS stuff (but not s/w recommendations). Good luck
    – Mawg
    Commented Jul 18, 2019 at 11:44

1 Answer 1


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 ( geonames.org ) 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.

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.