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

Clifford Snow clifford at snowandsnow.us
Fri Jun 12 19:20:06 PDT 2020


Steve,
Thanks - that's the problem, I forgot about geography. Once cast as a
geography the values are accurate.

Clifford

On Fri, Jun 12, 2020 at 5:33 PM Stephen Woodbridge <
stephenwoodbridge37 at gmail.com> wrote:

> 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
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users



-- 
@osm_washington
www.snowandsnow.us
OpenStreetMap: Maps with a human touch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200612/cfae8b45/attachment.html>


More information about the postgis-users mailing list