[postgis-users] Adding an area column to a table

Bruce Rindahl rindahl at lrcwe.com
Sat Apr 5 07:00:41 PDT 2008


If you have a column called area and the geometry is in a column called
the_geom, then

UPDATE mytable SET area = area(the_geom)

will set the area in square map units.  A trigger function can also be
created so the area will automatically be computed whenever a record is
added or changed.

Bruce

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Marcus
C. England
Sent: Friday, April 04, 2008 6:01 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] Adding an area column to a table

Hi again,

As a follow-up to the last question, I would like to know - and please 
assume here my utmost stupidity as I have only recently come from the 
GUI world of ArcGIS - how do you add a column to a PostGIS layer that 
automatically calculates the area of each polygon feature in the layer?

Thanks in advance,

Marcus

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list