<funcdef>float <function>ST_Area</function></funcdef>
<paramdef><type>geography </type><parameter>g1</parameter></paramdef>
</funcprototype>
+
+ <funcprototype>
+ <funcdef>float <function>ST_Area</function></funcdef>
+ <paramdef><type>geography </type><parameter>g1</parameter></paramdef>
+ <paramdef><type>boolean </type><parameter>use_spheroid</parameter></paramdef>
+ </funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection>
<para>Returns the area of the geometry if it is a polygon or
multi-polygon. Return the area measurement of an ST_Surface or
- ST_MultiSurface value. For geometry Area is in the units of the spatial reference system. For geography area is in square meters.</para>
+ ST_MultiSurface value. For geometry Area is in the units of the srid. For geography area is in square meters and defaults to measuring about the spheroid of the geography (currently only WGS84).
+ To measure around the faster but less accurate sphere -- ST_Area(geog,false).
+ </para>
<para><inlinemediaobject>
<imageobject>
</programlisting>
<para>Return area square feet and square meters using Geography data type. Note that we transform to our geometry to geography
- (before you can do that make sure your geometry is in WGS 84 long lat 4326). Geography always measures in meters. </para>
+ (before you can do that make sure your geometry is in WGS 84 long lat 4326). Geography always measures in meters.
+ This is just for demonstration to compare. Normally your table will be stored in geography data type already.</para>
<programlisting>
-SELECT ST_Area(the_geog)/POWER(0.3048,2) As sqft, ST_Area(the_geog) As sqm
+SELECT ST_Area(the_geog)/POWER(0.3048,2) As sqft_spheroid, ST_Area(the_geog,false)/POWER(0.3048,2) As sqft_sphere, ST_Area(the_geog) As sqm_spheroid
FROM (SELECT
geography(
ST_Transform(
)
)
) As foo(the_geog);
- sqft | sqm
-------------------+------------------
- 927.186481558707 | 86.1384427837078
+ sqft_spheroid | sqft_sphere | sqm_spheroid
+-----------------+------------------+------------------
+928.684405217197 | 927.186481558724 | 86.2776044452694
--if your data is in geography already
SELECT ST_Area(the_geog)/POWER(0.3048,2) As sqft, ST_Area(the_geog) As sqm
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>boolean <function>ST_BuildArea</function></funcdef>
+ <funcdef>geometry <function>ST_BuildArea</function></funcdef>
<paramdef><type>geometry </type> <parameter>A</parameter></paramdef>
</funcprototype>
</funcsynopsis>