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

ENH: add "repair" and/or "salvage" option to on_invalid parameter in read_dataframe #423

Open
theroggy opened this issue Jun 14, 2024 · 2 comments
Assignees

Comments

@theroggy
Copy link
Member

theroggy commented Jun 14, 2024

The on_invalid functionality in read_dataframe always results in None geometries now.

It would be interesting to also have a "repair" and/or "salvage" option, so it becomes possible to recover data if possible.

In theory this should be possible:

  • EDITED: in GEOS, there is apparently a function GEOSWKBReader_setFixStructure_r that enables fixing such issues when parsing WKB's. Support to use this could be added to shapely.
  • Or via another library, but this most likely implies extra dependencies which might not be ideal for an edge case like this.
  • Or an option to get back the WKB's instead of trying to read them, so you can salvage yourself
  • ...

xref #422

@theroggy
Copy link
Member Author

theroggy commented Jul 17, 2024

I encountered a function in GEOS, GEOSWKBReader_setFixStructure_r that seems to enable fixing such issues when parsing WKB's. Support to use this could be added to shapely.

This seems like a reasonable path forward for this case.

@EwoutH
Copy link
Contributor

EwoutH commented Jul 20, 2024

Thanks for looking into this! Exposing an existing function sounds like an very elegant way to implement this.

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

No branches or pull requests

2 participants