Changes between Version 1 and Version 2 of CookBook pgsql2shp


Ignore:
Timestamp:
Jun 10, 2010 1:02:54 PM (15 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CookBook pgsql2shp

    v1 v2  
    33As the rgdal driver fails to load posgres and the solution from roger Bivand does not seem to work we have to find a way to use shape files in postgres 
    44 
     5{{{ 
     6C:\"Program Files"\PostgreSQL\8.4\bin\pgsql2shp --help 
     7}}} 
     8 
     9{{{ 
     10RCSID: $Id: pgsql2shp.c 4914 2009-11-27 18:12:43Z pramsey $ RELEASE: 1.4 USE_GEO 
     11S=1 USE_PROJ=1 USE_STATS=1 
     12USAGE: C:\Program Files\PostgreSQL\8.4\bin\pgsql2shp [<options>] <database> [<sc 
     13hema>.]<table> 
     14       C:\Program Files\PostgreSQL\8.4\bin\pgsql2shp [<options>] <database> <que 
     15ry> 
     16 
     17OPTIONS: 
     18  -f <filename>  Use this option to specify the name of the file 
     19     to create. 
     20  -h <host>  Allows you to specify connection to a database on a 
     21     machine other than the default. 
     22  -p <port>  Allows you to specify a database port other than the default. 
     23  -P <password>  Connect to the database with the specified password. 
     24  -u <user>  Connect to the database as the specified user. 
     25  -g <geometry_column> Specify the geometry column to be exported. 
     26  -b Use a binary cursor. 
     27  -r Raw mode. Do not assume table has been created by 
     28     the loader. This would not unescape attribute names 
     29     and will not skip the 'gid' attribute. 
     30  -k Keep postgresql identifiers case. 
     31  -? Display this help screen. 
     32}}} 
     33== ccm21.riversegments_bretagne == 
     34{{{ 
     35C:\"Program Files"\PostgreSQL\8.4\bin\pgsql2shp -f "C:\Documents and Settings\cedric\Mes documents\Migrateur\eda\exports_shape\riversegments_bretagne" -p 5433 -u postgres -P postgres -g the_geom eda2.0 ccm21.riversegments_bretagne 
     36}}} 
     37== ccm21.catchments_bretagne == 
     38{{{ 
     39C:\"Program Files"\PostgreSQL\8.4\bin\pgsql2shp -f "C:\Documents and Settings\cedric\Mes documents\Migrateur\eda\exports_shape\catchments_bretagne" -p 5433 -u postgres -P postgres -g the_geom eda2.0 ccm21.catchments_bretagne 
     40}}} 
     41== clc.clipped_bretagne1== 
     42{{{ 
     43C:\"Program Files"\PostgreSQL\8.4\bin\pgsql2shp -f "C:\Documents and Settings\cedric\Mes documents\Migrateur\eda\exports_shape\clipped_bretagne1" -p 5433 -u postgres -P postgres -g the_geom eda2.0 clc.clipped_bretagne1 
     44}}} 
     45== riversegments_france == 
     46A query selecting a reduced area 
     47{{{ 
     48C:\"Program Files"\PostgreSQL\8.4\bin\pgsql2shp -f "C:\Documents and Settings\cedric\Mes documents\Migrateur\eda\exports_shape\riversegments_france" -p 5433 -u postgres -P postgres -g the_geom eda2.0 "select * from ccm21.riversegments where wso_id in (select wso_id from france.wso where area='France');" 
     49}}}