feat(coords): TWD97 (Taiwan) grid + Go to Coordinate entry#52
Open
jfuginay wants to merge 1 commit into
Open
Conversation
Add TWD97 / TM2 zone 121 (EPSG:3826) coordinate support so Taiwan users can read and enter local grid coordinates. - TWD97Converter: Transverse Mercator on GRS80 (lon0=121, k0=0.9999, FE=250000, FN=0). TWD97 is GRS80/ITRF-referenced (towgs84=0) so no datum shift is needed. Redfearn forward/inverse, verified to 0.004 m against the yychen/twd97 reference; central-meridian E=250000 exact. - Two digit-input modes: full7 (7+7 absolute, the Taiwan 二度分帶 standard) and grid5 (5+5 truncated local grid, MGRS-style; parsing recovers the 100 km cell from the current map centre). - New "Go to Coordinate" sheet (TWD97 / MGRS / Lat-Lon) with the 7+7 vs 5+5 toggle, live lat/lon + 7+7/5+5 readback, and a drop-marker toggle. OmniTAK had no manual coordinate entry before. - Wire .twd97 into the display-format enums + Settings picker; jump the map (both engines) via a new .goToCoordinate notification, handled on a sibling view to stay under the type-checker ceiling. - en + zh-Hant localization for all new strings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A Taiwanese contributor (who did the zh-Hant localization) asked for TWD97 / TM2 (Taiwan) grid support and specifically wants to compare two digit-entry modes — 7+7 vs 5+5. OmniTAK previously had no way to type a coordinate at all (display-only / tap-to-place), so this also adds a general "Go to Coordinate" entry point.
What
TWD97Converter— TWD97 / TM2 zone 121 (EPSG:3826). Transverse Mercator on GRS80 (lon0=121°, k0=0.9999, FE=250000, FN=0). TWD97 is GRS80/ITRF-referenced (towgs84=0) so no datum shift is needed. Redfearn forward/inverse.full7— 7+7 absolute metres (the Taiwan 二度分帶 standard; unambiguous).grid5— 5+5 truncated local grid (MGRS-style; shorter, but parsing recovers the 100 km cell from the current map centre)..twd97added to the coordinate-format enums and the Settings format picker (full 7+7 readout)..goToCoordinatenotification centres both the 2D (MapLibre) and 3D (Cesium) engines and optionally drops a marker. Handled on a siblingEmptyView(via.background) to keepMapViewController.bodyunder the Swift type-checker ceiling.Verification
yychen/twd97reference: forward off by 0.004 m, inverse by ~2e-8°, central-meridian easting = 250000 exact, Taiwan round-trips < 1 mm.xcodebuild(Debug, iOS Simulator) BUILD SUCCEEDED.0306966 / 2769659→25.033971, 121.564504.🤖 Generated with Claude Code