Skip to content

ispmarin/maps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maps in Python

I'm investigating the possible solutions for mapping in Python. The requirements are:

  • Plot several different elements (points, markers, lines, polylines, polygons)
  • I need to plot maps with variable resolution (from scale from 1:10 to 1:100.000)
  • A tiles provider (OpenStreetMap or other)
  • The plots should be generated offline
  • A good interface with pandas
  • Map interaction with time variable

Interesting discussion:

Folium

Folium is a Python interface for the Leaflet Javascript map library.

  • Still an early project (version 0.1.6 or 0.2.0-dev)
  • The default tile provider is OpenStreetMap
  • There is no offline option for the moment (every redraw calls the tile API)
  • Supports markers, points, lines, polylines and floaters
  • Can scale, depending only on the tiles available
  • Has a nice gallery with jupyter notebooks as examples

Plotly

Plotly was a closed source, server-based general plotting library that has been open sourced recently.

  • A more mature project
  • Can do several kinds of visualizations
  • Is able to plot offline
  • Supports markers, points, lines
  • Cannot scale the underlying tiles

Basemap

Basemap is a Matplotlib extension for mapping and cartography.

  • Is based on matplotlib, so again, if you are familiar with Matplotlib is quite easy to adapt
  • Is static, no interactivity
  • Kinda complicated to install (no pip package easily available)
  • Can scale and has high resolution maps
  • Very flexible with cartographic settings
  • Probably will not be maintained in the long term (Cartopy is suggested as a possible replacement)

Cartopy

Cartopy is a static cartographic library based on Matplotlib.

  • Needs shapely < 1.5.12, otherwise fails
  • Static maps, no interaction
  • Can use several tile providers or no tiles at all
  • Can read shapefiles
  • Uses shapely
  • Matplotlib integration makes easier to use (if you know matplotlib, that is)
  • Supports markers, points, lines, polylines
  • Can cache the tiles and maps, plots are static by default

But why not use ?

Several plotting tools are using a Javascript backend to do the plotting, like Plotly and Folium. Why not use directly Javascript? So far, the main reason is that our stack is mostly Python and the platforms where the data is coming from is messy. Python is the glue that we use to hide the several backend data sources, so having Python is a reasonable choice for now.

About

Test several Python map frameworks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published