I'd like to plot locations using longitude and latitude coordinates using Python or C++, is there a good library for such a task?
I know that matplotlib is an option, I'm wondering if there are any others?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityI'd like to plot locations using longitude and latitude coordinates using Python or C++, is there a good library for such a task?
I know that matplotlib is an option, I'm wondering if there are any others?
Mapnik is a c++ toolkit for making maps and has python bindings – http://mapnik.org
If you're looking for something that's really easy to use and your lat/long data come from a shapefile, you could check out the Python Geographic Visualizer (GeoVis) module. It has no dependencies, requires no installation, and is very easy to use. In the newest version you can also zoom in on specific areas and symbolize based on attribute classification:
import geovis
# 1 SETUP
geovis.SetMapZoom(x2x=[0,180],y2y=[0,90])
# 2 DATA
countrylayer = geovis.Layer("C:/polygons_shapefile.shp")
countrylayer.AddClassification(symboltype="fillcolor", valuefield="pop_est", symbolrange=[geovis.Color("white"),geovis.Color("red", intensity=0.9, brightness=0.8),geovis.Color("red", intensity=0.9, brightness=0.5)], classifytype="natural breaks", nrclasses=3)
# 3 MAP
newmap = geovis.NewMap()
newmap.AddToMap(countrylayer)
newmap.AddLegend(countrylayer, upperleft=(0.03,0.15), bottomright=(0.6,0.4))
newmap.AddText(relx=0.5, rely=0.05, text="Population, by Country", textsize=0.1, textanchor="n", textboxfillcolor=geovis.Color("white"))
newmap.ViewMap()
...will show you a screen with something like this about 2 seconds later...
Try mapnik if you really need this to be done in python otherwise use http://www.mapsdata.co.uk to plot your geo-spatial data on map. It support variety of gis formats including lat/lon.
Then there's the CartoPy library from the MetOffice. Based on matplotlib, with support for Shapely.
There was a presentation on it at FOSS4G in Nottigham, but I can't seem to find the recording on YouTube yet