From: Paul Ramsey Date: Wed, 25 Apr 2012 18:49:42 +0000 (+0000) Subject: st_dwithin(geog, geog, 0) doesn't work (#1264) X-Git-Tag: 2.0.1~109 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c81fc4e16856b3ee50960acb256588eb6126792;p=postgis st_dwithin(geog, geog, 0) doesn't work (#1264) git-svn-id: http://svn.osgeo.org/postgis/trunk@9669 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/geography_measurement.c b/postgis/geography_measurement.c index a8b859cf2..467c5e845 100644 --- a/postgis/geography_measurement.c +++ b/postgis/geography_measurement.c @@ -156,7 +156,7 @@ Datum geography_dwithin(PG_FUNCTION_ARGS) PG_RETURN_BOOL(FALSE); } - PG_RETURN_BOOL(distance < tolerance); + PG_RETURN_BOOL(distance <= tolerance); } diff --git a/regress/tickets.sql b/regress/tickets.sql index ba9dd89c2..879e45f97 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -588,6 +588,9 @@ select '#1042',round((st_ymax(st_minimumboundingcircle('LINESTRING(-1 -1, 1 1)') -- #1170 -- SELECT '#1170', ST_Intersection( ST_GeogFromText( 'POINT(0 90)'), ST_GeogFromText( 'POINT(0 90)' ) ); +-- #1264 -- +SELECT '#1264', ST_DWithin('POLYGON((-10 -10, -10 10, 10 10, 10 -10, -10 -10))'::geography, 'POINT(0 0)'::geography, 0); + -- #1398 select '#1398a', st_astext(st_snaptogrid(st_project('POINT(-120 45)'::geography, 100000, radians(45))::geometry,0.000001)); select '#1398b', st_astext(st_snaptogrid(st_project('POINT(20 85)'::geography, 2000000, radians(0.1))::geometry,0.000001)); diff --git a/regress/tickets_expected b/regress/tickets_expected index 8b4e0615a..24060f7c8 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -194,6 +194,7 @@ ERROR: AddToPROJ4SRSCache: could not parse proj4 string '' #1038| #1042|2 #1170|0101000020E610000001000000000044C00000000000805640 +#1264|t #1398a|POINT(-119.093153 45.632669) #1398b|POINT(-160.137654 77.091608) #1543|MULTILINESTRING((0 0,10 0,10 10,0 0),(0 0))|POLYGON((0 0,10 10,10 0,0 0))