Kontinuation opened a new pull request, #1231:
URL: https://github.com/apache/sedona/pull/1231

   ## Did you read the Contributor Guide?
   
   - Yes, I have read [Contributor 
Rules](https://sedona.apache.org/latest-snapshot/community/rule/) and 
[Contributor Development 
Guide](https://sedona.apache.org/latest-snapshot/community/develop/)
   
   ## Is this PR related to a JIRA ticket?
   
   - Yes, the URL of the associated JIRA ticket is 
https://issues.apache.org/jira/browse/SEDONA-477. The PR name follows the 
format `[SEDONA-XXX] my subject`.
   
   ## What changes were proposed in this PR?
   
   The result of RS_Clip returns GridCoverage2D objects containing JAI images 
with non-zero origin when `crop = true`. This will bring a full range of 
problems when handling such GridCoverage2D objects, because lots of band 
operation code assumes that the JAI images have zero origin, and the 
`BufferedImage` of AWT also does not allow images with non-zero origin, which 
make it difficult to construct image objects from in-memory buffer.
   
   We decide to make all GridCoverage2D objects having zero origin, rather than 
fixing all band operation routines to make them handle non-zero origins 
correctly, since this is very difficult. We defined a helper function 
`RasterUtils.shiftRasterToZeroOrigin` to shift raster with non-zero origin to 
have zero origin, and shift the affine transformation to cancel with the origin 
shift, thus to keep the actual grid coverage unchanged.
   
   ![Untitled Diagram drawio 
(1)](https://github.com/wherobots/wherobots-compute/assets/5501374/94056e8e-cf6a-4dca-a027-fd4bc998ee4d)
   
   ## How was this patch tested?
   
   Add test to validate that the result of RS_Clip has zero origin.
   
   ## Did this PR include necessary documentation updates?
   
   - No, this PR does not affect any public API so no need to change the docs.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to