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

PolygonGeography default constructor: create empty S2Polygon #31

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

benbovy
Copy link
Collaborator

@benbovy benbovy commented Oct 15, 2024

I've been struggling a bit with segmentation faults before realizing that the PolygonGeography() default constructor was creating a new object with an empty polygon_ pointer.

This PR now creates a Polygon geography by default with an empty S2Polygon object, which I think is more predictable and more consistent with other geography types returning an empty container (vector) by default. However, I'm not sure how empty polygons are checked elsewhere here or in downstream libraries (R's s2?) ; if they explicitly check for std::nullptr_t then this is a breaking change.

Copy link
Owner

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@paleolimbot paleolimbot merged commit e141957 into paleolimbot:main Oct 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants