You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [35]: spherely.Polygon([(0, 0), (1, 1), (0, 1), (0, 0)])
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[35], line 1
----> 1 spherely.Polygon([(0, 0), (1, 1), (0, 1), (0, 0)])
ValueError: loop is not valid: Edge 3 is degenerate (duplicate vertex)
I am used from shapely that explicitly passing the closing point (which is the same as the first point) is allowed (also because the GEOS data model actually stores this in the coordinates), but this currently fails in spherely.
Also because things like WKT or GeoJSON show this, I think it is a common pattern to pass this.
We can probably detect that the last coordinate pair is the same as the first and drop it for the user.
The text was updated successfully, but these errors were encountered:
In #51 both closing vs. non-closing are supported, although this is fragile as it relies on strict equality of the 1st and last computed vertices (S2Point). We'll certainly need to revisit that as well as uniformize the API with #49 and #50 (i.e., add oriented and planar arguments).
although this is fragile as it relies on strict equality of the 1st and last computed vertices (S2Point).
I think that is fine (at least for now), AFAIK in GEOS / shapely we also rely on exact floating point equality (that can give problems in corner cases, eg after transforming coordinates, but it's not that common)
Currently we get:
I am used from shapely that explicitly passing the closing point (which is the same as the first point) is allowed (also because the GEOS data model actually stores this in the coordinates), but this currently fails in spherely.
Also because things like WKT or GeoJSON show this, I think it is a common pattern to pass this.
We can probably detect that the last coordinate pair is the same as the first and drop it for the user.
The text was updated successfully, but these errors were encountered: