postgis/loader
Sandro Santilli 5487e7e639 shapelib put in sync with gdal cvs
git-svn-id: http://svn.osgeo.org/postgis/trunk@398 b70326c6-7e19-0410-871a-916f4a2858ee
2003-12-01 20:52:00 +00:00
..
.cvsignore more cvsignore 2003-11-12 20:59:06 +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 Set CFLAGS where useless CPPFLAGS were used before 2003-11-20 14:46:07 +00:00
pgsql2shp.c fixed bug in HexDecoder, made WKB parsing the default 2003-11-26 18:54:22 +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 added simple malloc wrapper 2003-12-01 14:27:58 +00:00
shpopen.c shapelib put in sync with gdal cvs 2003-12-01 20:52:00 +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