Skip to content

StratoDem Analytics extensions of mapping and plotting platforms including matplotlib, leaflet, and folium

License

Notifications You must be signed in to change notification settings

StratoDem/stratplotlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stratplotlib is a custom, open source mapping tool that allows users to easily interactively visualize geospatial data. The tool works by creating a base map object that is used for the addition of various visualization layers.

Stratplotlib was created as part of Stratodem Analytics’ mapping and plotting platform and is built on top of folium, matplotlib and leaflet. It is designed for the simplistic integration of many elements into a map plotting while largely assuming the use of pandas.DataFrames as the underlying data structure of the user.

Prerequisites
pip install folium json geopandas numpy pandas shapely

Stratplotlib currently provides 5 APIs for different geospatial visualizations:

  • choropleth, assigns a shade of a color to an area – plots a value “gradient” over space
  • groupmap, assigns distinct colors to different area groups
  • scatter, plots a set of (x,y) coordinates into the map
  • marker, plots a set of (x,y) coordinates as polygon markers into the map
  • line, draws a line between a source and a destination point

Examples
from stratplotlib import stratomap

m = stratomap()
m.choropleth(df, value_col=‘VALUES’, geometry_col=‘GEOMETRY’)
m.save(‘map.html’)

m = stratomap()
m.scatter(df, x_col=‘x’, y_col=‘y’, color=‘red’)
m.line(source=list_of_source, target=list_of_dest, color=‘yellow’)
m.marker(x, y, number_of_sides=3, fill_color=‘black’, color=‘green’, rotation=30)
m.show()

m = stratomap()
m.line(source=list_of_source, target=list_of_dest, color=‘red’, weight=list_of_weights)
m.show()

m = stratomap()
m.set_tiles(‘cartodbdark_matter’)
m.scatter(df, x_col=‘LONGITUDE’, y_col=‘LATITUDE’, color=‘yellow’, scale=5, value_col=‘VALUES’)


m = stratomap()
m.groupmap(df, group_col=‘GROUP’, geometry_col=‘GEOMETRIES’)

About

StratoDem Analytics extensions of mapping and plotting platforms including matplotlib, leaflet, and folium

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •