Spaces:
Runtime error
Runtime error
solara pages must be stand-alone?
Browse files- pages/00_leafmap.py +18 -1
pages/00_leafmap.py
CHANGED
|
@@ -1,8 +1,25 @@
|
|
| 1 |
import leafmap
|
| 2 |
import solara
|
|
|
|
| 3 |
|
| 4 |
# external script defines polygons, etc
|
| 5 |
-
from fire import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
zoom = solara.reactive(14)
|
| 8 |
center = solara.reactive((34, -116))
|
|
|
|
| 1 |
import leafmap
|
| 2 |
import solara
|
| 3 |
+
import geopandas as gpd
|
| 4 |
|
| 5 |
# external script defines polygons, etc
|
| 6 |
+
#from fire import *
|
| 7 |
+
|
| 8 |
+
nps = gpd.read_file("/vsicurl/https://huggingface.co/datasets/cboettig/biodiversity/resolve/main/data/NPS.gdb")
|
| 9 |
+
calfire = gpd.read_file("/vsicurl/https://huggingface.co/datasets/cboettig/biodiversity/resolve/main/data/fire22_1.gdb", layer = "firep22_1")
|
| 10 |
+
# fire = gpd.read_file("/vsizip/vsicurl/https://edcintl.cr.usgs.gov/downloads/sciweb1/shared/MTBS_Fire/data/composite_data/burned_area_extent_shapefile/mtbs_perimeter_data.zip"
|
| 11 |
+
|
| 12 |
+
# extract and reproject the Joshua Tree NP Polygon
|
| 13 |
+
jtree = nps[nps.PARKNAME == "Joshua Tree"].to_crs(calfire.crs)
|
| 14 |
+
|
| 15 |
+
# All Fires in the DB that intersect the Park
|
| 16 |
+
jtree_fires = jtree.overlay(calfire, how="intersection")
|
| 17 |
+
|
| 18 |
+
# Extract a polygon if interest. > 2015 for Sentinel, otherwise we can use LandSat
|
| 19 |
+
recent = jtree_fires[jtree_fires.YEAR_ > "2015"]
|
| 20 |
+
big = recent[recent.Shape_Area == recent.Shape_Area.max()].to_crs("EPSG:4326")
|
| 21 |
+
|
| 22 |
+
|
| 23 |
|
| 24 |
zoom = solara.reactive(14)
|
| 25 |
center = solara.reactive((34, -116))
|