Files
Qiusheng Wu ef1c4a6317 feat(notebook): add a raster and vector example notebook (#3286)
* feat(notebook): add a raster and vector example notebook

Add Explore_GeoLibre.ipynb beside Welcome.ipynb. It covers raster
visualization and terrain analysis, vector styling and GeoPandas
analysis, and, on desktop, layer management and processing tools.

The kernel client had no way to add rasters, so add add_tile_layer,
add_cog, add_raster and run_whitebox_tool, with the matching scripting
commands. Seed the new notebook in both the web and desktop builds.

* fix(notebook): address review comments on the raster commands

Accept only known tile options, since the store spreads them over the
validated URL. Keep the COG engine and insertion options, and report
invalid base64 by command name.

In the example notebook, wait only for layers added by the current
command, and clean up by what Part 3 added, so a rerun cannot pick up an
old result and a user's own layers are safe.

* fix(notebook): point layer warnings at the caller's cell

Warnings from add_geojson and the raster methods pointed inside the
client after they moved to _add_layer. Also reject non-bytes input to
add_raster up front.

* Address CodeRabbit review feedback

- Pass add_raster's colormap as layer state, so a paletted GeoTIFF on the
  ArcGIS or Cesium renderer honors it, as the COG command does.
- Keep beforeLayerId and metadata in the tile options; the app API
  validates metadata.
- Mark the Whitebox docs example as desktop-only, since add_raster
  returns None on the web.

* Address review feedback

- Gate Part 3 of the notebook on every layer id it uses, since a relay
  timeout can leave any of them None, and reword the skip message.
- Raise a clear error when rescale is not a (min, max) pair.
- Forward zoomTo and beforeLayerId in addRasterBytes.
- Scope the docs note on layer ids to desktop JupyterLab kernels and
  guard the Whitebox example.
2026-10-30 11:18:31 -04:00

91 lines
3.1 KiB
Plaintext

node_modules/
dist/
dist-embed/
apps/geolibre-mcp-app/build/
# Written by `npm run bundle:report` after a build.
bundle-report/
# Generated by `npm run build:jupyterlite` (best-effort prebuild); not committed.
apps/geolibre-desktop/public/jupyterlite/
# JupyterLite (doit) build cache, written to the working dir during the build.
.jupyterlite.doit.db
# The kernel-side geolibre client and the example notebooks are staged here from
# their canonical backend copies by scripts/build-jupyterlite.mjs.
apps/geolibre-desktop/jupyterlite/files/geolibre.py
apps/geolibre-desktop/jupyterlite/files/*.ipynb
site/
target/
.tauri/
*.log
.DS_Store
.env
.env.local
__pycache__/
*.pyc
.ruff_cache/
# Generated by the copy-vector-ops Vite plugin from the backend source of truth
# (backend/geolibre_server/geolibre_server/vector_ops.py).
apps/geolibre-desktop/src/lib/pyodide/vector_ops.generated.py
# Generated by the copy-cesium-assets Vite plugin from node_modules/cesium.
apps/geolibre-desktop/public/cesium/
.venv/
*.egg-info/
.pytest_cache/
# Coverage artifacts (pytest-cov data file, HTML/XML reports, c8 output)
.coverage
.coverage.*
coverage/
htmlcov/
coverage.xml
.idea/
.vscode/
*.tsbuildinfo
**/src-tauri/gen/
.playwright-cli/
.claude/
uv.lock
# ...except the sidecar's. That project is BUNDLED into the desktop installers
# and `uv run` against it at app startup, from a resource directory the user
# cannot write (C:\Program Files\..., /usr/lib/GeoLibre Desktop/...). Without a
# committed lock, a CI-built release ships lockless, so uv has to resolve and
# then WRITE uv.lock there on first launch — which fails with "Permission
# denied" and exits 2, surfacing as "Jupyter server exited before it was ready
# (exit code: 2)". Committing it also stops released builds from re-resolving
# against live PyPI on every user's machine. The launcher passes `--frozen`
# (src-tauri/src/lib.rs) so it is read, never rewritten.
!backend/geolibre_server/uv.lock
# Playwright E2E artifacts
test-results/
playwright-report/
blob-report/
.playwright/
private/
# Documentation screenshots are hosted on Cloudflare R2 (data.geolibre.app/images),
# not committed to the repo, to save space.
docs/assets/screenshots/
python/examples/my-map.geolibre.json
# Cloudflare Workers local dev state (wrangler dev / miniflare)
.wrangler/
# Rendered Homebrew cask, emitted to the working dir by scripts/render-*-cask.sh
# for submission to a tap / homebrew-cask; not committed to this repo.
/geolibre.rb
# Rendered Mac App Store signing inputs (generated by
# scripts/render-mas-entitlements.sh and the mas-store workflow; the committed
# source of truth is Entitlements.mas.plist.template)
apps/geolibre-desktop/src-tauri/mas/Entitlements.mas.plist
apps/geolibre-desktop/src-tauri/mas/embedded.provisionprofile
# Local SQLite state for the reference projects/identity server. GEOLIBRE_DATABASE_URL
# defaults to sqlite:///./geolibre-server-api.db, so running it from the repo root
# (the obvious place) drops the file here.
/geolibre-server-api.db
# Local Android Gradle cache for the vendored Tauri geolocation plugin.
apps/geolibre-desktop/src-tauri/vendor/tauri-plugin-geolocation/android/.gradle/