Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlatGeobuf writing: in SPATIAL_INDEX=NO mode, deal with empty geometries as if there were null #11420

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

rouault
Copy link
Member

@rouault rouault commented Dec 2, 2024

@bjornharrtell Can you confirm that FlatGeobuf is not a fan of EMPTY geometries ?

@rouault rouault added the backport release/3.10 Backport to release/3.10 branch label Dec 2, 2024
@bjornharrtell
Copy link
Contributor

@rouault confirmed. I either like to pretend they do not exist or treat them as null geometry.

…ies as if there were null

- this fixes the crash when writing an empty polygon. Fixes OSGeo#11419
- this avoids a reading error when writing an empty line
@rouault
Copy link
Member Author

rouault commented Dec 2, 2024

Also add support for writing a file without feature in SPATIAL_INDEX=NO mode ( @bjornharrtell no reason why we should disallow this, right ? since writing empty files in SPATIAL_INDEX=YES mode already works)

@rouault rouault force-pushed the flatgeobuf_empty_geoms branch from d87e68e to e6cb834 Compare December 2, 2024 23:20
@rouault rouault force-pushed the flatgeobuf_empty_geoms branch from e6cb834 to c59ee22 Compare December 2, 2024 23:23
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 74.16% (-0.01%) from 74.172%
when pulling c59ee22 on rouault:flatgeobuf_empty_geoms
into 57833dc on OSGeo:master.

@bjornharrtell
Copy link
Contributor

Also add support for writing a file without feature in SPATIAL_INDEX=NO mode ( @bjornharrtell no reason why we should disallow this, right ? since writing empty files in SPATIAL_INDEX=YES mode already works)

No, must been an oversight that it wasn't doing so already.

@rouault rouault merged commit 436ae05 into OSGeo:master Dec 5, 2024
38 checks passed
@rouault
Copy link
Member Author

rouault commented Dec 5, 2024

The backport to release/3.10 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply e1f2404082... FlatGeobuf writing: in SPATIAL_INDEX=NO mode, deal with empty geometries as if there were null
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"

stdout
Auto-merging autotest/ogr/ogr_flatgeobuf.py
CONFLICT (content): Merge conflict in autotest/ogr/ogr_flatgeobuf.py
Auto-merging ogr/ogrsf_frmts/flatgeobuf/ogrflatgeobuflayer.cpp

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release/3.10 release/3.10
# Navigate to the new working tree
cd .worktrees/backport-release/3.10
# Create a new branch
git switch --create backport-11420-to-release/3.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick e1f240408258b7505c80582721509110226848dc,c59ee2217869fb3ee5af5be28a48c653ac07f576
# Push it to GitHub
git push --set-upstream origin backport-11420-to-release/3.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/3.10

Then, create a pull request where the base branch is release/3.10 and the compare/head branch is backport-11420-to-release/3.10.

@rouault
Copy link
Member Author

rouault commented Dec 5, 2024

cherry-picked to 3.10 per 340f72f and f3e4b05

@rouault rouault added this to the 3.10.1 milestone Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release/3.10 Backport to release/3.10 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault when writing an empty polygon to FlatGeobuf
3 participants