You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "james-willis (via GitHub)" <gi...@apache.org> on 2026/07/17 19:30:22 UTC
[I] allTouched/line rasterization can burn a corner-touched pixel at grid-aligned vertices (differs from GDAL by one pixel) [sedona]
james-willis opened a new issue, #3120:
URL: https://github.com/apache/sedona/issues/3120
## Expected behavior
`RS_AsRaster` with `allTouched = true`, and `LINESTRING` rasterization, aim to match GDAL (`rasterio.features.rasterize(all_touched=True)`) on which pixels are burned.
## Actual behavior
After the exact-traversal fix (#3118), the two engines agree on all general input (a 100-case randomized fuzz over anisotropic grids matches GDAL exactly). They can still differ by a single pixel when a geometry vertex lands *exactly* on a grid line.
Example on a 6x6 unit grid:
```sql
SELECT RS_BandAsArray(RS_AsRaster(
ST_GeomFromWKT('POLYGON ((1.5 1.5, 3.8 3.0, 4.5 4.4, 3.4 3.5, 1.5 1.5))'),
RS_MakeEmptyRaster(1, 'B', 6, 6, 0.0, 6.0, 1.0, -1.0, 0.0, 0.0, 0),
'B', true, 1.0, 0.0, false), 1);
```
The vertex `(1.5 1.5)` sits exactly on a pixel corner. Sedona burns the corner-touched cell (the geometry does touch it, at that point); GDAL omits it.
## Notes
This only occurs at exact grid-aligned vertices, never on general-position input, and it is a *superset* of GDAL — Sedona's result is consistent with the literal documented rule ("all pixels touched by the geometry"). GDAL's own behaviour at these degeneracies is not internally consistent (it includes some corner touches and omits others depending on edge direction), so there is no single reference to match. Filing for visibility; low priority and not currently planned.
Discovered while fixing #3118.
--
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: issues-unsubscribe@sedona.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] allTouched/line rasterization can burn a corner-touched pixel at grid-aligned vertices (differs from GDAL by one pixel) [sedona]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu closed issue #3120: allTouched/line rasterization can burn a corner-touched pixel at grid-aligned vertices (differs from GDAL by one pixel)
URL: https://github.com/apache/sedona/issues/3120
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org