Docs add lonboard quickstart#316
Open
aboydnw wants to merge 4 commits into
Open
Conversation
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>
kylebarron
reviewed
Jun 4, 2026
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" |
There was a problem hiding this comment.
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>
kylebarron
approved these changes
Jun 9, 2026
kylebarron
left a comment
There was a problem hiding this comment.
I didn't run this but changes look good to me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to this tutorial: microsoft/PlanetaryComputerDataCatalog#529