TransWikia.com

PostGIS geography returns area < 0.0

Geographic Information Systems Asked on May 13, 2021

I am trying to convert a geometry column to a geography column and calculate the area using this query:

SELECT dccode,SUM(CAST(St_Area(geom::geography,true) AS NUMERIC)) as Area 
       FROM  schema.table   
       GROUP BY dccode

but I am getting a strange error:

...
NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY


ERROR:  lwgeom_area_spher(oid) returned area < 0.0
********** Error **********

ERROR: lwgeom_area_spher(oid) returned area < 0.0

I’ve run this query to verify that there is no invalid geometry:

select gid, dccode, st_isvalidreason(geom) from table.schema where st_isvalid(geom) = false;

but it doesn’t return anything. How can I isolate the geometry that is < 0.0?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP