I am trying to import a shapefile into PostGIS using the ogr2ogr tools that are built into the FWTools package. In my import process I am receiving an error that I don't know how to deal with.
ERROR 4: Unable to open city.shx or city.SHX.
FAILURE: Unable to open datasource `city.shp' with the following drivers.
My code is:
ogr2ogr -overwrite -f "PostgreSQL" PG:"host=myhost user=myuser dbname=mydb password=mypass" city.shp
I have confirmed that the shapefile does not have the associated SHX file, but now what? To make it worse, I have a whole lot of files to import that I assume will have the same issue because they also do not have an SHX. Any thoughts on how I can resolve this problem?
Best Answer
I just tested. Deleted the shx of a copy of a shape file and used this utility.
It worked a million! Try it.