<div dir="ltr">Have to get back on this, I did not look well at the shapefile I generated (see last mail).<div>It is both better and worse. It has most of the missing objects, to my surprise, but appears to have some invalid coordinates</div><div>which show up as horizontal lines in the west part. Still it may help in reconstruction, I think.</div><div>Good luck,</div><div>Jan</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 17, 2023 at 12:39 PM Jan Heckman <<a href="mailto:jan.heckman@gmail.com">jan.heckman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>As noted in the <a href="https://github.com/qgis/QGIS/issues/53058" target="_blank">QGis issues</a>, the shx has problems that ogr2ogr (or QGis Repair Shapefile) will not fix;</div><div>The error I get in cmdline with SHAPE_RESTORE_SHX=YES is "ERROR 4: Error parsing .shp to restore .shx".</div><div>Long time ago I wrote my own version to recreate the .shx from the .shp,</div><div>and it does restore the .shx (leaving me to wonder whether my routine is really correct);</div><div>long story short, the repaired shapefile loads fine, but the shp does not contain the missing geometries anyway,</div><div>and the dbf doesn't have rows of missing objects (as shown in the QGis issue).</div><div><br></div><div>The missing objects are presumed lost, see issue.</div><div><br></div><div>Looking at the .idx file I surmise that it is a foxbase/foxpro index. Good (very) old dbase has .mdx and .ndx.</div><div>DBF index files are not part of the shapefile spec.</div><div>The layout of the file does not fully fit the few descriptions I have, but looks like btree record blocks with keys</div><div>that may address column H (soil erosion).</div><div>The presence of this 'foreign' (in the context of shapefiles) file made be think that perhaps the .dbf has been</div><div>modified using foxpro/foxbase, leading to an error when saving again in QGis.</div><div>Another bit of evidence for such a scenario is that the last row in the .dbf is garbled.</div><div>(check with LibreOffice Calc).</div><div><br></div><div>FWIW a <a href="https://www.dropbox.com/s/wj0loe0m7apuszz/test.zip?dl=0" target="_blank">link</a> to the worked shapefile.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 16, 2023 at 2:03 PM Andrea Giudiceandrea via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Il 16/05/2023 13:52, Jan Heckman ha scritto:<br>
> Also out of curiosity,<br>
> Are you willing to share the shapefile, preferably at least shp and dbf, <br>
> but probably .shp alone will do and .prj helps for checking conversion <br>
> results.<br>
<br>
Hi Jan,<br>
the corrupted Shapefile layer is available in the QGIS issue report at <br>
<a href="https://github.com/qgis/QGIS/issues/53058" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/issues/53058</a><br>
<br>
Best regards.<br>
<br>
Andrea<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>
</blockquote></div>