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

LinearRing handling #26

Open
ChocopieKewpie opened this issue Mar 5, 2024 · 2 comments
Open

LinearRing handling #26

ChocopieKewpie opened this issue Mar 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ChocopieKewpie
Copy link
Member

Katana cutting does not handle LinearRings:

shapely.errors.GEOSException: IllegalArgumentException: Points of LinearRing do not form a closed linestring

@ChocopieKewpie ChocopieKewpie added the bug Something isn't working label Mar 5, 2024
@alpha-beta-soup
Copy link
Member

alpha-beta-soup commented Mar 5, 2024

I think it should be able to handle them. Can you see one of the offending geometries? It's likely because it's not "closed": for validity, the start and end need to be the same point. See if you can get a WKT version of it.

It might be possible in fact that the act of "katana cutting" is creating an invalid geometry from valid input. However there is code to check and attempt to repair invalid input. As it works recursively, geoetries should remain valid throughout.

@alpha-beta-soup
Copy link
Member

https://github.com/manaakiwhenua/vector2dggs/blob/main/vector2dggs/katana.py#L29

Perhaps the normalize should occur before checking validity? I don't know if normalising a geometry collection can create invalid geometries (I'd be surprised if it did).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants