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

[DOCS] Refactor RS_AddBandFromArray #964

Merged
merged 16 commits into from
Aug 14, 2023

Conversation

iGN5117
Copy link
Contributor

@iGN5117 iGN5117 commented Aug 14, 2023

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

  • No, this is a documentation update. The PR name follows the format [DOCS] my subject.

What changes were proposed in this PR?

  • Refactor RS_BandFromArray to include typecasting info

How was this patch tested?

  • Compiled documentation

Did this PR include necessary documentation updates?

  • Yes, I have updated the documentation update.

@@ -676,7 +676,7 @@ Introduction: Add a band to a raster from an array of doubles.

Format: `RS_AddBandFromArray (raster: Raster, band: Array[Double])` | `RS_AddBandFromArray (raster: Raster, band: Array[Double], bandIndex:Int)` | `RS_AddBandFromArray (raster: Raster, band: Array[Double], bandIndex:Int, noDataValue:Double)`

Since: `v1.4.1`
Since: `v1.5.0`
Copy link
Member

Choose a reason for hiding this comment

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

You can separate the new APIs and old APIs by

Additional APIs since `v1.5.0`
XXXX

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is not version dependent, if a user loads a raster with some other data type, and tries to add a band, they will be typecasted.
However, I changed the version because 1.5.0 onwards MakeEmptyRaster allows specifying data type.

Also, once we can control supplying version's docs from the backend right, I didn't think I would need to specify version wise anything in the documentation

@@ -692,6 +692,9 @@ In order to remove an existing noDataValue from an existing band, pass null as t

Note that: `bandIndex == RS_NumBands(raster) + 1` is an experimental feature and might not lead to the loss of raster metadata and properties such as color models.
Copy link
Member

Choose a reason for hiding this comment

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

This should be might lead to

@@ -692,6 +692,9 @@ In order to remove an existing noDataValue from an existing band, pass null as t

Note that: `bandIndex == RS_NumBands(raster) + 1` is an experimental feature and might not lead to the loss of raster metadata and properties such as color models.

!!!Note
RS_BandFromArray typecasts the double band values to the given datatype of the raster. This can lead to overflow values if values beyond the range of the raster's datatype are provided.
Copy link
Member

Choose a reason for hiding this comment

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

This should be RS_AddBandFromArray. What can users do to find the current data type in the raster?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed the mistake fix.
To get the data type for the given band, users can use RS_BandPixelType

Copy link
Member

Choose a reason for hiding this comment

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

This file should not be added.

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

@jiayuasu jiayuasu added the docs label Aug 14, 2023
@jiayuasu jiayuasu merged commit 4e45489 into apache:master Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants