A Shiny for Python web app for interactive geospatial prioritization. Upload a GeoJSON file, adjust weights for any scoring fields, and instantly see a color-coded map of prioritized features. Download the result with the calculated score embedded.
- Dynamic weight sliders — automatically generated for any column ending in
_SCORE - Interactive map — dark-themed Leaflet map with tooltips showing prioritization scores
- Quantile-based classification — configurable 2–10 class breaks
- Multiple color ramps — Viridis, Plasma, Inferno, Magma, Cividis, YlOrRd, YlGnBu, RdYlGn, Blues, Reds, Cool-Warm
- Auto-fit viewport — map zooms to the bounding box of the loaded data
- Download result — export scored GeoJSON with the
Prioritizationfield included
- Python 3.9+
pip install shiny pandas matplotlib pytest# Standard
shiny run app.py
# With auto-reload during development
shiny run app.py --reloadThen open http://127.0.0.1:8000 in your browser.
- Upload a GeoJSON file.
- Adjust the weight sliders for each
_SCOREfield — weights are normalized to sum to 1 automatically. - Configure the map display using the controls bar at the bottom:
- Classes — number of quantile breaks (2–10)
- Color Ramp — matplotlib colormap to apply
- Explore the map — hover over features to see the
Prioritizationscore tooltip. - Download the scored GeoJSON via the orange button in the sidebar.
The app auto-detects prioritization inputs from your GeoJSON properties. Any column ending in _SCORE (case-insensitive) becomes a slider.
Example properties:
{
"ID": 1,
"Safety_SCORE": 4.2,
"Connectivity_SCORE": 3.1,
"Other_Field": "Some label"
}The output adds a Prioritization field — the normalized weighted sum of all _SCORE columns.
| Package | Purpose |
|---|---|
shiny |
Web framework |
pandas |
DataFrame operations |
matplotlib |
Colormap sampling |
pytest |
Testing |
Note:
shinywidgetsis not used. Pydeck 0.9 removed ipywidgets support; the map is rendered as a plain HTML iframe using Leaflet.
AGPL-3.0 license
