Lonboard is a Python library for interactive geospatial visualization in Jupyter. It renders large vector datasets on a GPU-accelerated WebGL map directly in the notebook, with no tile server in the loop. Geometries stream to the browser as Apache Arrow, so hundreds of thousands of features stay interactive. Layers compose: stack footprints, points, and analysis results in a single map.
A companion notebook walks through every step end-to-end with live maps. Open in Planetary Computer Hub
uv add lonboard pystac-client planetary-computer geopandas deltalake adlfs mercantilepystac-client queries the Planetary Computer STAC API; planetary-computer signs asset URLs; deltalake opens the Delta Table partition for the dataset; geopandas + adlfs read the parquet files straight off Azure Blob; mercantile converts a longitude/latitude to a quadkey for the search query.
Set up the catalog client with PC's signer so every search result has a signed asset href:
import pystac_client
import planetary_computer
catalog = pystac_client.Client.open(
"https://planetarycomputer.microsoft.com/api/stac/v1",
modifier=planetary_computer.sign_inplace,
)modifier=planetary_computer.sign_inplace signs every asset as the search returns.
We'll render Microsoft Building Footprints, a dataset partitioned by quadkey. Use mercantile to convert a Portland coordinate to a zoom-9 quadkey, then fetch the STAC item whose partition covers it:
import mercantile
tile = mercantile.tile(-122.66, 45.52, 9)
quadkey = mercantile.quadkey(*tile)
item = next(catalog.search(
collections=["ms-buildings"],
query={
"msbuildings:region": {"eq": "UnitedStates"},
"msbuildings:quadkey": {"eq": quadkey},
},
).items())
asset = item.assets["data"]The asset is a Delta Table partition on Azure Blob. Open it with deltalake, enumerate the parquet files in the partition, then read each one with geopandas. Clip to the Portland metro for a focused view:
import geopandas as gpd
import pandas as pd
from deltalake import DeltaTable
storage_options = {
"account_name": asset.extra_fields["table:storage_options"]["account_name"],
"sas_token": asset.extra_fields["table:storage_options"]["credential"],
}
table = DeltaTable(asset.href, storage_options=storage_options)
gdf = pd.concat([
gpd.read_parquet(uri, storage_options=storage_options)
for uri in table.file_uris()
])
gdf = gdf.cx[-122.85:-122.45, 45.42:45.62]
len(gdf) # a few hundred thousand buildingsPolygonLayer.from_geopandas() uploads the geometry to the GPU as Arrow. Drawing the footprints as outlines keeps every building legible at city scale, and the map stays fully interactive with no tile server in the loop:
from lonboard import Map, PolygonLayer
layer = PolygonLayer.from_geopandas(
gdf,
get_line_color=[230, 100, 0],
filled=False,
line_width_min_pixels=0.5,
)
Map(layer, view_state={"longitude": -122.66, "latitude": 45.52, "zoom": 12}):height: 500
:name: Lonboard building footprints over Portland
:class: no-scaled-link
Each footprint carries a meanHeight. Map it through a continuous colormap and recolor the layer in place: data-driven styling across the whole dataset, evaluated on the GPU:
import matplotlib as mpl
from lonboard.colormap import apply_continuous_cmap
heights = gdf["meanHeight"].clip(0, 30)
normalized = (heights - heights.min()) / (heights.max() - heights.min())
layer.get_line_color = apply_continuous_cmap(
normalized.to_numpy(), mpl.colormaps["plasma"]
)
layer.line_width_min_pixels = 1.5plasma shades low buildings purple and tall ones yellow. Reassigning the property mutates the existing map without re-uploading geometry.
:height: 420
:name: Lonboard building footprints colored by height
:class: no-scaled-link
Lonboard's surface is the notebook. For pixel-level raster analysis in Python (window reads, overview traversal), use async-geotiff. For a standalone web app instead of a notebook, the deck.gl-raster renderer is available in TypeScript. For shareable tile endpoints consumed by third-party frontends, see titiler.