Skip to content

Fix #817: Copernicus tile key FP precision for N03/N15/N63 bands#820

Merged
wilhel1812 merged 1 commit intostagingfrom
issue/817-copernicus-tile-key-fp
May 3, 2026
Merged

Fix #817: Copernicus tile key FP precision for N03/N15/N63 bands#820
wilhel1812 merged 1 commit intostagingfrom
issue/817-copernicus-tile-key-fp

Conversation

@wilhel1812
Copy link
Copy Markdown
Owner

Summary

  • Fixes terrain data missing for entire latitude bands N03, N15, and N63 (including Trondheim area)
  • Root cause: Copernicus DEM GeoTIFF files have ModelTiepoint Y coordinates with floating-point precision errors (e.g., 63.99999999999999 instead of 64.0), causing Math.floor(minLat) to produce wrong tile keys
  • Solution: Replace Math.floor with Math.round for latStart and lonStart in both the worker and main thread parsers

Changes

  • src/workers/copernicusTileParser.worker.ts: Math.floorMath.round
  • src/lib/copernicusTerrainClient.ts: Math.floorMath.round

Verification

  • All terrain-related tests pass (copernicusTerrainClient, srtm, copernicus proxy)
  • Verified GeoTIFF tiepoint values for affected bands via direct S3 inspection

…recision

Copernicus DEM GeoTIFF files for latitude bands N03, N15, and N63 have
ModelTiepoint Y coordinates slightly below the expected integer
(e.g., 63.99999999999999 instead of 64.0). Math.floor(minLat) then
rounded down to the wrong tile index, causing entire latitude bands
of terrain data to be unfindable.

Fixes #817
@wilhel1812 wilhel1812 merged commit 3bcf3b8 into staging May 3, 2026
5 checks passed
@wilhel1812 wilhel1812 deleted the issue/817-copernicus-tile-key-fp branch May 3, 2026 07:49
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