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

   ## Summary
   
   Makes `RS_AsRaster` and related rasterization functions work correctly with 
bottom-up rasters (positive scaleY), which are common in formats like BMP and 
certain GeoTIFF configurations.
   
   ### Changes
   
   - **Rasterization.java**: Detect bottom-up orientation via 
`RasterizationParams.bottomUp` flag; flip rasterized pixels vertically after 
rasterization so output matches the requested grid orientation. Updated 
scanline Y calculations to use helper methods.
   - **RasterUtils.java**: Added `getRasterUpperLeftY`, `getRasterScaleY`, 
`flipVerticallyPixelSpace`, and `flipVerticallyGridSpace` utility methods.
   - **RS_AsRaster.md**: Removed the `ScaleY must be negative` restriction from 
documentation.
   - **Tests**: Added bottom-up rasterization tests across 
`RasterizationTests`, `RasterBandAccessorsTest`, `RasterBandEditorsTest`, 
`RasterConstructorsTest`, and `RasterUtilsTest`.
   
   ### Approach
   
   When a raster has positive scaleY (bottom-up), the rasterization pipeline 
normalizes it to top-down internally (negating scaleY, adjusting upperLeftY), 
performs rasterization as usual, then flips the result back to match the 
original bottom-up orientation. This keeps the core rasterization logic 
unchanged while transparently supporting both orientations.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to