The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

dtonnofer (12) [Avatar] Offline
#1
One should indicate that

"/path/to/tl_2012_us_state" used in the the shp2pgsql is a path root, not a file or directory

For example, after unpacking tl_2012_us_state.zip one finds, as indicated by the "file(1)" program:

tl_2012_us_state.dbf: DBase 3 data file (56 records)
tl_2012_us_state.prj: ASCII text, with no line terminators -- this indicates what projection is used
tl_2012_us_state.shp: ESRI Shapefile version 1000 length 6840758 type Polygon
tl_2012_us_state.shp.xml: XML document text -- metadata about this package
tl_2012_us_state.shx: ESRI Shapefile version 1000 length 274 type Polygon

Another example, after unpacking a national file from download.geofabrik.de one finds several thematic files.
For the waterways for example:

waterways.cpg: ASCII text --- this indicates what text encoding is used (here, UTF-smilie
waterways.dbf: DBase 3 data file (1494 records)
waterways.prj: ASCII text -- this indicates what projection is used
waterways.shp: ESRI Shapefile version 1000 length 401082 type PolyLine
waterways.shx: ESRI Shapefile version 1000 length 6026 type PolyLine

Here, the path root would be ""/path/to/waterways"