Geo without a map
MountayaGeo holds the rules the map and its elements draw by, as plain functions. It calls no network and draws nothing, so it runs in a test, a widget or a server.
A position is [longitude, latitude], as on the wire:
Every value is written for its reader, in the language and units you pass, never the device's.
The series every profile and table draws from, and its totals:
The terrain under a point is read off the Tile API's elevation tiles. Geo says which tiles to fetch and what their pixels mean:
Fetch the tiles with your client, then hand their pixels to terrainFromElevationTiles(_:source:tiles:) for the height, slope and aspect.
UnitPreferences carries the language and units every figure is written in: