james-willis opened a new pull request, #3114:
URL: https://github.com/apache/sedona/pull/3114

   ## 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?
   
   - Yes, and the PR name follows the format `[GH-XXX] my subject`. Closes #3112
   
   ## What changes were proposed in this PR?
   
   `RS_AsRaster` previously only attached `noDataValue` as band metadata; 
pixels not covered by the geometry kept the allocation default of `0`, a valid 
pixel value indistinguishable from data. Now `Rasterization` fills the 
freshly-allocated raster with the `noDataValue` before burning the geometry, so 
uncovered pixels (including interior holes) read back as the declared nodata — 
matching PostGIS `ST_AsRaster` (`nodataval` fills untouched cells) and the 
`gdal_rasterize -init <nodata> -a_nodata <nodata>` idiom. Passing no 
`noDataValue` keeps the current all-zero background.
   
   The fill happens before burning (not after) because a burn `value` of `0` 
would otherwise be indistinguishable from background. `RS_SetValues` internally 
rasterized its geometry mask with the band's nodata attached; since it reads 
that raster purely as a mask where `0` means "outside the geometry", it now 
uses the overload without a nodata, preserving its behavior exactly.
   
   Existing test expectations that asserted `0` backgrounds alongside a 
non-zero `noDataValue` are updated to expect the nodata — those expectations 
were pinning the bug from #3112.
   
   ## How was this patch tested?
   
   - New `testAsRasterBackgroundIsNoDataValue`: a polygon with an interior hole 
where the hole and the outside must read back as the nodata; a `value = 0` burn 
that must stay distinguishable from the nodata background; the geometry-extent 
output path; and the null-nodata default keeping `0`. The test was written 
first and fails on master.
   - Full `common` module suite passes. `PixelFunctionEditorsTest` 
(RS_SetValues), `RasterBandAccessorsTest` (zonal stats, which passes `null` 
nodata and relies on `0` backgrounds), and `RasterBandEditorsTest` (RS_Clip, 
which never passes a nodata) pass unchanged — the consumers that depend on 
`0`-backed masks are unaffected.
   
   ## Did this PR include necessary documentation updates?
   
   - Yes, I have updated 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