Hi all, As noted in the QGis issues <https://github.com/qgis/QGIS/issues/53058>, the shx has problems that ogr2ogr (or QGis Repair Shapefile) will not fix; The error I get in cmdline with SHAPE_RESTORE_SHX=YES is "ERROR 4: Error parsing .shp to restore .shx". Long time ago I wrote my own version to recreate the .shx from the .shp, and it does restore the .shx (leaving me to wonder whether my routine is really correct); long story short, the repaired shapefile loads fine, but the shp does not contain the missing geometries anyway, and the dbf doesn't have rows of missing objects (as shown in the QGis issue).
The missing objects are presumed lost, see issue. Looking at the .idx file I surmise that it is a foxbase/foxpro index. Good (very) old dbase has .mdx and .ndx. DBF index files are not part of the shapefile spec. The layout of the file does not fully fit the few descriptions I have, but looks like btree record blocks with keys that may address column H (soil erosion). The presence of this 'foreign' (in the context of shapefiles) file made be think that perhaps the .dbf has been modified using foxpro/foxbase, leading to an error when saving again in QGis. Another bit of evidence for such a scenario is that the last row in the .dbf is garbled. (check with LibreOffice Calc). FWIW a link <https://www.dropbox.com/s/wj0loe0m7apuszz/test.zip?dl=0> to the worked shapefile. On Tue, May 16, 2023 at 2:03 PM Andrea Giudiceandrea via gdal-dev < gdal-dev@lists.osgeo.org> wrote: > Il 16/05/2023 13:52, Jan Heckman ha scritto: > > Also out of curiosity, > > Are you willing to share the shapefile, preferably at least shp and dbf, > > but probably .shp alone will do and .prj helps for checking conversion > > results. > > Hi Jan, > the corrupted Shapefile layer is available in the QGIS issue report at > https://github.com/qgis/QGIS/issues/53058 > > Best regards. > > Andrea > _______________________________________________ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/gdal-dev >
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev