[Qgis-developer] shx missing

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Fri Oct 7 10:43:22 EDT 2011


On Fri, Oct 7, 2011 at 12:58 PM, Paolo Cavallini <cavallini at faunalia.it> wrote:
> Hi all.
> If the .shx file is missing for a given .shp, qgis will correctly complain and will
> not load the shapefile. Apparently in other sw this issue is solved by rebuilding the
> shx[0] (it seems a common problem for CAD users, for instance[1]).
> Would it be feasible for qgis to have the same option? I do not think it is supported
> by OGR, so possibly it would be better to add it there?

 I dont think those are the same SHX files as the .shx components of
Shapefiles...

 A missing .shx file in a shapefile can't easily be reconstructed. The
.shp file is essentially just a big unstructured list of coordinates,
and the .shx gives the start and finish of each feature in that big
list (then the .dbf stores the attributes).

 For a points shapefile it might be easy, since each point is the same
size in the .shp file. But for lines/polygons you'd need to know where
to start each polygons' coordinates in the big .shp file.

Barry


More information about the Qgis-developer mailing list