I use postgresql 9.1, postgis 2.0.1. For importing the shapefiles to my database, I use shp2pgsql. I have tried many ways for importing theses shapefiles (shp2pgsql -I roads.shp public.roads | psql -d map), but the result is always:
Unable to open roads.shp or roads.SHP.
roads: dbf file (.dbf) can not be opened.
How do I solve this problem?
A "shapefile" is actually more than one file (i.e., more than just a .shp file). Make sure all of the files are in the same folder when using with any GIS software, including shp2pgsql.
The minimum required files, sharing a common prefix, are:
Other files may include: .prj, .sbn, .sbx, .fbn, .fbx, .ain, .aih, .ixs, .mxs, .atx, .shp.xml, and .cpg.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With