ColumnLayer Example¶
This is a quick example notebook to show how to use the ColumnLayer
.
This is derived from @cboettig
's example in this issue.
Dependencies¶
pip install lonboard geopandas pyarrow
Imports¶
In [ ]:
Copied!
import geopandas as gpd
from lonboard import Map, ColumnLayer
import geopandas as gpd
from lonboard import Map, ColumnLayer
In [ ]:
Copied!
DATA_URL = 'https://data.source.coop/cboettig/conservation-policy/Inflation_Reduction_Act_Projects.geojson'
DATA_URL = 'https://data.source.coop/cboettig/conservation-policy/Inflation_Reduction_Act_Projects.geojson'
In [ ]:
Copied!
df = gpd.read_file(DATA_URL, use_arrow=True)
df = gpd.read_file(DATA_URL, use_arrow=True)
In [ ]:
Copied!
layer = ColumnLayer.from_geopandas(
df,
get_elevation=df["FUNDING_NUMERIC"],
get_fill_color = [255, 255, 0, 140],
elevation_scale=.01,
radius=10000,
pickable=True,
auto_highlight=True,
)
layer = ColumnLayer.from_geopandas(
df,
get_elevation=df["FUNDING_NUMERIC"],
get_fill_color = [255, 255, 0, 140],
elevation_scale=.01,
radius=10000,
pickable=True,
auto_highlight=True,
)
In [ ]:
Copied!
m = Map(
layer,
view_state={"longitude": -100, "latitude": 35, "zoom": 4, "pitch": 45, "bearing": 0},
)
m
m = Map(
layer,
view_state={"longitude": -100, "latitude": 35, "zoom": 4, "pitch": 45, "bearing": 0},
)
m