A library to create interactive maps of geographical datasets.
Project description
A library to create interactive maps of geographical datasets.
- 🌍 EOmaps provides a simple and intuitive interface to visualize and interact with geographical datasets
- ⬥ Data can be provided as 1D or 2D
lists
,numpy-arrays
,pandas.DataFrames
- or directly from GeoTIFFs, NetCDFs and csv-files.
- ... usable also for large datasets with millions of datapoints!
- ⬥ WebMap layers, annotations, markers can be added with a single line of code
- ⬥ EOmaps is built on top of
matplotlib
andcartopy
and integrates wellpandas
andgeopandas
- 🌎 Quickly turn your maps into powerful interactive data-analysis widgets
- ⬥ use callback functions to interact with the data (or an underlying database)
- ⬥ compare multiple data-layers, WebMaps etc.
🌲🌳 Checkout the documentation for more details and examples 🌳🌲
❗ update notice ❗
There are breaking API changes between
EOmaps v3.x
andEOmaps v4.0
To quickly update existing scripts, see: ⚙ Port script from EOmaps v3.x to v4.x
[click to show] a quick summary of the API changes
-
the following properties and functions have been removed:
-
❌
m.plot_specs.
-
❌
m.set_plot_specs()
-
Arguments are now directly passed to relevant functions:
m = Maps # m.set_plot_specs(cmap=..., vmin=..., vmax=..., cpos=..., cpos_radius=..., histbins=...) # m.plot_specs.< > = ... m.set_data(..., cpos=..., cpos_radius=...) m.plot_map(cmap=..., vmin=..., vmax=...) m.add_colorbar(histbins=...)
-
-
🔶
m.set_shape.voroni_diagram
is renamed tom.set_shape.voronoi_diagram
-
🔷 custom callbacks are no longer bound to the Maps-object
- the call-signature of custom callbacks has changed to:
def cb(self, *args, **kwargs) >> def cb(*args, **kwargs)
- the call-signature of custom callbacks has changed to:
🔨 Installation
To install EOmaps (and all its dependencies) via the conda
package-manager, simply use:
conda install -c conda-forge eomaps
For more information, have a look at the installation instructions in the documentation!
✔️ Citation
Did EOmaps help in your research?
Consider supporting the development and add a citation to your publication!
🚀 Contribute
Found a bug or got an idea for an interesting feature?
Open an issue or start a discussion and I'll see what I can do!
(I'm of course also happy about actual pull requests on features and bug-fixes!)
🌳 Basic usage
🛸 Checkout the documentation! 🛸
- A list of coordinates and values is all you need as input!
- plots of large (>1M datapoints) irregularly sampled datasets are generated in a few seconds!
- Represent your data
- as shapes with actual geographic dimensions (ellipses, rectangles, geodetic circles)
- via Voroni diagrams and Delaunay triangulations to get interpolated contour-plots
- via dynamic data-shading to speed up plots of extremely large datasets
- Re-project the data to any crs supported by cartopy
- Quickly add features and additional layers to the plot
- Markers, Annotations, WebMap Layers, NaturalEarth features, Scalebars, Compasses (or North-arrows) etc.
- Interact with the data via callback-functions.
import pandas as pd
from eomaps import Maps
# the data you want to plot
lon, lat, data = [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]
# initialize Maps object
m = Maps(crs=Maps.CRS.Orthographic())
# set the data
m.set_data(data=data, x=lon, y=lat, crs=4326)
# set the shape you want to use to represent the data-points
m.set_shape.geod_circles(radius=10000) # (e.g. geodetic circles with 10km radius)
# (optionally) classify the data
m.set_classify_specs(scheme=Maps.CLASSIFIERS.Quantiles, k=5)
# plot the map using matplotlibs "viridis" colormap
m.plot_map(cmap="viridis", vmin=2, vmax=4)
# add a colorbar with a histogram on top
m.add_colorbar(histbins=200)
# add a scalebar
m.add_scalebar()
# add a compass (or north-arrow)
m.add_compass()
# add some basic features from NaturalEarth
m.add_feature.preset.coastline()
# add WebMap services
m.add_wms.OpenStreetMap.add_layer.default()
# use callback functions make the plot interactive!
m.cb.pick.attach.annotate()
# ----- use multiple layers to compare and analyze different datasets!
# ---- add another plot-layer to the map
m3 = m.new_layer(layer="layer 2")
m3.add_feature.preset.ocean()
# peek on layer 1 if you click on the map
m.cb.click.attach.peek_layer(layer="layer 2", how=0.4)
# switch between the layers if you press "0" or "1" on the keyboard
m.cb.keypress.attach.switch_layer(layer=0, key="0")
m.cb.keypress.attach.switch_layer(layer="layer 2", key="1")
# get a clickable widget to switch between the available plot-layers
m.util.layer_selector()
# ---- add new layers directly from GeoTIFF / NetCDF or CSV files
m4 = m.new_layer_from_file.GeoTIFF(...)
m4 = m.new_layer_from_file.NetCDF(...)
m4 = m.new_layer_from_file.CSV(...)
🌼 Thanks to
- Jakob Quast for designing the nice logo!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.