From: Kevin Neufeld Date: Wed, 9 Dec 2009 17:12:52 +0000 (+0000) Subject: updated "Using the Loader" to demonstrate the use of the available options X-Git-Tag: 1.5.0b1~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c6ee15f69805619cb6e58f1a6f3b60c270b7b54;p=postgis updated "Using the Loader" to demonstrate the use of the available options git-svn-id: http://svn.osgeo.org/postgis/trunk@4994 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/using_postgis_dataman.xml b/doc/using_postgis_dataman.xml index 883264640..dd4c3e9cd 100644 --- a/doc/using_postgis_dataman.xml +++ b/doc/using_postgis_dataman.xml @@ -1510,137 +1510,153 @@ COMMIT; psql -d [database] -f roads.sql - - Using the Loader - - The shp2pgsql data loader converts ESRI Shape - files into SQL suitable for insertion into a PostGIS/PostgreSQL - database. The loader has several operating modes distinguished by - command line flags: - - - - -d - - - Drops the database table before creating a new table with - the data in the Shape file. - - - - - -a - - - Appends data from the Shape file into the database table. - Note that to use this option to load multiple files, the files - must have the same attributes and same data types. - - - - - -c - - - Creates a new table and populates it from the Shape file. - This is the default mode. - - - - - -p - - - Only produces the table creation SQL code, without adding - any actual data. This can be used if you need to completely - separate the table creation and data loading steps. - - - - - -D - - - Use the PostgreSQL "dump" format for the output data. This - can be combined with -a, -c and -d. It is much faster to load than - the default "insert" SQL format. Use this for very large data - sets. - - - - - -s <SRID> - - - Creates and populates the geometry tables with the specified - SRID. - - - - - -k - - - Keep identifiers' case (column, schema and attributes). Note - that attributes in Shapefile are all UPPERCASE. - - - - - -i - - - Coerce all integers to standard 32-bit integers, do not - create 64-bit bigints, even if the DBF header signature appears to - warrant it. - - - - - -I - - - Create a GiST index on the geometry column. - - - - - -w - - - Output WKT format, for use with older (0.x) versions of - PostGIS. Note that this will introduce coordinate drifts and will - drop M values from shapefiles. - - - - - -W <encoding> - - - Specify encoding of the input data (dbf file). When used, - all attributes of the dbf are converted from the specified - encoding to UTF8. The resulting SQL output will contain a - SET CLIENT_ENCODING to UTF8 command, so that the - backend will be able to reconvert from UTF8 to whatever encoding - the database is configured to use internally. - - - - - Note that -a, -c, -d and -p are mutually exclusive. - - An example session using the loader to create an input file and - uploading it might look like this: - - # shp2pgsql shaperoads myschema.roadstable > roads.sql + + Using the Loader + + + The shp2pgsql data loader converts ESRI Shape files into SQL suitable for + insertion into a PostGIS/PostgreSQL database. The loader has several operating modes + distinguished by command line flags: + + + + + (c|a|d|p) These are mutually exclusive options: + + + + + -c + + + Creates a new table and populates it from the shapefile. This is the + default mode. + + + + + + -a + + + Appends data from the Shape file into the database table. Note that to use this + option to load multiple files, the files must have the same attributes and same + data types. + + + + + + -d + + + Drops the database table before creating a new table with the data in the Shape + file. + + + + + + -p + + + Only produces the table creation SQL code, without adding any actual data. This + can be used if you need to completely separate the table creation and data loading + steps. + + + + + + + + + + -D + + + Use the PostgreSQL "dump" format for the output data. This can be combined with -a, -c and + -d. It is much faster to load than the default "insert" SQL format. Use this for very + large data sets. + + + + + + -s <SRID> + + + Creates and populates the geometry tables with the specified SRID. + + + + + + -k + + + Keep identifiers' case (column, schema and attributes). Note that attributes in Shapefile + are all UPPERCASE. + + + + + + -i + + + Coerce all integers to standard 32-bit integers, do not create 64-bit bigints, even if the + DBF header signature appears to warrant it. + + + + + + -I + + + Create a GiST index on the geometry column. + + + + + + -w + + + Output WKT format, for use with older (0.x) versions of PostGIS. Note that this will + introduce coordinate drifts and will drop M values from shapefiles. + + + + + + -W <encoding> + + + Specify encoding of the input data (dbf file). When used, all attributes of the dbf are + converted from the specified encoding to UTF8. The resulting SQL output will contain a + SET CLIENT_ENCODING to UTF8 command, so that the backend will be able to + reconvert from UTF8 to whatever encoding the database is configured to use internally. + + + + + + + An example session using the loader to create an input file and uploading it might look like + this: + + + # shp2pgsql -c -D -s 4269 -i -I shaperoads.shp myschema.roadstable > roads.sql # psql -d roadsdb -f roads.sql - A conversion and upload can be done all in one step using UNIX - pipes: + + A conversion and upload can be done all in one step using UNIX pipes: + - # shp2pgsql shaperoads myschema.roadstable | psql -d roadsdb - + # shp2pgsql shaperoads.shp myschema.roadstable | psql -d roadsdb +