]> granicus.if.org Git - postgis/commitdiff
Improve precision of point_in_ring. Fixes and regress-tests bug #845.
authorSandro Santilli <strk@keybit.net>
Thu, 24 Feb 2011 15:17:37 +0000 (15:17 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 24 Feb 2011 15:17:37 +0000 (15:17 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@6857 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_functions_analytic.c
regress/tickets.sql
regress/tickets_expected

index 8e0c5e01c5b65e7f0a80260d593cf0ebee56b3be..9fe0374929ab7cfc618072e7b68bb91346b0c73b 100644 (file)
@@ -1139,12 +1139,13 @@ int point_in_ring(POINTARRAY *pts, POINT2D *point)
                                return 0;
                        }
                }
+
                /*
                 * If the point is to the left of the line, and it's rising,
                 * then the line is to the right of the point and
                 * circling counter-clockwise, so incremement.
                 */
-               else if (FP_CONTAINS_BOTTOM(seg1.y,point->y,seg2.y) && side>0)
+               if (FP_CONTAINS_BOTTOM(seg1.y,point->y,seg2.y) && side>0)
                {
                        LWDEBUG(3, "incrementing winding number.");
 
index eba43322cd1499d0e43990152b654a238690f352..c9eef4d67827af05eef7fcb4b4d19439c724371e 100644 (file)
@@ -361,5 +361,9 @@ SELECT '#723',ST_Intersection(a.geog, b.geog) As result FROM (VALUES (ST_GeogFro
 -- #804
 SELECT '#804', ST_AsGML(3, 'SRID=4326;POINT(0 0)'::geometry, 0, 1);
 
+
+-- #845
+SELECT '#845', ST_Intersects('POINT(169.69960846592 -46.5061209281002)'::geometry, 'POLYGON((169.699607857174 -46.5061218662,169.699607857174 -46.5061195965597,169.699608806526 -46.5061195965597,169.699608806526 -46.5061218662,169.699607857174 -46.5061218662))'::geometry);
+
 -- Clean up
 DELETE FROM spatial_ref_sys;
index b2cceb69ada816832bf890512f9e117781d7802f..43a6066da1a66cd122bda5d526eb821e5cf593cc 100644 (file)
@@ -105,3 +105,4 @@ ERROR:  First argument must be a LINESTRING
 #723|0107000020E610000000000000
 #723|0101000020E61000007975D98DE33826C060FBFFFFFF7F4B40
 #804|<gml:Point srsName="urn:ogc:def:crs:EPSG::4326"><gml:pos srsDimension="2">0 0</gml:pos></gml:Point>
+#845|t