You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/architecture.adoc
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ The pipeline follows a *medallion architecture* (Bronze → Silver → Gold) imp
49
49
50
50
| `download_osm.py`
51
51
| `pipeline/scripts/`
52
-
| Queries the Overpass API for POI nodes, ways, and relations within the configured bounding box. Caches raw JSON responses, computes centroids for multi-point geometries, and loads results into the `raw_osm_elements` table in DuckDB (Bronze layer).
52
+
| Queries the Overpass API for POI nodes, ways, and relations within the configured bounding box. Caches raw JSON responses, reconstructs Polygon and MultiPolygon geometries from relation member ways, computes centroids for multi-point geometries, and loads results into the `raw_osm_elements` table in DuckDB (Bronze layer).
53
53
54
54
| `bronze_osm_pois.sql`
55
55
| `pipeline/dbt/models/bronze/`
@@ -61,11 +61,11 @@ The pipeline follows a *medallion architecture* (Bronze → Silver → Gold) imp
61
61
62
62
| `enrich_wiki.py`
63
63
| `pipeline/scripts/`
64
-
| Reads QIDs and Wikipedia titles from the Silver layer, calls Wikidata and Wikipedia REST APIs, caches individual entity responses, and writes enrichment data to the `wiki_enrichment` table.
64
+
| Reads QIDs and Wikipedia titles from the Silver layer, calls Wikidata and Wikipedia REST APIs, caches individual entity responses, and writes enrichment data to the `wiki_enrichment` table. When the OSM `species:wikidata` tag contains multiple semicolon-separated QIDs, one enrichment record is produced per QID so that each species in a shared enclosure gets its own GeoJSON feature.
65
65
66
66
| `gold_animals.sql`
67
67
| `pipeline/dbt/models/gold/`
68
-
| dbt model that joins Silver POIs with enrichment data, coalesces display names and images, constructs Wikipedia URLs, and produces the final `gold_animals` table.
68
+
| dbt model that joins Silver POIs with enrichment data, coalesces display names and images, constructs Wikipedia URLs, and produces the final `gold_animals` table. Because `wiki_enrichment` may contain multiple records per OSM element (one per species), the join naturally expands to one output row per species, each sharing the same geometry. The `enclosure` column always carries the raw OSM `name` tag to remain stable across multi-species expansions.
69
69
70
70
| `export_geojson.py`
71
71
| `pipeline/scripts/`
@@ -88,7 +88,7 @@ The pipeline follows a *medallion architecture* (Bronze → Silver → Gold) imp
88
88
89
89
| `app.js`
90
90
| project root
91
-
| Fetches `data/animals.geojson` at startup, renders the Leaflet map with OSM tiles, populates the animal list, handles full-text search, and synchronises list selection with map highlights.
91
+
| Fetches `data/animals.geojson` at startup, renders the Leaflet map with OSM tiles, populates the animal list, handles full-text search (including enclosure name), and synchronises list selection with map highlights. Multiple features sharing the same geometry (multi-species enclosures) each receive their own list entry; MultiPolygon geometries are handled natively by Leaflet.
92
92
93
93
| `style.css`
94
94
| project root
@@ -120,7 +120,7 @@ Each element in the `features` array represents one animal enclosure.
120
120
121
121
*Geometry*
122
122
123
-
The `geometry` field is one of two GeoJSON geometry types:
123
+
The `geometry` field is one of three GeoJSON geometry types:
124
124
125
125
[cols="1,3", options="header"]
126
126
|===
@@ -130,7 +130,10 @@ The `geometry` field is one of two GeoJSON geometry types:
130
130
| Single coordinate `[longitude, latitude]`; used when the OSM source element is a node.
131
131
132
132
| `Polygon`
133
-
| Closed ring of coordinates; used when the OSM source element is a way or relation. The pipeline computes the centroid for display purposes but preserves the full polygon.
133
+
| Closed ring of coordinates; used when the OSM source element is a way or a relation with a single outer ring. The pipeline computes the centroid for display purposes but preserves the full polygon. Inner rings (holes) are included when present.
134
+
135
+
| `MultiPolygon`
136
+
| Multiple outer rings; used when an OSM relation contains more than one outer-role member way (e.g. a non-contiguous enclosure spread across two areas).
134
137
|===
135
138
136
139
*Properties*
@@ -152,7 +155,7 @@ The `geometry` field is one of two GeoJSON geometry types:
152
155
| `enclosure`
153
156
| string
154
157
| ✓
155
-
| Raw OSM `name` tag of the enclosure; may differ slightly from `name` when the pipeline normalizes the display value.
158
+
| Raw OSM `name` tag of the enclosure element. For multi-species enclosures this value is the same across all species features sharing that enclosure, while `name` holds the individual species common name.
0 commit comments