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

[SEDONA-411] Add RS_Rotation #1061

Merged
merged 15 commits into from
Oct 31, 2023
Merged

[SEDONA-411] Add RS_Rotation #1061

merged 15 commits into from
Oct 31, 2023

Conversation

furqaankhan
Copy link
Contributor

@furqaankhan furqaankhan commented Oct 25, 2023

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

  • Add RS_Rotation
  • Add RS_GeoTransform

How was this patch tested?

  • Passed new tests

Did this PR include necessary documentation updates?

  • Yes, I have updated the documentation update.

@jiayuasu
Copy link
Member

@furqaankhan Is the result identical to PostGIS?

@furqaankhan
Copy link
Contributor Author

Yes it is.

@furqaankhan
Copy link
Contributor Author

@jiayuasu I want to get Kristin's opinion before merging, so don't merge yet.

}

// Angular separation
thetaIJ = Math.acos((((scaleX * skewX) + (skewY * scaleY)) / (magnitudeI * magnitudeJ)));
Copy link
Member

Choose a reason for hiding this comment

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

can magnitude be zero or other invalid values? If so, we need to add handlers and test cases.

Comment on lines 147 to 151
// x ordinate of the upper-left corner of the upper-left pixel
double offsetX = renderedImage.getTileGridXOffset();

// y ordinate of the upper-left corner of the upper-left pixel
double offsetY = renderedImage.getTileGridYOffset();
Copy link
Member

Choose a reason for hiding this comment

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

This is not correct. offsetX and offsetY should be directly retrieved from the upperLeftX and upperLeftY components of the raster metadata.

public void testGeoTransform() throws FactoryException {
GridCoverage2D emptyRaster = RasterConstructors.makeEmptyRaster(1, 10, 15, 1, 2, 1, -1, 10, 10, 0);
double[] actual = RasterAccessors.getGeoTransform(emptyRaster);
double[] expected = new double[] {10.04987562112089, 10.04987562112089, -1.4711276743037347, -1.5707963267948966, 0.0, 0.0};
Copy link
Member

Choose a reason for hiding this comment

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

We are getting 0 offsets for rasters with non-zero offsets, this is caused by the problem mentioned above.

@jiayuasu jiayuasu merged commit 5bd0172 into apache:master Oct 31, 2023
30 of 40 checks passed
@furqaankhan furqaankhan deleted the rs-rotation branch July 16, 2024 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants