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-425] Add RS_Values and RS_Value to accept grid coordinates #1122

Merged
merged 23 commits into from
Nov 16, 2023

Conversation

prantogg
Copy link
Contributor

@prantogg prantogg commented Nov 14, 2023

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

  • Add a RS_Values() variant to accept Grid coordinates
  • Add a RS_Value() variant to accept Grid coordinates

How was this patch tested?

  • Passing new tests

Did this PR include necessary documentation updates?

  • Yes, I have updated the documentation update.

@prantogg prantogg changed the title Add RS_Values to accept grid coordinates [SEDONA-425] Add RS_Values and RS_Value to accept grid coordinates Nov 15, 2023
@prantogg prantogg marked this pull request as ready for review November 15, 2023 16:43
Comment on lines 98 to 101
double x = xCoordinates[i];
double y = yCoordinates[i];

GridCoordinates2D gridCoord = new GridCoordinates2D((int) x, (int) y);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to convert the int coordinate to double and then back to int?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. That was a remanent of my previous approach. Thanks.


Format:

`RS_Value (raster: Raster, point: Geometry)`

Copy link
Member

Choose a reason for hiding this comment

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

Please keep RS_Value (raster: Raster, point: Geometry) signature because we don't want to introduce any API breaking change.

Then revert the change R test because it is no longer needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have kept RS_Value (raster: Raster, point: Geometry) signature and reverted changes to R tests.

Note:

  • Only Point geometry variant of RS_Value and RS_Values can take band as optional parameter
  • Same currently not possible for the integer variant because of conflicting function signatures as shown below,
    RS_Value (raster: Raster, colX: Integer, colY: Integer)
    RS_Value (raster: Raster, point: Geometry, band: Integer)

Copy link
Member

Choose a reason for hiding this comment

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

Can you also add the explanation to the RS_Value and RS_Values doc: the input geometry point must be in the same CRS of the raster.


Format:

`RS_Value (raster: Raster, point: Geometry)`

Copy link
Member

Choose a reason for hiding this comment

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

Can you also add the explanation to the RS_Value and RS_Values doc: the input geometry point must be in the same CRS of the raster.

@jiayuasu jiayuasu added this to the sedona-1.5.1 milestone Nov 15, 2023
@prantogg
Copy link
Contributor Author

@jiayuasu Added a note in docs to match CRS of raster and Point geometries.
Also, the Scala and Java build / build (3.0.3, 2.12.15, 8) is failing with a 503 error. Not sure why this is happening.

@jiayuasu jiayuasu merged commit e2d3c02 into apache:master Nov 16, 2023
37 of 40 checks passed
@prantogg prantogg deleted the update2-RS_Value branch November 16, 2023 16:24
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

4 participants