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-383] Add RS_Band #1001

Merged
merged 13 commits into from
Sep 6, 2023
Merged

[SEDONA-383] Add RS_Band #1001

merged 13 commits into from
Sep 6, 2023

Conversation

furqaankhan
Copy link
Contributor

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

  • Add RS_Band

How was this patch tested?

  • Passed added tests

Did this PR include necessary documentation updates?

  • Yes, I have updated the documentation update.

@@ -45,6 +52,28 @@ case class RS_SummaryStats(inputExpressions: Seq[Expression]) extends InferredEx
}
}

case class RS_Band(inputExpressions: Seq[Expression]) extends InferredExpression(RasterBandAccessors.getBand _) with SerdeAware with CodegenFallback {
Copy link
Member

Choose a reason for hiding this comment

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

No need to add SerdeAware and CodgenFallback here as InferredExpression already has those.

double [][] bandData = new double[bandsDistinct.length][height * width];
for (int curBand: bandsDistinct) {
RasterUtils.ensureBand(rasterGeom, curBand);
bandData[curBand - 1] = MapAlgebra.bandAsArray(rasterGeom, curBand);
Copy link
Member

Choose a reason for hiding this comment

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

The code here has a bug. It cannot handle cases such as 3, 3, 3 and will throw index out of bound error

@@ -45,6 +52,28 @@ case class RS_SummaryStats(inputExpressions: Seq[Expression]) extends InferredEx
}
}

case class RS_Band(inputExpressions: Seq[Expression]) extends InferredExpression(RasterBandAccessors.getBand _) {
Copy link
Member

Choose a reason for hiding this comment

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

Please optimize the imports and remove unnecessary imports.

@jiayuasu jiayuasu merged commit 57f12b6 into apache:master Sep 6, 2023
39 checks passed
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