Opened 6 years ago
Closed 6 years ago
#7246 closed defect (fixed)
OpenFailed error gives advice that can't be followed in some contexts
Reported by: | sgillies | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | 1.11.3 |
Severity: | normal | Keywords: | shapefile shx |
Cc: |
Description
When calling OGROpen()
on a shapefile with no .shx, a user can see this error:
Unable to open myshapefile.shx or myshapefile.SHX.Try --config SHAPE_RESTORE_SHX true to restore or create it
The usage recommendation in this error message is relevant to ogrinfo and other command line programs but not to developers using the C API or their users. Instead, we should provide an error message with more generic config option usage.
Also reported at https://github.com/Toblerity/Fiona/issues/548. GDAL version is 1.11, but I think this comes straight from the shapefile driver, so newer versions may also be affected.
Pull request at https://github.com/OSGeo/gdal/pull/311.