Bug report #15560
Missing Geometry in last row of some shapefile
|Affected QGIS version:||2.16.2||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||up/downstream|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||23483|
QGIS considers a null geometry for the last row of some shapefiles (generated by a 3rd party software, see sample in attachment), but is visible in the attribute table.
Other programs (ArcGIS, Openwind) read the shapefile correclty, so it can be assumed that it a QGIS issue.
#1 Updated by Jukka Rahkonen over 4 years ago
The error from GDAL is this:
ERROR 1: Error in fread() reading object of size 32 at offset 212 from .shp fileThe issue feels similar to https://trac.osgeo.org/gdal/ticket/4203 but that one is fixed. However, I believe that the 3rd party software makes invalid shapefiles. A workaround that probably works is to
- delete the .shx file
- re-create .shx with ogrinfo
ogrinfo test_layout.shp -al --config SHAPE_RESTORE_SHX true