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?