Skip to content

Commit

Permalink
Merge pull request #76 from raphaelquast/dev
Browse files Browse the repository at this point in the history
Merge for v4.1
  • Loading branch information
raphaelquast authored May 16, 2022
2 parents 6e3204d + ac60df8 commit 43eaaca
Show file tree
Hide file tree
Showing 13 changed files with 695 additions and 193 deletions.
43 changes: 20 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ 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](https://github.com/raphaelquast/EOmaps/issues) or start a [discussion](https://github.com/raphaelquast/EOmaps/discussions) and I'll see what I can do!
Open an [issue](https://github.com/raphaelquast/EOmaps/issues) or start a [discussion](https://github.com/raphaelquast/EOmaps/discussions), and I'll see what I can do!
(I'm of course also happy about actual pull requests on features and bug-fixes!)

---------------
Expand Down Expand Up @@ -130,62 +130,59 @@ Open an [issue](https://github.com/raphaelquast/EOmaps/issues) or start a [discu
- Interact with the data via callback-functions.

```python
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)
# add basic map-features from NaturalEarth
m.add_feature.preset.coastline()
m.add_feature.cultural_50m.admin_0_countries(fc="none", ec="g")

# easily visualize both structured and unstructured datasets
m.set_data(data=[1, 2, 3, 4], x=[45, 46, 47, 42], y=[23, 24, 25, 26], 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
# plot the data
m.plot_map(cmap="viridis", vmin=2, vmax=4)

# add a colorbar with a histogram on top
# add a colorbar with a colored 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
# add imagery from a variety of open-access WebMap services
m.add_wms.OpenStreetMap.add_layer.default()

# use callback functions make the plot interactive!
# use callback functions to interact with the map!
m.cb.pick.attach.annotate()

# ----- use multiple layers to compare and analyze different datasets!
# ---- add another plot-layer to the map
# use multiple layers to compare and analyze different datasets!
m3 = m.new_layer(layer="layer 2")
m3.add_feature.preset.ocean()

# peek on layer 1 if you click on the map
# attach a callback to 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
# attach callbacks to switch between the layers with 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
# add zoomed-in "inset-maps" to highlight areas on th map
m_inset = m.new_inset_map((10, 45))
m_inset.add_feature.preset.coastline(fc="g")

# ---- plot data 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(...)

```

----
Expand Down
42 changes: 35 additions & 7 deletions docs/EOmaps_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ There are 3 basic steps required to visualize your data:
|toggleEnd|

.. image:: _static/fig1.gif
:width: 75%

.. raw:: html

<hr>


🌍 Data-classification and multiple Maps in one figure
Expand All @@ -48,7 +46,7 @@ There are 3 basic steps required to visualize your data:
|toggleEnd|

.. image:: _static/fig2.gif

:width: 75%


🗺 Customize the appearance of the plot
Expand All @@ -69,7 +67,7 @@ There are 3 basic steps required to visualize your data:
|toggleEnd|

.. image:: _static/fig3.png

:width: 75%


🛸 Turn your maps into powerful widgets
Expand All @@ -96,7 +94,7 @@ There are 3 basic steps required to visualize your data:
|toggleEnd|

.. image:: _static/fig4.gif

:width: 75%


🌲 🏡🌳 Add overlays and indicators
Expand All @@ -115,6 +113,7 @@ There are 3 basic steps required to visualize your data:
|toggleEnd|

.. image:: _static/fig5.gif
:width: 75%

The data displayed in the above gif is taken from:
- NaturalEarth (https://www.naturalearthdata.com/)
Expand All @@ -132,6 +131,7 @@ The data displayed in the above gif is taken from:
|toggleEnd|

.. image:: _static/fig6.gif
:width: 75%

The data displayed in the above gif is taken from:
- Sentinel-1 Global Backscatter Model (https://researchdata.tuwien.ac.at/records/n2d1v-gqb91)
Expand Down Expand Up @@ -164,6 +164,8 @@ geopandas.GeoDataFrames can be used to assign callbacks with EOmaps.
|toggleEnd|

.. image:: _static/fig7.gif
:width: 75%


The data displayed in the above gif is taken from:
- NaturalEarth (https://www.naturalearthdata.com/)
Expand Down Expand Up @@ -201,6 +203,7 @@ EOmaps has a nice customizable scalebar feature!
|toggleEnd|

.. image:: _static/fig8.gif
:width: 75%

The data displayed in the above gif is taken from:
- NaturalEarth (https://www.naturalearthdata.com/)
Expand All @@ -225,7 +228,7 @@ This example shows how to use EOmaps to analyze a database that is associated wi


.. image:: _static/fig9.gif

:width: 75%


🧮 Select 1D slices of a 2D dataset
Expand All @@ -246,3 +249,28 @@ Use custom callback functions to perform arbitrary tasks on the data when clicki


.. image:: _static/example_row_col_selector.gif
:width: 75%


.. _EOmaps_examples_inset_maps:

🔬 Inset-maps - get a zoomed-in view on selected areas
------------------------------------------------------

Quickly create nice inset-maps to show details for specific regions.

- the location and extent of the inset can be defined in any given crs
- (or as a geodesic circle with a radius defined in meters)
- the inset-map can have a different crs than the "parent" map

(requires EOmaps >= v4.1)

|toggleStart|

.. literalinclude:: ../tests/example_inset_maps.py

|toggleEnd|


.. image:: _static/example_inset_maps.png
:width: 75%
Binary file added docs/_static/example_inset_maps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/minigifs/inset_maps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 43eaaca

Please sign in to comment.