Repository navigation
Conversation
…pixel geometries ST_Pixelize traced lines and polygon rings with Bresenham's algorithm, which draws a segment's start pixel but not its end pixel. When every vertex of a geometry fell in the same pixel, every segment drew nothing, and the expression failed on `assert(pixels.size() > 0)`. A line or polygon that traces to no pixels now returns the single pixel that contains it. Collections, including the Multi* types, are pixelized member by member, so a GeometryCollection no longer fails with a MatchError and each member keeps its own pixel. Empty geometries return no pixels instead of failing. Geometries spanning several pixels are traced exactly as before. VizTestBase now calls super.beforeAll(), so the viz suites register Sedona's SQL functions themselves instead of relying on an earlier suite having done it. Generated-by: Claude Code (Claude Opus 5.5)
…y geometries Generated-by: Claude Code (Claude Opus 5.5)
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 ST_Pixelize small polygon error #1272What changes were proposed in this PR?
ST_Pixelizetraces lines and polygon rings with Bresenham's algorithm, which draws a segment's start pixel but not its end. When every vertex of a geometry falls in the same pixel, every segment draws nothing and the expression fails onassert(pixels.size() > 0).Now:
GeometryCollectionno longer fails with aMatchErrorGeometries that span several pixels are traced exactly as before.
VizTestBasenow callssuper.beforeAll(), so the viz suites register Sedona's SQL functions themselves instead of relying on another suite running first.How was this patch tested?
New cases in
PixelizeTestfor tiny lines and polygons, collections and empty geometries. Ran the viz tests on Spark 3.5 / Scala 2.12 and Spark 4.1 / Scala 2.13, and compared the old and new code on 3,000 random shapes: everything that pixelized before gives the same pixels.Did this PR include necessary documentation updates?
Assisted by Claude Code