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

Error in shapefile writing for SVM operations #96

Open
gwlucastrig opened this issue Feb 13, 2023 · 1 comment
Open

Error in shapefile writing for SVM operations #96

gwlucastrig opened this issue Feb 13, 2023 · 1 comment

Comments

@gwlucastrig
Copy link
Owner

Recent attempts to import the contour-files output from the SVM module into QGIS failed due to geometry problems in the shapefiles produced by SVM. Problems were traced back to two sets of errors. First, some of the contours produced by the ContourBuilder had self-intersecting lines. Second, the API for writing shapefiles has some coding errors. This issue proposes to fix both these problems.

@gwlucastrig
Copy link
Owner Author

The main problem turned out to be the shapefile index file (the .shx file). Tinfour's ShapfileWriter updated the record-indexing section of that file, but it did not update the coordinate bounds section in the index file header. QGIS treated this as meaning that the geometry for the shapefile was not available. However, the ShapefileWriter did correctly update the same section of the main file (the .shp file). So I simply consolidated the code for performing flush operations on the two files into a single method that was used consistently for both.

I have pushed up changes for the shapefile-related classes.

I am still investigating some geometry validation errors being reported about the contour files. The cause is not yet known.

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