Opened 10 years ago

Closed 9 years ago

#2932 closed defect (wontfix)

ST_Area on sphere returns NaN

Reported by: Mike Taves Owned by: pramsey
Priority: medium Milestone: PostGIS 2.1.6
Component: liblwgeom Version: 2.1.x
Keywords: Cc:


While working on #2918, of the 500000 tests, 34 quadrilateral polygon tests return NaN from `ST_Area(geog, use_spheroid=false). For example:

SELECT ST_Area('POLYGON((0 78.703946026663,0 0,179.999997913235 -33.0888306884702,179.999997913235 0,0 78.703946026663))'::geography, false);

Which is really a non-sense polygon, but has an area result of NaN. The area under the WGS84 geodesic should be 127417658341994.233087 m², which I think is pretty close to ¼ the surface area of a sphere with WGS84_RADIUS (6371008.771415059833 m).

The problem is likely somewhere in lwgeom_area_sphere or related functions in lwgeodetic.c.

Change History (2)

comment:1 by pramsey, 10 years ago

Milestone: PostGIS 2.1.5PostGIS 2.1.6

comment:2 by pramsey, 9 years ago

Resolution: wontfix
Status: newclosed

Since this is an equator-crossing example, it's going to flip into a spherical mode anyways, so it won't be a WGS84 area. I'd like to just close this out and fix up 2.2 where we'll use some more robust spheroidal math.

Note: See TracTickets for help on using tickets.