Skip to content

feat(coords): TWD97 (Taiwan) grid + Go to Coordinate entry#69

Open
jfuginay wants to merge 2 commits into
feat/zh-hant-localizationfrom
feat/twd97-taiwan-grid
Open

feat(coords): TWD97 (Taiwan) grid + Go to Coordinate entry#69
jfuginay wants to merge 2 commits into
feat/zh-hant-localizationfrom
feat/twd97-taiwan-grid

Conversation

@jfuginay
Copy link
Copy Markdown
Contributor

@jfuginay jfuginay commented Jun 6, 2026

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.

Base note: stacked on feat/zh-hant-localization (#67) because the new UI uses the Loc i18n system that isn't on main yet. Rebase onto main once #67 merges.

What

  • Twd97Converter — TWD97 / TM2 zone 121 (EPSG:3826). Transverse Mercator on GRS80 (lon0=121°, k0=0.9999, FE=250000, FN=0); towgs84=0 so no datum shift. 1:1 port of the verified iOS math.
  • Two digit modes: FULL7 (7+7 absolute, Taiwan 二度分帶 standard) and GRID5 (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 a CoordinateEntryEvents bus → MapScreen.
  • Display + SettingsTWD97 added to CoordFormat, CoordFormatter (full 7+7 readout, falls back to decimal outside Taiwan), and the Settings picker.
  • i18n — en + zh-Hant strings for all new UI.

Verification

  • Converter checked against the yychen/twd97 reference: forward off by 0.004 m, inverse by ~2e-8°, central-meridian easting = 250000 exact, Taiwan round-trips < 1e-6°.
  • ./gradlew :app:assembleDebugBUILD SUCCESSFUL.

Known limitation

On the Cesium 3D globe engine, "Go" drops the marker but doesn't fly the camera (panTarget only feeds the 2D map — same pre-existing limit as Teams pan-to-contact). 2D works fully.

🤖 Generated with Claude Code

jfuginay and others added 2 commits June 6, 2026 00:43
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>
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.

1 participant