postgis/loader
Sandro Santilli daba9669b3 hole-in-ring detector made more readable
git-svn-id: http://svn.osgeo.org/postgis/trunk@1537 b70326c6-7e19-0410-871a-916f4a2858ee
2005-03-15 12:24:40 +00:00
..
.cvsignore more cvsignore 2003-11-12 20:59:06 +00:00
compat.h Added a copy of the PQunescapeBytea function found in libpq of PG>=73 2004-11-18 18:14:19 +00:00
dbfopen.c shapelib put in sync with gdal cvs 2003-12-01 20:52:00 +00:00
getopt.c - cleaned up all the compiler warnings 2002-10-17 16:45:04 +00:00
getopt.h Standard GNU option handling. 2001-10-22 20:13:29 +00:00
Makefile Added -Wall to CFLAGS 2005-02-10 16:34:26 +00:00
pgsql2shp.c modernized old-style parameter declarations 2005-03-08 11:06:33 +00:00
PQunescapeBytea.c Added a copy of the PQunescapeBytea function found in libpq of PG>=73 2004-11-18 18:14:19 +00:00
README.pgsql2shp Update shapelib references to 1.2.9. 2002-05-04 22:44:04 +00:00
README.shp2pgsql Update shapelib references to 1.2.9. 2002-05-04 22:44:04 +00:00
shapefil.h shapelib put in sync with gdal cvs 2003-12-01 20:52:00 +00:00
shp2pgsql.c hole-in-ring detector made more readable 2005-03-15 12:24:40 +00:00
shpopen.c shapelib put in sync with gdal cvs 2003-12-01 20:52:00 +00:00
TODO updated 2004-11-18 18:16:11 +00:00
wkb.h Some more changes, now useless since wkb.h is no more used (just to get in sync) 2003-11-28 11:28:03 +00:00

shp2pgsql - Convert Shape file to PostGIS
~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

VERSION: 0.7 (2002/05/04)

MORE INFORMATION: http://postgis.refractions.net

INTRODUCTION:
This program takes in ESRI shape files and output formatted text suitable
for uploading to the PostGIS/PostgreSQL spatial database using the psql
terminal monitor.

This application uses functionality from shapelib 1.2.9
by Frank Warmerdam <warmerda@gdal.velocet.ca> to read from ESRI
Shape files.


INSTALLATION:

To build shp2pgsql just run 'make'.
Copy the binary wherever you like. :)


USAGE:

shp2pgsql [<options>] <shapefile> <tablename> <database name>

The <shapefile> is the name of the shape file, without any extension
information. For example, 'roads' would be the name of the shapefile 
comprising the 'roads.shp', 'roads.shx', and 'roads.dbf' files.

The <tablename> is the name of the database table you want the data stored
in in the database. Within that table, the geometry will be placed in 
the 'geo_value' column by default.

The <database name> is the name of the database you are going to put the
the data into.

The options are as follows:

(-a || -c || -d) these options are mutually exclusive.

  -a    Append mode. Do not delete the target table or try to create
        a new table, simple insert the data into the existing table.
        A table will have to exist for this to work, it is usually
        used after a create mode as been run once.(mutually exclusive
	with -c and -d)
  -c    Create mode. This is the default mode is no other is specified.
	Create a new table and upload the data into that table.
	(mutually exclusive with -a and -d)
  -d    Delete mode. Delete the database table named <tablename>, then
	create a new one with that name before uploading the data into
	the new empty database table.(mutually exclusive with -a and -c)

  -D Dump. When inserting the data into the table use 'dump' format.
	Dump format is used by PostgreSQL for large data dumps and 
	uploads. Use this mode if your upload dataset is very large.
	(you may still specify -a,-c or -d in conjunction with -D)


EXAMPLES:

Loading directly:

  shp2pgsql -c roads1 roads_table my_db | psql -d my_db
  shp2pgsql -a roads2 roads_table my_db | psql -d my_db

Saving to an intermiate file using the 'dump' format:

  shp2pgsql -D roads1 roads_table my_db > roads.sql
  psql -d my_db -f roads.sql