-
Notifications
You must be signed in to change notification settings - Fork 170
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
Working with Empty Polygon #206
Comments
What are the definitions of |
In testing the first part, I'm seeing that |
Correct, the output is an empty polygon, and in the logic of my app, it should be fine. Here's a simple example; maybe it clarifies what I need to implement. Let's say I have two sets:
I should be able to apply intersection and get an empty set as a result, right?
It's a similar case in what we have here with this polygon. I want to use the intersection method without the app crashing. |
Supporting empty geometry is an interesting problem. Note that GEOSwift itself establishes invariants that preclude the possibility of empty Points, LineStrings, and Polygons (via Polygon.LinearRing). These invariants are useful to reduce optionality and edge cases throughout the code. That said, I can see the argument for modeling empty versions of Point, LineString, and Polygon (and maybe Polygon.LinearRing). I imagine this would be a fairly large project and would likely result in a 8.0 release of this library. In the meantime, I think you'll need to find a way to handle the possibility of
|
I'm using GEOswift in an engineering plotting app. I need to define and work with empty polygons in different steps. Before the recent release, it was working perfectly fine, but now whenever I have an empty polygon/geometry, it gives me:
Here are some examples I have this issue with:
poly1 is an empty polygon so the program crashes when I'm trying to get a union.
What can I change in my code to avoid such crashes?
The text was updated successfully, but these errors were encountered: