[postgis-users] shp2pgsql
Steffen Macke
sdteffen at gmail.com
Tue Sep 23 10:56:30 PDT 2008
Hi,
> i'm trying to use shp2pgsql. i use help command to see syntax but i have a
> question. i hope you can help me :-D. Here's the syntax
If you have problems to figure out the shp2pgsql syntax, you could try
gshp2pgsql. It's a gui that allows you to operate shp2pgsql. It displays the
full shp2pgsql commandline, so you can use the GUI to "learn" shp2pgsql.
http://sdteffen.de/gis/gshp2pgsql.html
That said, let's try to answer your question:
shp2pgsql only creates SQL code. It does not actually connect to a PostgreSQL
database. Instead you can use e.g. psql to load the SQL statements. If
you are familiar
with pipes, you could pipe the shp2pgsql output to psql. If not, it
might be easier for you
to redirect the shp2psql output to a file (e.g. test.sql) and then
load this file using
psql.
The PostGIS manual has an example that illustrates the use of shp2psql and psql.
It also contains descriptions of the shp2pgsql options:
http://postgis.refractions.net/documentation/manual-1.3/ch04.html#id2868133
Regards,
Steffen
More information about the postgis-users
mailing list