feat(coords): TWD97 (Taiwan) grid + Go to Coordinate entry#69
Open
jfuginay wants to merge 2 commits into
Open
Conversation
Add TWD97 / TM2 zone 121 (EPSG:3826) coordinate support, mirroring the iOS feature, 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. Verified to 0.004 m vs the yychen/twd97 reference; central-meridian E=250000 exact; Taiwan round-trips < 1e-6°. - Two digit-input modes: FULL7 (7+7 absolute, Taiwan 二度分帶 standard) and GRID5 (5+5 truncated local grid; parsing recovers the 100 km cell from the current map area). - CoordinateEntrySheet: "Go to Coordinate" (TWD97 / MGRS / Lat-Lon) with the 7+7 vs 5+5 toggle, live lat/lon + 7+7/5+5 readback, drop-marker switch. Reachable from the Tools launcher. - Wire TWD97 into CoordFormat + CoordFormatter + Settings picker; on Go, centre the map (2D) and optionally drop a marker. - en + zh-Hant strings for all new UI. Note: on the Cesium 3D globe, Go drops the marker but does not fly the camera (panTarget only feeds the 2D map; same limit as Teams pan-to- contact). 2D works fully. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Mirrors the iOS TWD97 work for the Taiwanese contributor (who did the zh-Hant localization) — TWD97 / TM2 grid support with a 7+7 vs 5+5 digit-entry comparison, and a first-ever manual "Go to Coordinate" entry on Android.
What
Twd97Converter— TWD97 / TM2 zone 121 (EPSG:3826). Transverse Mercator on GRS80 (lon0=121°, k0=0.9999, FE=250000, FN=0);towgs84=0so no datum shift. 1:1 port of the verified iOS math.FULL7(7+7 absolute, Taiwan 二度分帶 standard) andGRID5(5+5 truncated local grid; parse recovers the 100 km cell from the current map area).CoordinateEntrySheet— "Go to Coordinate" (TWD97 / MGRS / Lat-Lon) with the 7+7 ⟷ 5+5 toggle, live lat/lon + 7+7/5+5 readback, drop-marker switch. Launched from the Tools popup via aCoordinateEntryEventsbus →MapScreen.TWD97added toCoordFormat,CoordFormatter(full 7+7 readout, falls back to decimal outside Taiwan), and the Settings picker.Verification
yychen/twd97reference: forward off by 0.004 m, inverse by ~2e-8°, central-meridian easting = 250000 exact, Taiwan round-trips < 1e-6°../gradlew :app:assembleDebug— BUILD SUCCESSFUL.Known limitation
On the Cesium 3D globe engine, "Go" drops the marker but doesn't fly the camera (
panTargetonly feeds the 2D map — same pre-existing limit as Teams pan-to-contact). 2D works fully.🤖 Generated with Claude Code