Skip to content

Commit b641999

Browse files
rdhyeeclaude
andcommitted
Add Italy-centered camera view to Cesium map
- Set initial camera view to Italy bounding box (6.6-18.8°E, 36.6-47.1°N) - Configure Home button to reset to Italy instead of global view - Use postRender event listener to apply camera after first render - Prevents resize/tab visibility issues with early camera positioning This provides a more useful default view for the OpenContext dataset, which is heavily concentrated in Mediterranean archaeological sites. Also update .gitignore to exclude Quarto intermediate files (*.quarto_ipynb). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 318aa6d commit b641999

File tree

2 files changed

+154
-0
lines changed

2 files changed

+154
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,5 @@ dmypy.json
141141
.idea
142142

143143
/.quarto/
144+
145+
**/*.quarto_ipynb

tutorials/parquet_cesium.qmd

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,27 @@ selectedSamplesCombined = {
417417
md`Retrieved ${pointdata.length} locations from ${parquet_path}.`;
418418
```
419419

420+
```{ojs}
421+
//| echo: false
422+
// Center initial Cesium view on Italy and also set Home to Italy!
423+
{
424+
const viewer = content.viewer;
425+
// Approximate bounding box for Italy (degrees)
426+
const italyRect = Cesium.Rectangle.fromDegrees(6.6, 36.6, 18.8, 47.1);
427+
428+
// Make the Home button go to Italy as well
429+
Cesium.Camera.DEFAULT_VIEW_RECTANGLE = italyRect;
430+
Cesium.Camera.DEFAULT_VIEW_FACTOR = 0.5;
431+
432+
// Apply camera after the first render to avoid resize/tab visibility issues
433+
const once = () => {
434+
viewer.camera.setView({ destination: italyRect });
435+
viewer.scene.postRender.removeEventListener(once);
436+
};
437+
viewer.scene.postRender.addEventListener(once);
438+
}
439+
```
440+
420441
::: {.panel-tabset}
421442

422443
## Map
@@ -647,4 +668,135 @@ combinedLoading ? md`(loading…)` : md`\`\`\`
647668
${JSON.stringify(samples_combined, null, 2)}
648669
\`\`\`
649670
`
671+
```
672+
673+
## Design Note: Differentiated Geographic Visualization
674+
675+
::: {.callout-note icon=false}
676+
## Future Enhancement - Geographic Location Classification
677+
678+
**Current implementation**: All 198,433 GeospatialCoordLocations are rendered identically (orange points), without differentiating their semantic roles in the graph.
679+
680+
**Discovery**: Analysis of the OpenContext parquet data reveals that geos fall into three distinct categories based on their usage:
681+
682+
1. **`sample_location_only`**: Precise field collection points (Path 1)
683+
- Most common category
684+
- Represents exact GPS coordinates where sampling events occurred
685+
- Varies per event, even within the same site
686+
687+
2. **`site_location_only`**: Administrative site markers (Path 2)
688+
- Represents general/reference locations for named archaeological sites
689+
- One coordinate per site
690+
- May not correspond to any actual collection point
691+
692+
3. **`both`**: 10,346 geos (5.2%) - Dual-purpose locations
693+
- Used as BOTH `sample_location` AND `site_location`
694+
- Primarily single-location sites (85% of all sites)
695+
- Occasionally one of many locations at multi-location sites (e.g., PKAP)
696+
697+
**Site spatial patterns**:
698+
- **85.4%** of sites are compact (single location) - all events at one coordinate
699+
- Example: Suberde - 384 events at one location
700+
- **14.6%** of sites are distributed (multiple locations) - events spread across space
701+
- Example: PKAP Survey Area - 15,446 events across 544 different coordinates
702+
- Poggio Civitate - 29,985 events across 11,112 coordinates
703+
704+
### Proposed Enhancement
705+
706+
**Visual differentiation by semantic role**:
707+
708+
```javascript
709+
// Color coding
710+
const styles = {
711+
sample_location_only: { color: '#2E86AB', size: 3 }, // Blue - field collection points
712+
site_location_only: { color: '#A23B72', size: 6 }, // Purple - administrative markers
713+
both: { color: '#F18F01', size: 5 } // Orange - dual-purpose
714+
};
715+
```
716+
717+
**UI Controls**:
718+
```
719+
☑ Show sample locations (precise field data - Path 1)
720+
☑ Show site locations (administrative site markers - Path 2)
721+
☐ Highlight overlap points only (10,346 dual-purpose geos)
722+
```
723+
724+
**Query modification needed**:
725+
726+
```sql
727+
-- Add classification to geo query
728+
WITH geo_classification AS (
729+
SELECT
730+
geo.pid,
731+
geo.latitude,
732+
geo.longitude,
733+
MAX(CASE WHEN e.p = 'sample_location' THEN 1 ELSE 0 END) as is_sample_location,
734+
MAX(CASE WHEN e.p = 'site_location' THEN 1 ELSE 0 END) as is_site_location
735+
FROM pqg geo
736+
JOIN pqg e ON (geo.row_id = list_extract(e.o, 1))
737+
WHERE geo.otype = 'GeospatialCoordLocation'
738+
GROUP BY geo.pid, geo.latitude, geo.longitude
739+
)
740+
SELECT
741+
pid,
742+
latitude,
743+
longitude,
744+
CASE
745+
WHEN is_sample_location = 1 AND is_site_location = 1 THEN 'both'
746+
WHEN is_sample_location = 1 THEN 'sample_location_only'
747+
WHEN is_site_location = 1 THEN 'site_location_only'
748+
END as location_type
749+
FROM geo_classification
750+
```
751+
752+
### Benefits
753+
754+
1. **Educational**: Makes Path 1 vs Path 2 distinction visually concrete
755+
- Users can SEE the semantic difference between precise and administrative locations
756+
- Demonstrates the complementary nature of the two geographic paths
757+
758+
2. **Exploratory**: Enables focused spatial queries
759+
- "Show me archaeological sites in Turkey" → filter to `site_location_only`
760+
- "Where were samples actually collected?" → filter to `sample_location_only`
761+
- "Which locations serve dual purposes?" → show `both` category
762+
763+
3. **Analytical**: Reveals site spatial structure
764+
- Compact sites: tight cluster of blue points around purple marker
765+
- Survey areas: purple marker with cloud of blue points spread across region
766+
- Identifies sampling strategies and field methodologies
767+
768+
### Advanced Features (Future)
769+
770+
**Site Explorer Mode**:
771+
- Click a `site_location` (purple marker) → reveal all its `sample_locations` (blue points)
772+
- Draw convex hull or region around the site's collection points
773+
- Display site statistics: event count, spatial extent, temporal range
774+
775+
**Example interaction**:
776+
```
777+
User clicks PKAP Survey Area marker (purple)
778+
→ Highlights 544 blue sample_location points within the survey area
779+
→ Shows: "15,446 events across 544 locations (0.7% at site marker, 99.3% elsewhere)"
780+
→ Draws polygon boundary around the survey extent
781+
```
782+
783+
### Implementation Status
784+
785+
**Status**: Design note only - not yet implemented
786+
787+
**Implementation complexity**: Moderate
788+
- Query modification: Simple (add classification CTE)
789+
- Client-side rendering: Medium (conditional styling in Cesium primitives)
790+
- UI controls: Medium (checkbox filters + event handlers)
791+
- Advanced features: High (site explorer mode with interactive highlighting)
792+
793+
**Performance impact**: Minimal
794+
- Same 198k points, just enriched with `location_type` metadata
795+
- Filtering happens client-side (fast)
796+
- Could add server-side aggregation for zoom-based LOD
797+
798+
This enhancement would transform the visualization from "pretty dots on a map" into a pedagogical tool for understanding the iSamples metadata model architecture.
799+
800+
:::
801+
```
650802
```

0 commit comments

Comments
 (0)