From: Regina Obe Date: Wed, 4 Nov 2009 11:57:06 +0000 (+0000) Subject: type correction in ST_BuildArea output. Add additional proto to ST_Area and correct... X-Git-Tag: 1.5.0b1~298 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35c2df329383e6f39cd8d237bffffa3ba3cc68c3;p=postgis type correction in ST_BuildArea output. Add additional proto to ST_Area and correct the example to show the new spheroid measurement default git-svn-id: http://svn.osgeo.org/postgis/trunk@4735 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference.xml b/doc/reference.xml index 5b6ef5e7f..b368575ed 100644 --- a/doc/reference.xml +++ b/doc/reference.xml @@ -8980,6 +8980,12 @@ FROM float ST_Area geography g1 + + + float ST_Area + geography g1 + boolean use_spheroid + @@ -8987,7 +8993,9 @@ FROM 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. + 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). + @@ -9034,10 +9042,11 @@ SELECT ST_Area(the_geom) As sqft, ST_Area(ST_Transform(the_geom,26986)) As sqm 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. + (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. -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 - boolean ST_BuildArea + geometry ST_BuildArea geometry A