> pip3.7 install ipyleaflet
Installing collected packages: traittypes, branca, ipyleaflet
Successfully installed branca-0.4.1 ipyleaflet-0.13.3 traittypes-0.2.1
here goes:
cd ~/gis/jup_notebook
jupyter notebook
it prints out this, which opens in Firefox:
http://localhost:8888/tree?token=2ead9ee867947dba3149b21ecf67993e7ff7ab3cbee2dcf3
then:
New -> Python3
and following sample from here:
https://ipyleaflet.readthedocs.io/en/latest/usage.html
it works FINE, and a map shows up!
import os
os.chdir("/home/wendell/cssi/feed/netcdf/from_rserver")
import geopandas as gpd
#aa = gpd.read_file("the_first.gpkg")
bb = gpd.read_file("the_second.gpkg")
first_data = GeoData(geo_dataframe = bb,
style={'color': 'purple', 'opacity':3, 'weight':1.9, 'dashArray':'2', 'fillOpacity':0.6},
hover_style={'fillColor': 'red' , 'fillOpacity': 0.2},
name = 'WxPolys')
m.add_layer(first_data)
m.add_control(LayersControl())
m
retrieve from webfaction:
$ scp wendell@ilikecarrots.com:cssi/from_rserver/echo_tops/ciws/files/QuantizedVIL.20200829T193500Z.gjson .
$ scp wendell@ilikecarrots.com:cssi/from_rserver/echo_tops/ciws/files/QuantizedEchoTop.20200829T193500Z.gjson .
in jupyter:
import os
os.chdir("/home/wendell/cssi/feed/grid_testing")
import geopandas as gpd
cc = gpd.read_file("QuantizedVIL.20200829T193500Z.gjson")
from ipyleaflet import Map, Marker
center = (36.085808, -79.484851)
m = Map(center=center, zoom=15)
marker = Marker(location=center, name="Burlington")
m.add_layer(marker)
display(m)
from ipyleaflet import GeoData, LayersControl
first_data = GeoData(geo_dataframe = cc,
style={'color': 'purple', 'opacity':3, 'weight':1.9, 'dashArray':'2', 'fillOpacity':0.6},
hover_style={'fillColor': 'red' , 'fillOpacity': 0.2},
name = 'vil')
m.add_layer(first_data)
m.add_control(LayersControl())
m
very LAME notebook: notebook
interesting class: Visualize and publish with Python
and these::
Best Libraries for Geospatial Data Visualisation in Python
PyViz/HoloViz (Geoviews, Datashader, HvPlot)
kepler.gl for Jupyter User Guide
IpyLeaflet
GeoPandas
However, recent advances and additions of Contextily for base maps and IPYMPL for interactive matplotlib plots makes it straightforward to create interactive maps with Geopandas.
unknown: Basic Interactive Geospatial Analysis in Python, 2016
* folium
very interesting: folium
Spatial Visualizations and Analysis in Python with Folium
a reference to HeatMapWithTime(), possibly interesting...
* ipympl (matplotlib)
* [Leaflet TimeDimension](https://github.com/socib/Leaflet.TimeDimension)
javascript-only, and only for GeoJson, but looks promising
Leaflet TimeDimension Examples Add time dimension capabilities on a Leaflet map
one of them looks good, (example 8), but still just javascript displaying geojson
class folium.plugins.TimestampedGeoJson
folium/plugins/timestamped_geo_json.py
SO question/answer: https://stackoverflow.com/questions/60044777/folium-plugins-timestampedgeojson-time-not-avaliable
another SO: TimestampedGeoJson does not plot entire image #1235
which is an i/f to the leaflet (javascript) Leaflet TimeDimension
installing folium:
$ pip3.7 install branca
$ pip3.7 install jinja2
$ pip3.7 install folium
Collecting folium
Downloading folium-0.11.0-py2.py3-none-any.whl (93 kB)
Installing collected packages: folium
Successfully installed folium-0.11.0
Some functionalities may require extra dependencies altair, etc. (???)
start jupyter:
cdmarc
cd folium
$ jupyter notebook --no-browser
1) starting from example here:
2) or better yet, this one: Scraping USA Snow Storm Data and visualizing them using Folium
$ mkdir Data_Script
$ mkdir unzipped
$ mkdir shapes
run parts 1,2,3
cd shapes
#!/bin/bash -x
for F in ../Data_Script/snow*.tar.gz ; do
tar zxvf $F
done
NOPE: missing filtered_data.csv file!!!
3) or this example:
TimestampedGeoJson does not plot entire image
worked, and was able to reproduce the incorrect diagram :-(
4) this one:
TimestampedGeoJson duration parameter causes polygons to disappear