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

   ## Did you read the Contributor Guide?
   
   - Yes, I have read the [Contributor 
Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor 
Development Guide](https://sedona.apache.org/latest/community/develop/)
   
   ## Is this PR related to a ticket?
   
   - No
   
   ## What changes were proposed in this PR?
   
   Removed a redundant `xIntercept < 0 || xIntercept > rasterWidth` check in 
the vertical line case of `Rasterization.computeScanlineIntersections()`. This 
check was incorrectly skipping valid scanlines for polygons whose edges align 
with the raster boundary. After clipping to raster extent, floating-point 
arithmetic can produce xIntercept values like `256.0000000000005` (exceeding 
raster width by ~5e-13), causing the check to skip valid scanline intersections 
and produce incorrect rasterization results.
   
   The non-vertical (else) branch already uses geometry-extent-based bounds 
(`xMin`/`xMax`) which correctly handles this case. The vertical line branch 
doesn't need bounds checking at all since the polygon has already been clipped 
to the raster extent.
   
   ## How was this patch tested?
   
   - Passes all existing rasterization tests
   - Added a regression test (`testZonalStatsEdgeCase`) that reproduces the 
issue with a polygon threading along the raster edge
   
   ## Did this PR include necessary documentation updates?
   
   - No, this PR does not affect any public API so no need to change the 
documentation.


-- 
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