StratoDem Analytics extensions of mapping and plotting platforms including matplotlib, leaflet, and folium
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
img images Aug 12, 2016
stratomap project structure Aug 12, 2016
.gitignore Initial commit Aug 2, 2016
LICENSE Initial commit Aug 2, 2016
README.textile Update README.textile Aug 12, 2016
__init__.py init Aug 12, 2016
setup.cfg added init, setup files Aug 12, 2016
setup.py added init, setup files Aug 12, 2016

README.textile

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’)