[postgis-users] Polygon area in meters

Kemal Bayram kemal at cins.co.uk
Tue Feb 9 06:06:54 PST 2010


Thank you vincent,

I suspected there would be a solution in 1.5 but I'm trying to avoid doing
an upgrade since my pl/pgsql scripts always seem to break every time I do
(granted because of bugs/wrong assumptions in my code).

I will see if there I can get away with some projection, but I'ill probably
do the upgrade in the end since I generally prefer "clean" solutions.

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Picavet
Vincent
Sent: 09 February 2010 15:54
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Polygon area in meters

Hi,

> part de Kemal Bayram
> Envoyé : mardi 9 février 2010 14:40
> I'm current working with data in long/lat (wgs84) format and using 
> st_distance_spheroid to calculate the length of my linestrings in 
> meters.  I now need to calculate the area of my polygons and am 
> wondering what the easiest way of doing this would be?

You should really consider upgrade to the new PostGIS 1.5 and use the
geography datatype, which supports st_area natively. Some other functions
are supported as well using the very behaviour you propose.
Please see :
http://postgis.refractions.net/documentation/manual-1.5/ch04.html#PostGIS_Ge
ography
and :
http://postgis.refractions.net/documentation/manual-1.5/ch08.html#PostGIS_Ty
peFunctionMatrix

> I am thinking projecting the polygon with an equal area projection and 
> then using st_area on the result.  Anyone have any ideas on suitable 
> projections/SRIDS?

There is a _ST_BestSRID(Geography) but I think it is more for intern use by
other functions «magically» operating on geography type.

Good luck,
Vincent

_______________________________________________
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