[postgis-users] shp2pgsql -G -r

Edward Mac Gillavry emacgillavry at hotmail.com
Wed Dec 5 01:03:33 PST 2012


Actually, the option "-r" specifies to run the command in "Raw mode", i.e. Do not unescape attribute names and not skip the 'gid' attribute. You should use the option "-s" instead and provide the EPSG code that indicates the projection of your data. For example: 

shp2pgsql -G -s 28992:4326 mystuff schema_name.table_name | psql -h myserver -d mydb -U myuser

Here, the projection is the of the data in mystuff.shp is indicated to be in the Amersfoort New projection, indicated by the EPSG string 28992. The EPSG string 4326 indicates the data is projected to WGS84.



> From: halset at pvv.ntnu.no
> Date: Wed, 5 Dec 2012 09:27:28 +0100
> To: postgis-users at postgis.refractions.net
> Subject: [postgis-users] shp2pgsql -G -r
> Hello.
> I am trying out PostGIS 2.0.1, shp2pgsql and the geometry type. However, the reproject-thing does not seem to work as expected. What am I doing wrong?
> $ shp2pgsql
> RELEASE: 2.0.1 (r9979)
> USAGE: shp2pgsql [<options>] <shapefile> [[<schema>.]<table>]
>>   -G  Use geography type (requires lon/lat data or -r to reproject).
> $ shp2pgsql -G -r mystuff.shp
> shp2pgsql: illegal option -- r
> Regards,
>  - Tore.
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20121205/e6d7edaf/attachment-0001.html>

More information about the postgis-users mailing list