1pgsql2shp(1)                        PostGIS                       pgsql2shp(1)
2
3
4
5NAME
6       pgsql2shp - postgis to shapefile dumper
7
8
9SYNTAX
10       pgsql2shp [options] database [schema.]table
11       pgsql2shp [options] database query
12
13
14DESCRIPTION
15       The  pgsql2shp  table dumper connects directly to the database and con-
16       verts a table (possibly created by user query) into a shape file. It is
17       compatible with all versions of PostGIS.
18
19       Version: 1.1.5 (2006/10/06)
20
21
22USAGE
23       The <database> is the name of the database to connect to.
24
25       The  <table> is the (optionally schema-qualified) table to read spatial
26       data from. Alternatively, you can specify a QUERY whose result will  be
27       written into the shapefile.
28
29
30OPTIONS
31       The commandline options are:
32
33       -f <filename>
34              Write the output to a particular filename.
35
36       -h <host>
37              The database host to connect to.
38
39       -p <port>
40              The port to connect to on the database host.
41
42       -P <password>
43              The password to use when connecting to the database.
44
45       -u <user>
46              The username to use when connecting to the database.
47
48       -g <geometry column>
49              In the case of tables with multiple geometry columns, the geome-
50              try column to use when writing the shape file.
51
52       -b     Use a binary cursor. When used  on  pre-1.0.0  PostGIS  versions
53              this  will reduce the likelihood of coordinate drift due to con-
54              version to and from WKT format. Coordinate drifts will not occur
55              with  PostGIS  1.0.0  and  newer  versions.  It will be slightly
56              faster, but might fail if any  NON-geometry  column lacks a cast
57              to text.
58
59       -r     Raw mode. Do not drop the gid field, or escape column names.
60
61       -d     For  backward  compatibility:  write  a 3-dimensional shape file
62              when dumping from old (pre-1.0.0) postgis databases (the default
63              is  to  write a 2-dimensional shape file in that case). Starting
64              from postgis-1.0.0+, dimensions are fully encoded.
65
66       -k     Keep idendifiers case (don't uppercase field names).
67
68       -?     Display version and usage information.
69
70
71INSTALLATION
72       To compile the program from source, simply run  "make"  in  the  source
73       directory.  Then copy the binary in your shell search path (or wherever
74       you like). This text is also available as a man page in the ../doc/man/
75       directory,  ready for copying it into the manual search path on unixoid
76       systems.
77
78
79EXAMPLES
80       An example session using  the  dumper  to  create  shape  file  from  a
81       database might look like this:
82
83       # pgsql2shp -f myfile -p 5555 my_db roads_table
84
85
86AUTHORS
87       Originally   written   by  Jeff  Lounsbury  <jeffloun@refractions.net>.
88       Improved and  maintained  by  Sandro  Santilli  <strk@kbt.io>.
89       Includes small contributions and improvements by others.
90
91       This  application  uses  functionality  from  shapelib  1.2.9  by Frank
92       Warmerdam <warmerda@gdal.velocet.ca> to write to ESRI Shape files.
93
94
95SEE ALSO
96       shp2pgsql(1)
97
98       More information is available at http://postgis.net
99
100
101
102                                                                  pgsql2shp(1)
103