[postgis-users] Copy and Geometries; missed box spatial type

Pritchard, MJ (Matt) M.J.Pritchard at rl.ac.uk
Wed Aug 18 04:48:04 PDT 2004


Greg,

"COPY" seems to be the way that pg_dump makes a backup of a table with a
geometry column, so I can't see a problem with this.

Try:
	pg_dump dbname -a -t table_with_geom_columns

(-a = data only, -t = table name)

I have tried loading data this way and it does work, as long as the
whitespace separating the fields is as expected by the COPY statement
...tabs by default. It also relies on the postgis functions & spatial ref
sys stuff being already there, but the full pg_dump (without the -t & -a
options) includes lines to set this up. But on its own, the "copy" method
should work for bulk loading spatial data into an existing table with
geometry column(s)

Matt

>The following is an undocumented way to get spatial datatypes into
>PostGIS:
>	copy surveys (id, boundary) from 'surveys.asc' null '\t';
>where surveys.asc contains:
>	1   SRID=4267;POLYGON((-78.625 49.0, -78.625 49.75, -78.125 49.75,
>-78.125 49.0, -78.625 49.0))
>
>My question is, are there any problems with this method?  Eg. any spatial
>column information not being set, etc...

-------------------------------------------
NERC Earth Observation Data Centre
Space Science & Technology Dept.
CCLRC Rutherford Appleton Laboratory
Chilton, Didcot OX11 0QX
01235 445645 (tel) / 445848 (fax)
http://www.neodc.rl.ac.uk/





More information about the postgis-users mailing list