-
Notifications
You must be signed in to change notification settings - Fork 0
Description
This came from https://github.com/WasteLabs/dev_veolia_streamlit_design/issues/12:
Map options
There are many options for drawing good maps in streamlit.
- keplergl via html and iframe rendering
- folium
- leafmap
- pydeck
All have directional flow, but bidirectional flow is more difficult.
Required features:
- interactive with zoom, pan and tooltips
- single point selection
- drawing shapes with multiple point selection
- moving single points around
- base map options
Here are some relevant discussions:
plotly (andfanilo/social-media-tutorials)
This is the required library: https://pypi.org/project/streamlit-plotly-events/
Specifically this one: https://github.com/andfanilo/social-media-tutorials/blob/master/20220914-crossfiltering/streamlit_app.py
Key features:
- interactive with zoom and pan
- drawing shapes with multiple point selection
- adding shapes
- multi-way communications, we think
Got it working, and it has a map function, so should be fine. Just have to figure out how to draw line in maps.
Some tutorials on plotly maps:
- https://python.plainenglish.io/exploring-open-route-service-api-820a0ccffecc, uses https://openrouteservice.org/plans/ and mapbox. This one looks the most promissing.
- https://www.visualnoise.io/interactive-maps-with-python-pandas-and-plotly/, no code though...
streamlit-template
A streamlit app template for geospatial applications based on streamlit-option-menu.
Key features from front page:
- interactive with zoom and pan
- drawing shapes with multiple point selection
- adding shapes
multi-way communications, we think
Looks like it does everything required. There will just to be some manual call-backs to calculate points within select areas, and then filtering accordingly, or changing shapes.
Looks like the best option.
Static maps.
streamlit-geospatial could also be relevant.
streamlit-folium
Streamlit-folium integrates two great open-source projects in the Python ecosystem: Streamlit and Folium!
Key features:
- interactive, single point selection, bidirectional flow
st_folium(): a bi-directional Component, taking a Folium/Branca object and plotting to the Streamlit app. Upon mount/interaction with the Streamlit app, st_folium() returns a Dict with selected information including the bounding box and items clicked on
Missing:
- area selection, but it looks like rectangle selection is possible (https://github.com/fgebhart/mapa-streamlit)
Source: https://github.com/randyzwitch/streamlit-folium
streamlit-bokeh-events
Can't get it to work...
A streamlit component for bi-directional communication with bokeh plots.
Its just a workaround till streamlit team releases support for bi-directional communication with plots.
Key features:
- interactive, single and multi point selection, bidirectional flow
- does have mapping options: https://automating-gis-processes.github.io/2017/lessons/L5/interactive-map-bokeh.html
This thread shows many options, including lasso select and moving potins:
Missing:
- not being maintained
Source:
- https://github.com/ash2shukla/streamlit-bokeh-events
- https://discuss.streamlit.io/t/component-for-bi-directional-communication-with-bokeh/4338/53
Note:
- this is present in panel and awesomepanels (https://panel.holoviz.org/FAQ.html)
streamlit-geospatial
A streamlit multipage app for geospatial applications. It can be deployed to Streamlit Cloud, Heroku, or MyBinder.
Stack:
- streamlit
Interactive:
- yes
Bidirectional coms:
- unknown, probably not.
https://github.com/giswqs/streamlit-geospatial
leafmap
A Python package for geospatial analysis and interactive mapping in a Jupyter environment.
Stack:
- jupyter
- python
- streamlit (https://github.com/giswqs/leafmap-streamlit)
Bidirectional coms:
- unknown for streamlit
https://github.com/giswqs/leafmap
streamlit-light-leaflet
A very quick & dirty prototype of Streamlit component that sends back coordinates on click, using the Reactless template. Feel free to fork and go on your Leaflet adventure!
Source:
- https://github.com/andfanilo/streamlit-light-leaflet
- https://discuss.streamlit.io/t/using-leaflet-instead-of-folium-in-streamlit-to-return-coordinates-on-map-click/4946
Other
- Scatterplot with selection
- andfanilo/streamlit-light-leaflet: A very quick & dirty prototype of Streamlit component that sends back coordinates on click, using the Reactless template. Feel free to fork and go on your Leaflet adventure!