[postgis-tickets] [PostGIS] #2932: ST_Area on sphere returns NaN

PostGIS trac at osgeo.org
Tue Sep 16 18:57:09 PDT 2014


#2932: ST_Area on sphere returns NaN
-----------------------+----------------------------------------------------
 Reporter:  mwtoews    |       Owner:  pramsey      
     Type:  defect     |      Status:  new          
 Priority:  medium     |   Milestone:  PostGIS 2.1.5
Component:  liblwgeom  |     Version:  2.1.x        
 Keywords:             |  
-----------------------+----------------------------------------------------
 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 [http://www.gcmap.com/mapui?P=78.703946026663N+0E-
 0N+0E-33.0888306884702S+179.999997913235E-
 0N+179.999997913235E-78.703946026663N+0E&MS=wls&DU=km 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 1/4
 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`.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2932>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list