]> granicus.if.org Git - postgis/commitdiff
Change to GNU macro NAN. Still not feeling The Confidence.
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 3 Jan 2012 23:52:42 +0000 (23:52 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 3 Jan 2012 23:52:42 +0000 (23:52 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8667 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeodetic.c
liblwgeom/lwgeodetic.h
regress/tickets.sql
regress/tickets_expected

index db8172d9f2e8284a4378dd65a6ad8372206a0e1f..83d7db663a4588987679b49184fd029b2c568d9c 100644 (file)
@@ -1870,7 +1870,7 @@ double lwgeom_azumith_spheroid(const LWPOINT *r, const LWPOINT *s, const SPHEROI
        /* Same point, return NaN */
        if ( FP_EQUALS(x1, x2) && FP_EQUALS(y1, y2) )
        {
-               return nan("");
+               return NAN;
        }
        
        /* Do the direction calculation */
index aac492d94db61a5722583da9e3a93314fb6ffcc6..c68ee3936c810267e4deae5f973456f3e4be1025 100644 (file)
 
 #include "liblwgeom_internal.h"
 
+/* For NAN */
+#define _GNU_SOURCE
+#include <math.h>
+
+#ifndef NAN
+#define NAN 0.0/0.0
+#endif
+
 extern int gbox_geocentric_slow;
 
 #define POW2(x) ((x)*(x))
index 9cbbb3abc3e8662bca87dac8577037806d8ba405..f39a5a842b7be2d2bd0ec07fdc0a9fe7827661ef 100644 (file)
@@ -478,6 +478,7 @@ SELECT '#657.3',ST_DWithin(ST_Project('POINT(10 10)'::geography, 2000, pi()/2),
 SELECT '#1305.1',ST_AsText(ST_Project('POINT(10 10)'::geography, 0, 0));
 WITH pts AS ( SELECT 'POINT(0 45)'::geography AS s, 'POINT(45 45)'::geography AS e ) 
 SELECT '#1305.2',abs(ST_Distance(e, ST_Project(s, ST_Distance(s, e), ST_Azimuth(s, e)))) < 0.001 FROM pts;
+SELECT '#1305.3',ST_Azimuth('POINT(0 45)'::geography, 'POINT(0 45)'::geography) IS NULL;
 
 -- Clean up
 DELETE FROM spatial_ref_sys;
index 5938a0e344bd11d6207bc294e1355c7a9cfdc051..de8ef7fd06ad755ec1b1fb131e165aaa51ddbfd5 100644 (file)
@@ -148,3 +148,4 @@ ERROR:  Geometry type (Polygon) does not match column type (MultiPolygon)
 #657.3|t
 #1305.1|POINT(10 10)
 #1305.2|t
+#1305.3|t