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

ThrowCorruptedShapefileDataException thrown when data is not corrupted when consumed by other software #62

Open
bjusticebuxton opened this issue Dec 12, 2024 · 0 comments

Comments

@bjusticebuxton
Copy link

Hello! I'm sorry, I'm not very experienced working with shapefiles so I'm not sure if I'm going to properly explain my problem. I am calling Shapefile.ReadAllFeatures(filepath)using GeometryBuilderMode.IgnoreInvalidShapes on the attached file, and I'm hitting ThrowCorruptedShapefileDataException(). I tried parsing through it a few different ways and it looks like it's throwing the error on the 495th record in the file. This exception mentions that there must be a 1-to-1 relationship between geometries and attributes, however if I instantiate a ShapefilePolygonReader and a DbfReader pointing to the appropriate files, they both show equal values as their respective RecordCount properties. I'm not sure what is causing the exception.

A couple of other pieces of software that read shapefiles are able to parse this correctly (a program called Alteryx, and NetTopologySuite.IO.Shapefile, which I an trying to port over to this library). I really like this one because it is significantly more performant, but am unable to do so yet.

Please let me know if there is any additional information I can provide to help diagnose.

TestShapefiles.zip

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

1 participant