Skip to content

Add DMS and UTM initializers for Coordinate3D (#53)#93

Open
trasch wants to merge 1 commit into
mainfrom
53_dms_utm
Open

Add DMS and UTM initializers for Coordinate3D (#53)#93
trasch wants to merge 1 commit into
mainfrom
53_dms_utm

Conversation

@trasch
Copy link
Copy Markdown
Contributor

@trasch trasch commented May 8, 2026

Summary

Added coordinate format initializers for DMS (Degrees, Minutes, Seconds) and UTM (Universal Transverse Mercator).

Coordinate3D(dms:)

  • Parses strings like "40°26'46\" N 79°58'56\" W"
  • Supports space-separated format "40 26 46 N 79 58 56 W"
  • Handles primes, double primes, degree symbols

Coordinate3D(latitudeDegrees:latitudeMinutes:...)

  • Explicit DMS component initializer

Coordinate3D(easting:northing:zone:hemisphere:)

  • UTM to WGS84 conversion using standard WGS84 ellipsoid parameters
  • Handles northern and southern hemispheres
  • Validates UTM zone range (1-60)

Tests (8 tests)

Test Coverage
dmsString Standard DMS format
dmsStringSpaceSeparated Space-only format
dmsStringEast Eastern longitude
dmsStringSouthWest Southern hemisphere
dmsComponents Explicit component init
utmNorthern UTM zone 18N
utmSouthern UTM zone 56S
utmInvalidZone Out of range zone → nil

Test results

274 tests pass across 60 suites (+8 new).


Closes #53

Coordinate3D(dms:) parses DMS strings like '40°26\'46" N 79°58\'56" W'.
Coordinate3D(easting:northing:zone:hemisphere:) converts from UTM.
Also adds explicit DMS component initializer.
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.

Add Coordinate3D initializers for other coordinate formats than decimal

1 participant