Latlon grid
In [ ]:
Copied!
# %pip install leafmap
# %pip install leafmap
In [ ]:
Copied!
import leafmap.maplibregl as leafmap
import leafmap.maplibregl as leafmap
In [ ]:
Copied!
extent = (-125, 24, -66, 50)
grid = leafmap.generate_latlon_grid(extent, dx=1, dy=1)
print(len(grid), "grid cells")
grid.head()
extent = (-125, 24, -66, 50)
grid = leafmap.generate_latlon_grid(extent, dx=1, dy=1)
print(len(grid), "grid cells")
grid.head()
In [ ]:
Copied!
m = leafmap.Map(center=[-100, 40], zoom=3, style="liberty")
m.add_gdf(
grid,
name="Grid",
layer_type="fill",
paint={
"fill-color": "rgba(0, 0, 0, 0)",
"fill-outline-color": "rgba(255, 0, 0, 255)",
},
fit_bounds=False,
)
m
m = leafmap.Map(center=[-100, 40], zoom=3, style="liberty")
m.add_gdf(
grid,
name="Grid",
layer_type="fill",
paint={
"fill-color": "rgba(0, 0, 0, 0)",
"fill-outline-color": "rgba(255, 0, 0, 255)",
},
fit_bounds=False,
)
m