pgsql2shp(1) | PostGIS | pgsql2shp(1) |
pgsql2shp - postgis to shapefile dumper
pgsql2shp [options] database
[schema.]table
pgsql2shp [options] database query
The pgsql2shp table dumper connects directly to the database and converts a table (possibly created by user query) into a shape file. It is compatible with all versions of PostGIS.
Version: 1.1.5 (2006/10/06)
The <database> is the name of the database to connect to.
The <table> is the (optionally schema-qualified) table to read spatial data from. Alternatively, you can specify a QUERY whose result will be written into the shapefile.
The commandline options are:
COLUMNNAME DBFFIELD1\n
AVERYLONGCOLUMNNAME DBFFIELD2\n
etc.
To compile the program from source, simply run "make" in the source directory. Then copy the binary in your shell search path (or wherever you like). This text is also available as a man page in the ../doc/man/ directory, ready for copying it into the manual search path on unixoid systems.
An example session using the dumper to create shape file from a database might look like this:
# pgsql2shp -f myfile -p 5555 my_db roads_table
Originally written by Jeff Lounsbury <jeffloun@refractions.net>. Improved and maintained by Sandro Santilli <strk@kbt.io>. Includes small contributions and improvements by others.
This application uses functionality from shapelib 1.2.9 by Frank Warmerdam <warmerda@gdal.velocet.ca> to write to ESRI Shape files.
More information is available at http://postgis.net