I want to import a shapefile using shp2pgsql. I am using Mac with Postgis 2.2.
Based on this reference: A conversion and upload can be done all in one step using a UNIX pipe:
shp2pgsql -s -c -D -I | \
psql -d -h -U
An example provided in the postgis manual is:
# shp2pgsql shaperoads myschema.roadstable | psql -d roadsdb
Not sure how to find "schema.table". I am working on a shapefile folder which has:
l_2015_us_county yan$ ls
tl_2015_us_county.cpg tl_2015_us_county.prj tl_2015_us_county.shp.ea.iso.xml tl_2015_us_county.shp.xml
tl_2015_us_county.dbf tl_2015_us_county.shp tl_2015_us_county.shp.iso.xml tl_2015_us_county.shx
What is the schema and table in this shapefile?
Answer
The schema and table are part of the destination, not the input shapefile. The default schema is public
, so try something like public.awesometable
.
No comments:
Post a Comment