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

Boyce, Greg GBoyce at NRCan.gc.ca
Wed Jul 21 11:57:44 PDT 2004


Two questions:

(1)
How to load a geometry (eg. Polygon) column while using the Copy command.
The only *documented* way is to use, eg:
	INSERT INTO SURVEYS (id, boundary) 
	VALUES (1, GeometryFromText ('POLYGON((-78.625 49.0, -78.625 49.75,
-78.125 49.75, 
		  -78.125 49.0, -78.625 49.0))', 4267);

I've copied a geometry table to a file, and looked at it, and reversed the
process.  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...


(2)
In PostGIS I miss the Box datatype that PostgreSQL has -- should I simply
use
a Polygon datatype (with 4-points) in PostGIS?

Is there any problem with populating this column from a polygon using eg.
"Envelope(Polygon)"?  (I seem to recall that the box3D function has a
problem with
dropping the SRID.)

Thanks,
G.Boyce
___________________________________________________

Regional Geophysics section    /   Section de la géophysique régionale
Geological Survey of Canada    /   Commission Géologique du Canada
Natural Resources Canada       /   Ressources naturelles Canada
Government of Canada           /   Gouvernement du Canada



More information about the postgis-users mailing list