Viz rasterization joins polygon rings: a spurious segment in ST_Pixelize and the outline renderer, and a gap in the filled polygon
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 77/100
Research direction
Start by reading RasterizationUtils.FindPixelCoordinates, which the issue identifies as the source of both outline and fill behavior. Trace how it handles polygon coordinates, then add coverage for polygons with holes and empty polygons in the relevant tests. Done means each ring is outlined without joining segments, filled pixels cover the polygon interior while excluding holes, and empty polygons do not throw.
Written by the indexing model from the issue text.
Description
Expected behavior
For a polygon with holes, ST_Pixelize (and the RDD visualization operators) should return the outline pixels of each ring, and the filled rasterization used by choropleth maps should cover the interior minus the holes.
Actual behavior
Both polygon paths in RasterizationUtils.FindPixelCoordinates read Polygon.getCoordinates(), which concatenates the exterior ring and the holes.
- Outline: tracing the concatenated coordinates also draws a segment from the end of the exterior ring to the start of the first hole (and between consecutive holes), and repeats the exterior's first pixel.
- Fill: the concatenated coordinates are turned into a single ring, which crosses itself along that same segment, so the interior pixels on it are dropped and the hole is only left out by accident. An empty polygon fails with an
IndexOutOfBoundsException.
Steps to reproduce
SELECT ST_Pixelize(
ST_GeomFromWKT('POLYGON ((0.5 0.5, 9.5 0.5, 9.5 9.5, 0.5 9.5, 0.5 0.5), (4.5 4.5, 6.5 4.5, 6.5 6.5, 4.5 6.5, 4.5 4.5))'),
10, 10, ST_PolygonFromEnvelope(0, 0, 10, 10))
This returns 48 pixels: the 36 of the exterior ring and the 8 of the hole, plus (1,1), (2,2), (3,3) on a segment joining them and a second (0,0). The filled path on the same polygon returns 52 pixels instead of 55, missing (1,1), (2,2) and (3,3).
Found while working on #1272. I'm a student contributing as part of a university software engineering course, and I'd like to fix this by handling each ring separately: tracing each ring for the outline, and building the pixel-space polygon with its holes for the fill.
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 794
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 59
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/sedona
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
apache/sedona#3429 · 1 comment ·
Maintainers usually reply within 1 day
-
Clearing NoData on one raster band changes another band's MapAlgebra resultsMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
apache/sedona#3324 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
RS_ZonalStats line rois: all_touched is ignored, and the default rule burns every traversed cellPossibly taken @sudhamsh-git claimed this 3 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
apache/sedona#3322 · 1 comment ·
Maintainers usually reply within 1 day
-
affect public APIs behavior change improvement sedona-common
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Vakore/ZappierGames#184 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
lugassawan/swe-workbench#823 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cassiancc/Raspberry-Core#69 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
IronCoreLabs/ironcore-alloy#351 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
checkstyle/checkstyle#22145 ·
Maintainers usually reply within 1 day