Skip to content

Research history: map options #1

@ejwillemse

Description

@ejwillemse

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:

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:

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:

This thread shows many options, including lasso select and moving potins:

Missing:

  • not being maintained

Source:

Note:

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:

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:

Other

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions