]> granicus.if.org Git - postgis/commitdiff
type correction in ST_BuildArea output. Add additional proto to ST_Area and correct...
authorRegina Obe <lr@pcorp.us>
Wed, 4 Nov 2009 11:57:06 +0000 (11:57 +0000)
committerRegina Obe <lr@pcorp.us>
Wed, 4 Nov 2009 11:57:06 +0000 (11:57 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4735 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference.xml

index 5b6ef5e7f90e2e17ae2d169284313dae6cab1527..b368575ed1db0f649e128d62a7c9018cf8c9232b 100644 (file)
@@ -8980,6 +8980,12 @@ FROM
                          <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>
@@ -8987,7 +8993,9 @@ FROM
 
                        <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>
@@ -9034,10 +9042,11 @@ SELECT ST_Area(the_geom) As sqft, ST_Area(ST_Transform(the_geom,26986)) As sqm
                        </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(
@@ -9047,9 +9056,9 @@ SELECT ST_Area(the_geog)/POWER(0.3048,2) As sqft, ST_Area(the_geog) As sqm
                        )
                )
        ) 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
@@ -12345,7 +12354,7 @@ MULTIPOLYGON(((-1 2,3 4,5 6,-1 2)),((-1 2,2 3,5 6,-1 2))) | POLYGON((-1 2,5 6,3
                  <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>