Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetVirtualHeightMapInBBox does not work when DEMFileRegistrationMode is Cell #97

Open
g0ro opened this issue Sep 21, 2021 · 1 comment

Comments

@g0ro
Copy link

g0ro commented Sep 21, 2021

Trying to get heightmap in bbox, using GeoTiff dataset with Cell file format, fails when bbox is partially covered.

RasterService.GetVirtualHeightMapInBBox(...) returns a hightmap half pixel shifted. This results in incorrect height map when merging tilesHeightMap in ElevationService.GetHeightMap(....)

When DEMFileRegistrationMode is Cell, we should add (metadata.pixelSizeY / 2d) to metadata.DataEndLat, and (metadata.pixelSizeX / 2d) to metadata.DataStartLon
(File:

double latitude = metadata.DataEndLat + (metadata.pixelSizeY * y);
, Lines: 560, 566, 567, 576)
Reference:
double endLat = metadata.DataEndLat + metadata.pixelSizeY / 2d;

@xfischer
Copy link
Member

Hi @g0ro, thanks for reporting this. Can you submit a PR ?

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

No branches or pull requests

2 participants