From: Sandro Santilli Date: Thu, 24 Feb 2011 15:17:37 +0000 (+0000) Subject: Improve precision of point_in_ring. Fixes and regress-tests bug #845. X-Git-Tag: 2.0.0alpha1~1943 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=02ca0487d2b57806c272a955f25497aa95b97908;p=postgis Improve precision of point_in_ring. Fixes and regress-tests bug #845. git-svn-id: http://svn.osgeo.org/postgis/trunk@6857 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_functions_analytic.c b/postgis/lwgeom_functions_analytic.c index 8e0c5e01c..9fe037492 100644 --- a/postgis/lwgeom_functions_analytic.c +++ b/postgis/lwgeom_functions_analytic.c @@ -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."); diff --git a/regress/tickets.sql b/regress/tickets.sql index eba43322c..c9eef4d67 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -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; diff --git a/regress/tickets_expected b/regress/tickets_expected index b2cceb69a..43a6066da 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -105,3 +105,4 @@ ERROR: First argument must be a LINESTRING #723|0107000020E610000000000000 #723|0101000020E61000007975D98DE33826C060FBFFFFFF7F4B40 #804|0 0 +#845|t