Skip to content

Maps Raster getting the Coordinate from the orignal raster #109

Open
AM1729 wants to merge 2 commits into
TheHortonMachine:masterfrom
AM1729:mapraster
Open

Maps Raster getting the Coordinate from the orignal raster #109
AM1729 wants to merge 2 commits into
TheHortonMachine:masterfrom
AM1729:mapraster

Conversation

@AM1729

@AM1729 AM1729 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Issues where the projection itself doesn't change but Axis Order changes, for instance the outRaster initialized with the general CRS object with HMCRSRegistry.Instance.getCrs(code); and we need to map it with another Raster of the same projection but with different Axis order.

if (isContained(c, r)) {
Coordinate coordinate = getWorld(c, r);
double otherRasterValue = otherRaster.getValue(coordinate);
Coordinate otherRasterCoordinate =otherRaster.getWorld(c,r);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AM1729 , this needs to be getWorld only, else it will not pick the right col/row pair. The idea is that we need to get the world coordinate of the final raster, so that we can then get the value in that coordinate in the otherRaster. Potentially the col/row that you ask for might not exists in the otherRaster.

I am not sure what issue you are trying to solve, but this is wrong:

Coordinate otherRasterCoordinate =otherRaster.getWorld(c,r);

Conceptually we always need to switch to the world space to get the values from different rasters if they have different gridgeometries.

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.

2 participants