clone

an offline map explorer where each world, from a game map to a city's open data, ships as one .atlas file

feat/atlas-next-horizon
atlas / docs / us-area-demo.md
us-area-demo.md 10.0K rendered
1# Arbitrary Earth area + U.S. source-pack review gate23This gate proves that `Sample Region` is a parameter, not a fixture. A creator4draws any bounded Web Mercator area on Earth. The geographic selection is not5coupled to source coverage. For the full-data acceptance demo, the creator6chooses an area inside the built-in USGS/TIGER pack's stated U.S. coverage and7receives one native `.atlas` that renders its raster and semantic features with8the network disabled. A selection outside that coverage is still a valid9project; sources may truthfully return empty results.1011## Default source profile1213| Role | Nationwide source | Selection | Semantic output |14|---|---|---|---|15| Basemap | [USGS Topo MapServer](https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer) | one aligned Web Mercator `/export` image, bounded to 4096×4096 | locally derived raster pyramid |16| Roads | [Census TIGERweb Transportation](https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/Transportation/MapServer) | layers 2, 6, and 8; area envelope; all intersecting features | one `roads` path FeatureSet |17| Water | [Census TIGERweb Hydro](https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/Hydro/MapServer) | layers 0 and 1; area envelope; all intersecting features | `waterways` path and `water-bodies` area FeatureSets |18| Context | [Census TIGERweb State/County](https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/State_County/MapServer/1) | current Counties layer 1; area envelope | `jurisdictions` area FeatureSet |1920USGS describes Topo as a 256-pixel, EPSG:3857 cache made from current National21Map and other public-domain data. Its service metadata carries the complete22contributor credit. The National Map states that its services and downloads23are public domain and requests the acknowledgment: “Map services and data24available from U.S. Geological Survey, National Geospatial Program.”2526TIGERweb describes the selected road, hydrography, and county layers as27January 1, 2025 vintage, EPSG:3857 feature layers. Their service metadata names28the U.S. Census Bureau as source, advertises GeoJSON, and reports pagination29support. The generated project records the service URL, layer, public-domain30status, and Census source credit in its legal/evidence receipt. It must not31imply Census endorsement.3233Authoritative protocol references:3435- [ArcGIS export map](https://developers.arcgis.com/rest/services-reference/enterprise/export-map/)36 defines the projected bounding box and exact output image dimensions.37- [ArcGIS layer query](https://developers.arcgis.com/rest/services-reference/enterprise/query-map-service-layer/)38 defines geometry envelopes, spatial references, ordering, object-ID39 selection, and pagination.40- [The National Map terms](https://www.usgs.gov/faqs/what-are-terms-uselicensing-map-services-and-data-national-map)41 state the public-domain status and requested acknowledgment.42- [Census citation guidance](https://www.census.gov/about/policies/citation.html)43 is the source-credit policy; the Atlas receipt preserves the exact service44 copyright text in addition to the authored attribution.45- [TIGER/Line technical documentation](https://www2.census.gov/geo/pdfs/maps-data/data/tiger/tgrshp2024/TGRSHP2024_TechDoc.pdf)46 states the federal-work copyright rule, requests Census source credit, and47 supplies the positional-accuracy and non-jurisdictional-boundary disclaimers48 that the compiled source record must retain.4950## Spatial contract5152The picker retains the creator's WGS84 rectangle as intent. Compilation maps53it to one aligned Web Mercator tile block:5455```text56creator rectangle (EPSG:4326)57 │ project58 ▼59covered global tiles at source zoom Z60 │ grow to smallest aligned power-of-two square61 ▼62origin tile [column, row] + N × N tiles63 │ request one exact N·256 square and derive local levels64 ▼65local pixel plane [0,0,N·256,N·256]66```6768This keeps local pyramid derivation deterministic, makes the captured source69image independently verifiable, and makes the EPSG:3857-to-local feature70transform exactly affine.71For radius `R`, source zoom `Z`, world pixel width `W = 256 * 2^Z`, and tile72origin `(ox, oy)`, the transform from EPSG:3857 metres is:7374```text75s = W / (2πR)76x' = s*x + πR*s - 256*ox77y' = -s*y + πR*s - 256*oy78```7980The native coordinate contract therefore needs distinct tile-column and81tile-row origins. The existing singular `firstTile` cannot locate an arbitrary82Earth window and must not be reused for both axes. The generated profile asks83the export service for PNG; the native raster index still carries a codec per84tile so other profiles may use mixed PNG/JPEG caches.8586Feature queries use the same projected envelope and request EPSG:3857 output.87The adapter verifies the returned CRS before applying the affine transform.88Intersecting roads and polygons can extend outside the requested envelope, so89the transform lane must deterministically clip paths and areas to the aligned90window before extent validation and partitioning.9192## Capture-set contract9394Each ArcGIS feature source is one atomic acquisition, not one response:95961. Query the projected envelope with explicit `inSR=3857`, `outSR=3857`,97 `orderByFields=OBJECTID ASC`, page size, and offset.982. Follow `exceededTransferLimit` with the next exact offset. Require object99 IDs to remain strictly increasing and refuse an empty promised page,100 duplicate ID, out-of-order ID, or false termination.1013. Roads use `OID` as stable feature identity and the declared102 `coalesce(NAME, OID)` title mapping; `OBJECTID` is capture pagination state,103 not semantic identity. The fallback preserves unnamed features instead of104 silently changing “all roads” into “named roads.”1054. Commit the capture-set receipt only after every page and its termination106 proof validates. A partial acquisition never becomes selectable.1075. Replay the recorded pages in receipt order. Offline and exact replay make no108 network request and compile byte-identically from the selected bodies.109110The request shapes are generated rather than copied into the manifest:111112```text113GET {layer}/query?f=geojson&returnGeometry=true&outFields=*114 &geometry={minX,minY,maxX,maxY}&geometryType=esriGeometryEnvelope115 &inSR=3857&outSR=3857&spatialRel=esriSpatialRelIntersects116 &where=1%3D1&orderByFields=OBJECTID%20ASC117 &resultOffset={offset}&resultRecordCount={page size}118```119120The source-neutral contracts use only data meaning:121122| FeatureSet | Geometry | Stable identity | Typed properties |123|---|---|---|---|124| `roads` | path | `OID` | `name?: string`, `class: string` (`MTFCC`), `route-type?: string` (`RTTYP`) |125| `waterways` | path | `OID` | `name?: string`, `class: string` (`MTFCC`) |126| `water-bodies` | area | `OID` | `name?: string`, `class: string`, `land-area?: int64`, `water-area?: int64` |127| `jurisdictions` | area | `GEOID` | `name: string`, `land-area: int64`, `water-area: int64` |128129Title fallback is a small declarative mapping expression, not adapter-owned130semantics or an arbitrary script.131132Raster acquisition records the exact export request, media type, byte length,133hash, capture time, licence, and attribution. Local pyramid tiles are derived134only after that source image is captured as one complete selectable set.135136## Workbench path137138```text139Choose area ──► Sources ──► Contracts ──► Build ──► Compiled preview140 drag box defaults mappings live styles + legend141 or bbox + budget + clipping stages on .atlas truth142 │143 Inspect / Open / Drag144```145146The first map is only a source-area selector. After the first compile, every147transform, feature, raster, layer, style, and legend preview is read from the148validated `.atlas`; the browser keeps no parallel presentation model.149150The generated single manifest uses neutral labels (`sample-region`, `Sample151Region`) and contains the chosen WGS84 intent, resolved local tile-window152contract, explicit sources, mappings, legal text, presentation, and budgets.153The default presentation is:1541551. USGS Topo raster;1562. pale blue water areas and blue waterway paths;1573. quiet county outlines;1584. local roads, secondary roads, then primary roads with increasing weight;1595. labels at source-appropriate minimum zooms and a generated legend.160161Area size is governed by evidence, tile, feature, and output budgets rather162than a hard-coded named place. The UI estimates the aligned tile block before163capture and offers detail profiles: local roads for bounded local areas,164primary/secondary roads for regional areas. It refuses an over-budget plan; it165never silently drops pages or tiles.166167## Acceptance evidence168169The release gate uses a creator-selected area and fresh temporary library:170171- CUA draws the area, keeps the nationwide defaults, inspects the generated172 neutral manifest, builds, and verifies compiled raster/road/water/context173 semantics plus legal receipts.174- The live feature request uses a deliberately small page size so the receipt175 proves at least two pages and explicit termination.176- The artifact opens through native intake and by drag/drop, then renders with177 the network disabled.178- An offline build into another clean library and an exact-replay build produce179 the same bytes as the online selection while an HTTP counter remains zero.180- Reader telemetry proves bootstrap/page zero, visible feature partitions, and181 visible raster shards were range-read; total bytes stay below the full Atlas182 size and no whole `Volume` is materialized.183- Adversarial fixtures cover repeated/out-of-order IDs, missing continuations,184 false termination, crossing geometry, mixed raster codecs, corrupt shard185 ranges, and a cancelled partial capture.186- Packaged macOS, Windows, and Linux acceptance repeats open, association,187 drag/drop where the desktop supports it, and offline first render.188189Live government services are an opt-in review smoke, not a hermetic CI190dependency. CI uses byte-pinned protocol fixtures that reproduce the same191multi-page, clipping, mixed-codec, and termination contracts.