[postgis-users] ST_AREA(geom) returns incorrect area

Stephen Woodbridge stephenwoodbridge37 at gmail.com
Fri Jun 12 17:33:45 PDT 2020


ST_Area and ST_length are computed in units of the object. for WGS84 
that is degrees. If you want meters then cast the gem to a geography:

st_area(geom::geography)
st_length(geom::geography)

and for length you have other function that compute it in terms of spheriod.

-Steve

On 6/12/2020 7:30 PM, Clifford Snow wrote:
> When I run st_area(geom) against a geom in WGS84, my understanding is 
> that postgis returns the area in square meters. It's not. Instead it 
> returns something much smaller. The areas I'm interested in are small 
> bounding boxes so spherical measurements should be all that different.
>
> I verified that the table SRID is 4326. The boxes all display 
> correctly in both Pgadmin4 and QGIS.
>
> For example, a bbox around a house returns 9.84003999925341e-09. Yet 
> QGIS calculates it as 113.73 sqm. The QGIS calculation seems to be 
> more accurate.
>
> I know I'm doing something very wrong. Any help would be appreciated.
>
> Best,
> Clifford
>
> -- 
> @osm_washington
> www.snowandsnow.us <https://www.snowandsnow.us>
> OpenStreetMap: Maps with a human touch
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users



More information about the postgis-users mailing list