[postgis-users] Another few questions

Paul Tomblin ptomblin at xcski.com
Sun Mar 30 10:41:01 PDT 2008

Sorry to start bugging everybody like this, but the manual is pretty horrible 
if you're trying to handroll stuff from scratch.  Keep in mind I'm not trying 
to display this data in some pre-existing program, just do a bunch of spatial 
queries on point, line and polygon data.

1. I'm trying to do geographic (lat/long) projections.  How do I define a 
polygon that encompasses the whole world?  I've added a column to one of my 
tables using:
	select addgeometrycolumn('areaids','rectangle',4326,'POLYGON',2);
but when I try to add a world encompassing polygon using:
	insert into areaids values (nextval('areaids_pk_seq'), null, null, 0, 
geomfromtext('POLYGON((-180 -90, 180 -90, 180 90, -180 90, -180 -90))'));
I get:
	ERROR:  new row for relation "areaids" violates check constraint 

2. The documentation never mentions geographic projections except in the 
section about ST_Distance_Sphere.  Do I enter them as latitude longitude or 
longitude latitude?  Also, is East or West positive?

3. Is there any way to get the corners of a polygon or its bounding box out as 
separate points?

4. Is there a perl library that will parse WKT or WKB?

Paul Tomblin <ptomblin at xcski.com> http://blog.xcski.com/
Company slogan:  The Mandatory Beatings Will Continue Until Morale

More information about the postgis-users mailing list