Skip to content

Add WGS84 coordinates and simplified geometries to admin units - #13

Merged
namedgraph merged 2 commits into
masterfrom
admin-unit-coordinates-geometry
Jul 25, 2026
Merged

Add WGS84 coordinates and simplified geometries to admin units#13
namedgraph merged 2 commits into
masterfrom
admin-unit-coordinates-geometry

Conversation

@namedgraph

Copy link
Copy Markdown
Member

What

Admin units now carry WGS84 geographic data so LinkedDataHub renders them in map mode (ac:MapMode).

New ltlod-geo tool (etl/tools) reprojects the AR spatial (erdviniai duomenys) models from LKS-94/EPSG:3346 to WGS84 and emits, into a merged-on-load *-geo.trig per level:

  • geo:lat/geo:long representative point — all four levels (counties, municipalities, elderships, settlements). WGS84 Basic Geo; the map-marker path.
  • gs:asWKT simplified boundary — coarse levels only (counties/municipalities/elderships). GeoSPARQL wktLiteral, bare lon-lat, Douglas–Peucker simplified (~50 m).

Why simplified / coarse-only

LDH does no client-side simplification and the raw source polygons total ~160 MB. Simplifying (~95–99 % fewer vertices, visually identical at map zoom) keeps the committed coarse geometry ~2.5 MB and the browser map fast. Settlements stay point-only (20,880 detailed polygons are too heavy); settlements-geo.trig remains gitignored bulk.

Map wiring

  • :SubUnits (app/ns.ttl) and a new frontpage counties map (app/root.ttl) use ac:MapMode — no XSL change needed (map.xsl ships via the stock client.xsl).
  • files/overrides.xsl drops the bulky WKT literal from the property-list rendering; the map reads it straight from the RDF/XML DESCRIBE, so the polygon still draws.

Modeling notes

  • gs:asWKT sits directly on #this so the OpenLayers feature id is the unit URI (clickable → the unit's info-window).
  • WKT is bare WGS84 lon-lat (a leading CRS-URI token breaks OpenLayers' ol.format.WKT).
  • EPSG:3346 axis order is (Northing, Easting) — handled in the reprojection and bounds-checked against Lithuania's bbox (a swapped axis aborts the run).

Verification

  • Vilnius/Kaunas/Klaipėda land correctly; all points inside the LT bbox.
  • riot --validate, base-independent round-trip, SHACL conforms with the new geo/geometry shape.
  • make sef recompiles the client SEF cleanly with the WKT suppression.

Coverage (spatial registry ⊂ attribute registry): counties 10/10, municipalities 60/60, elderships 536/584, settlements 20,880/26,229.

Deploy

Not run here: make load (loads the new *-geo.trig) + make install (pushes the MapMode views) + recreate the linkeddatahub container (reload the rebuilt SEF).

🤖 Generated with Claude Code

namedgraph and others added 2 commits July 25, 2026 11:45
New `ltlod-geo` tool (etl/tools) reprojects the AR spatial models
(gra{apskritis,savivaldybe,seniunija,gyvenamojivietove}, LKS-94/EPSG:3346)
to WGS84 and emits, per admin unit, into a merged-on-load *-geo.trig:

- geo:lat/geo:long representative point (all four levels) — WGS84 Basic Geo,
  what LinkedDataHub's map-marker path keys on.
- gs:asWKT simplified boundary (coarse levels: counties/municipalities/
  elderships) — GeoSPARQL wktLiteral, bare WGS84 lon-lat, Douglas-Peucker
  simplified (~50 m) since LDH does no client-side simplification and the raw
  polygons are ~160 MB. Placed directly on #this so the map feature id is the
  unit URI. Settlements stay point-only (20k detailed polygons too heavy).

Map wiring: :SubUnits (app/ns.ttl) and a new frontpage counties map
(app/root.ttl) use ac:MapMode. files/overrides.xsl drops the bulky WKT literal
from the property-list rendering (kept in the data so the map still draws it).

Also: optional geo:lat/long + gsp:asWKT in the admin-units SHACL shape;
ONTOLOGY-NOTES.md and CLAUDE.md document the vocabulary choice, the EPSG:3346
(Northing, Easting) axis-order gotcha, and the on-#this modeling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The admin-unit *-geo.trig files are overlays (geo:lat/geo:long/gs:asWKT onto
the entity docs' graphs, merged on load), like alignments.trig — they carry no
per-graph dct:title/foaf:primaryTopic, so the strict validate.sh graph-invariant
check rejects them. Route them through shacl.sh only, same as alignments/photos.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@namedgraph
namedgraph merged commit 1b36590 into master Jul 25, 2026
3 checks passed
@namedgraph
namedgraph deleted the admin-unit-coordinates-geometry branch July 25, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant