Skip to content

feat: return candidate coordinates with their linear unit - #9

Merged
kochizufan merged 3 commits into
train/2026-12from
dec26/m1-t5-output-basis
Oct 27, 2026
Merged

kochizufan merged 3 commits into
train/2026-12from
dec26/m1-t5-output-basis

Conversation

@kochizufan

Copy link
Copy Markdown
Member

Summary

  • New transformLonLatToCandidate(target, points, options?) returns { points, unit } with a LinearUnit ({ name, metresPerUnit }).
    • A CRS takes its unit from the PROJ axis information (east/north, two dimensions, the same linear unit on both axes). For example EPSG:2227 gives US survey foot (1200 / 3937 m).
    • A custom or user pipeline row (grid to lon/lat) runs in the inverse direction and returns the grid unit declared by the row. A pipeline row without unit gives null.
  • transformLonLatArrayToProjected keeps its contract (metres only, otherwise null). It is now a thin wrapper around the new function, so there is one implementation.
  • createCandidateTransformer returns a plain point list for a candidate in metres (unchanged) and { points, unit } for any other unit. AtlasCandidateTransformer widens its return type accordingly.
  • The three bundled historical Japan city plan zones (UTJCP:ZONE-A/B/C) declare unit: { name: "yard (Japan City Plans)", metresPerUnit: 0.9143985307444408 }, matching their +to_meter.
  • README (English and Japanese): a Units section and the new API entries. dist/ rebuilt.

Tests

  • New tests/proj-wasm-output-basis.test.ts: UTJCP zone B in yards (checked against the same pipeline without +to_meter, within 1e-6 m), EPSG:2227 in US survey feet, EPSG:6674 in metres (identical to transformLonLatArrayToProjected), pipeline rows without a unit give null, the adapter's return shapes and copies, and repeated calls after inverse pipeline transforms.
  • New tests/custom-projection-units.test.ts: every pipeline row of the bundled definitions has a unit that matches its +to_meter.
  • Existing tests/proj-wasm-transform.test.ts and tests/candidate-transformer.test.ts are unchanged.

The Teiresias side uses the same branch name so that its CI runs on this change.

🤖 Generated with Claude Code

…onLatToCandidate)

- Add transformLonLatToCandidate and the LinearUnit type. A CRS gives the unit from the
  axis information of PROJ (metre, US survey foot, ...); a custom or user pipeline row is
  run in the inverse direction and gives the unit declared by the row.
- transformLonLatArrayToProjected keeps its contract (metres only, otherwise null) and is
  now a thin wrapper around the new function.
- createCandidateTransformer returns a plain point list for a candidate in metres and
  { points, unit } for any other unit; rows are copied with their unit.
- The three historical Japan city plan zones declare their grid unit (yard).
- README (English and Japanese): Units section and API entries. dist rebuilt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kochizufan and others added 2 commits October 27, 2026 23:19
Bring in the preset contrasts of the candidate CRS demo before the unit fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A geographic CRS (OGC:CRS84, +proj=longlat) has east/north axes in degrees whose factor
  is radians per degree, not metres per unit. Check the coordinate system type and give
  null unless it is Cartesian, as before this API existed.
- A pipeline row whose unit has an empty name or a metresPerUnit that is not a positive
  finite number cannot be transformed (null), so one bad user row does not stop the
  other candidates.
- README (English and Japanese): both conditions in the Units section. dist rebuilt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kochizufan
kochizufan marked this pull request as ready for review October 27, 2026 18:22
@kochizufan
kochizufan merged commit 372ce1c into train/2026-12 Oct 27, 2026
5 checks passed
@kochizufan
kochizufan deleted the dec26/m1-t5-output-basis branch October 27, 2026 18:22
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