Skip to content

Docs add lonboard quickstart - #316

Open
Anthony Boyd (aboydnw) wants to merge 4 commits into
microsoft:mainfrom
aboydnw:docs-add-lonboard-quickstart
Open

Docs add lonboard quickstart#316
Anthony Boyd (aboydnw) wants to merge 4 commits into
microsoft:mainfrom
aboydnw:docs-add-lonboard-quickstart

Conversation

@aboydnw

Copy link
Copy Markdown

Anthony Boyd (aboydnw)and others added 3 commits June 1, 2026 21:14
Companion notebook for the Lonboard tutorial in PlanetaryComputerDataCatalog.
Walks through interactive raster and vector visualization of Planetary
Computer data: STAC search, RasterLayer.from_stac, opacity and colormap
adjustments, raster + vector layer composition.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The notebook used lonboard.experimental.RasterLayer.from_stac, which does
not exist in any released lonboard. Rewrite around lonboard's shipping
strength — GPU vector rendering — using Microsoft Building Footprints:
read a STAC GeoParquet quadkey partition into a GeoDataFrame, render
hundreds of thousands of polygons with PolygonLayer, then color by
meanHeight via apply_continuous_cmap. No tile server; geometry streams
as Arrow.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t prose
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment threadquickstarts/lonboard.ipynb Outdated
Comment on lines +140 to +160
"def quadkey(lat, lon, zoom):\n",
" n = 2 ** zoom\n",
" x = int((lon + 180.0) / 360.0 * n)\n",
" y = int((1.0 - math.asinh(math.tan(math.radians(lat))) / math.pi) / 2.0 * n)\n",
" digits = []\n",
" for i in range(zoom, 0, -1):\n",
" bit = 1 << (i - 1)\n",
" digits.append(str((1 if x & bit else 0) + (2 if y & bit else 0)))\n",
" return \"\".join(digits)\n",
"\n",
"\n",
"qk = quadkey(45.52, -122.66, 9)\n",
"item = next(catalog.search(\n",
" collections=[\"ms-buildings\"],\n",
" query={\n",
" \"msbuildings:region\": {\"eq\": \"UnitedStates\"},\n",
" \"msbuildings:quadkey\": {\"eq\": int(qk)},\n",
" },\n",
").items())\n",
"asset = item.assets[\"data\"]\n",
"qk, item.id"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be updated in line with the suggestions on the tutorial

Mirror tutorial changes to address Kyle Barron's feedback:
- Replace the bespoke quadkey() helper with mercantile.tile +
mercantile.quadkey; pass the string quadkey to the STAC search
(preserves leading zeros).
- Swap dask_geopandas for the canonical deltalake + geopandas pattern
used by the existing ms-buildings example notebook, building
storage_options with sas_token from the asset's credential field.
- Update install list to match: drop dask-geopandas, add deltalake,
geopandas, mercantile; keep adlfs for Azure access.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@kylebarronKyle Barron (kylebarron) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't run this but changes look good to me

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@aboydnw@kylebarron