Repository navigation
Conversation
…lities Both polygon paths in RasterizationUtils.FindPixelCoordinates read Polygon.getCoordinates(), which concatenates the exterior ring and the holes. The outline path therefore also traced a segment from the end of one ring to the start of the next, adding pixels to ST_Pixelize and the RDD outline renderer. The fill path turned the concatenated coordinates into a single self-crossing ring, dropping the interior pixels along that segment. The outline path now traces each ring on its own, and the fill path converts each ring to pixel space and keeps the holes as holes. Polygons without holes rasterize exactly as before. An empty polygon now has no pixels instead of failing with an IndexOutOfBoundsException in the fill path. Generated-by: Claude Code (Claude Opus 5.5)
Contributor
Author
…ontains
Once the rings are snapped to pixels, a hole can share an edge with the
exterior ring or with another hole, for example a hole 0.5 units from
the shell on a 1-unit grid. Polygon.contains then throws a
TopologyException ("side location conflict") for valid input polygons.
Locating each pixel point with SimplePointInAreaLocator gives the same
pixels without building a topology graph, so it does not throw.
Generated-by: Claude Code (Claude Opus 5.5)
Contributor
Author
|
Pushed one more commit: while fuzzing the fill path I found that snapping a hole to pixels can put its edge on the exterior ring or on another hole, and Polygon.contains then throws a TopologyException (even for valid input polygons). The fill now uses SimplePointInAreaLocator, which gives the same pixels otherwise and does not throw. Added two regression tests for those cases and updated the description. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes Viz rasterization joins polygon rings: a spurious segment in ST_Pixelize and the outline renderer, and a gap in the filled polygon #3469What changes were proposed in this PR?
Both polygon paths in
RasterizationUtils.FindPixelCoordinatesusedPolygon.getCoordinates(), which joins the exterior ring and the holes into one list. So the outline path drew an extra segment from the end of one ring to the start of the next, and the fill path treated everything as one self-crossing ring, losing the interior pixels along that segment.The outline path now traces each ring on its own, and the fill path keeps holes as holes. Polygons without holes rasterize exactly as before. An empty polygon now returns no pixels instead of throwing
IndexOutOfBoundsException.The fill path now checks each pixel with
SimplePointInAreaLocatorinstead ofPolygon.contains. Snapping a hole to pixels can put its edge on the exterior ring or on another hole, andPolygon.containsthrows aTopologyExceptionon such rings, even for valid input polygons.How was this patch tested?
New
RasterizationUtilsTest: no holes, one hole, several holes, holes that snap onto the exterior ring or onto each other, and empty polygons, for both outline and fill. Compared old and new output on 5,000 random hole-free polygons (identical), and the 18 existing Java and 8 Scala viz tests pass along with the 9 new ones.Did this PR include necessary documentation updates?
Assisted by Claude Code
Generated-by: Claude Code (Claude Opus 5.5)