Malcolm Tredinnick wrote:
> GIS guys, any particular reasons for the approach you took? -- laziness?
> economy? "it works, dammit!"? technical reason against the above?
>   
In PostGIS, the AddGeometryColumn() function needs to be run separately 
after the create table. It adds the geometry field to the table, adds 
its definition (projection, geometry type, dimensions) to the 
'geometry_columns' table, creates a number of constraints, etc.

Normal process for setting up a geometry table:
CREATE TABLE "mytable" (... every field /except/ geometry ones ...);
SELECT AddGeometryColumn("mytable", "mygeometryfield", 4326, "POLYGON", 2);
CREATE INDEX "mytable_mygeometryfield" ON "mytable" USING GIST 
("mygeometryfield" GIST_GEOMETRY_OPS);

Thats why it needed to be post_create. post_create allows you to "fix" 
anything you didn't like in a create as well or add special indexes or 
constraints.

Not saying adding goodies to CREATE TABLE is bad, just that it doesn't 
work everywhere.

Rob :)

-- 
One Track Mind Ltd.
PO Box 1604, Shortland St, Auckland, New Zealand
Phone +64-9-966 0433 Mobile +64-21-572 632
Web http://www.onetrackmind.co.nz 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to