Skip duplicate shapefile points#906
Open
Symmetricity wants to merge 1 commit into
Open
Conversation
fillPointArrayFromShapefile already tests each vertex against the previous accepted point before appending it. A second unconditional append bypassed that check and reintroduced every source vertex. Remove the duplicate append so the existing tolerance check is the only path that adds points to the output vector. Co-authored-by: Codex <noreply@openai.com>
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.
This PR is AI generated.
Summary
duplicate-point filter
Background
ShpProcessor::fillPointArrayFromShapefile()checks each vertex against theprevious accepted point before appending it. Immediately after that guarded
append, the function appended the same source vertex again unconditionally.
That second append means duplicate filtering did not actually filter the points
that it rejected, and accepted points were appended twice.
I checked the history around this code. The duplicate-point filter was
introduced to skip duplicated shapefile points; I did not find a rationale for
the later unconditional append, and it contradicts the comment and guarded
logic above it.
Change
Remove the unconditional append so points are only added through the existing
duplicate check.
Expected Behavior
Shapefile geometry loading should produce fewer repeated adjacent points. This
can reduce geometry size and downstream processing work for shapefile-backed
layers without changing the intended coordinate transformation or tolerance.
Visual output should either be unchanged or lose zero-length duplicate segments
that were not intended to be present.
Testing
git diff --checkctest --output-on-failure(no CMake tests are registered in this repo)