2.2 KiB
2.2 KiB
ADDED Requirements
Requirement: Earth constant
The system SHALL export a pre-built EARTH PlanetConfig using the WGS84 ellipsoid, Moon as a SatelliteConfig, and ISA atmosphere as AtmosphereConfig.
Scenario: Earth constant validation
- WHEN
EARTHis imported - THEN
EARTH.nameequals"Earth" - AND
EARTH.radiusequals6378137 - AND
EARTH.satellitescontains exactly one entry withnamematching"Moon"
Requirement: Earth surface instance
The system SHALL export a pre-built earthSurface PlanetSurface constructed from EARTH.
Scenario: Earth surface delegation
- WHEN
earthSurface.distance(a, b)is called for two coordinates - THEN the result equals the WGS84 geodesic distance
Requirement: Geocoding provider interface
The system SHALL export GeocodingProvider, GeocodingResult, createInMemoryProvider, and batchGeocode.
Scenario: In-memory geocode
- WHEN
createInMemoryProvider([{ name: "London", latitude: 51.5074, longitude: -0.1278 }])is created - AND
batchGeocodeis called with["London"] - THEN the result contains one entry with matching coordinates
Requirement: Geohash encoding and decoding
The system SHALL export encodeGeohash and decodeGeohash with round-trip fidelity.
Scenario: Geohash round-trip
- WHEN
encodeGeohash({ latitude: 51.5074, longitude: -0.1278 }, 9)is called - AND the result is passed to
decodeGeohash - THEN the decoded coordinate matches the original within
0.0001degrees
Requirement: Coordinate parsing and formatting
The system SHALL export parseCoordinate and formatCoordinate supporting DMS (degrees-minutes-seconds) and decimal formats.
Scenario: Parse DMS string
- WHEN
parseCoordinate("51°30'26.5\"N")is called - THEN the result is approximately
51.5074
Requirement: Preserve existing geo public API
The system SHALL preserve all public exports that existed in the legacy @suaveplan/geo package.
Scenario: Legacy export compatibility
- WHEN all public exports of the legacy
@suaveplan/geoare compared to@suaveplan/geo-earth - THEN every legacy export name exists in
geo-earthwith the same or broader type signature