From 07d7b996fb6a456d1a84d642b7274b1e4dea5aa7 Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Fri, 31 Oct 2025 08:49:56 -0700 Subject: [PATCH 1/2] Add *.parquet to .gitignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevent accidental commit of large parquet data files (e.g., 691MB oc_isamples_pqg.parquet). These files are too large for git and should be accessed via: - Remote URLs (HTTP range requests) - Local caching during development - External data storage (Zenodo, Google Storage, etc.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index e5915f9..03dbac3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ uv.lock plantuml-images docs +# Large data files +*.parquet + .$* # Byte-compiled / optimized / DLL files From f3e608064e30678d1dd9e3e3049d2d98c5bbdc75 Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Fri, 31 Oct 2025 09:01:31 -0700 Subject: [PATCH 2/2] Add geocode search box to Cesium map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Users can now paste a geocode PID (e.g., geoloc_04d6e816218b1a8798fa90b3d1d43bf4c043a57f) into a search box and the map will: - Query the database for that geocode's coordinates - Fly the camera to that location (2-second animation) - Automatically trigger all data queries for that location Implementation: - Added Inputs.text search box with submit functionality - Reactive cell watches searchGeoPid changes - Uses Cesium camera.flyTo() for smooth navigation - Sets clickedPointId after camera arrives to load data This enables direct navigation to known geocodes without manual map clicking. Test example PIDs: - geoloc_04d6e816218b1a8798fa90b3d1d43bf4c043a57f (PKAP, 5 samples) - geoloc_7a05216d388682536f3e2abd8bd2ee3fb286e461 (Larnaka, 0 samples) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- tutorials/parquet_cesium.qmd | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tutorials/parquet_cesium.qmd b/tutorials/parquet_cesium.qmd index 30dbb36..986145f 100644 --- a/tutorials/parquet_cesium.qmd +++ b/tutorials/parquet_cesium.qmd @@ -37,6 +37,16 @@ viewof parquet_path = Inputs.text({ }); ``` +```{ojs} +//| echo: false +viewof searchGeoPid = Inputs.text({ + label:"Jump to Geocode", + placeholder: "Paste geocode PID (e.g., geoloc_04d6e816218b1a8798fa90b3d1d43bf4c043a57f)", + width:"100%", + submit:true +}); +``` + ::: {.callout-tip collapse="true"} #### Using a local cached file for faster performance @@ -615,6 +625,44 @@ md`Retrieved ${pointdata.length} locations from ${parquet_path}.`; } ``` +```{ojs} +//| echo: false +// Handle geocode search: fly to location and trigger queries +{ + if (searchGeoPid && searchGeoPid.trim() !== "") { + const pid = searchGeoPid.trim(); + + // Look up the geocode in the database + const q = `SELECT pid, latitude, longitude FROM nodes WHERE otype='GeospatialCoordLocation' AND pid=?`; + const result = await db.query(q, [pid]); + + if (result && result.length > 0) { + const geo = result[0]; + const viewer = content.viewer; + + // Fly camera to the location + const position = Cesium.Cartesian3.fromDegrees( + geo.longitude, + geo.latitude, + 15000 // 15km altitude for good view + ); + + viewer.camera.flyTo({ + destination: position, + duration: 2.0, // 2 second flight + complete: () => { + // After camera arrives, trigger the click to load data + mutable clickedPointId = pid; + } + }); + } else { + // Geocode not found - could display error to user + console.warn(`Geocode not found: ${pid}`); + } + } +} +``` + ::: {.panel-tabset} ## Map