[postgis-commits] svn - r2647 - trunk/lwgeom

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Fri Jul 6 09:44:23 PDT 2007


Author: pramsey
Date: 2007-07-06 09:44:21 -0700 (Fri, 06 Jul 2007)
New Revision: 2647

Modified:
   trunk/lwgeom/lwpostgis.sql.in
Log:
Added ST_DWithin SQL function


Modified: trunk/lwgeom/lwpostgis.sql.in
===================================================================
--- trunk/lwgeom/lwpostgis.sql.in	2007-07-04 17:12:05 UTC (rev 2646)
+++ trunk/lwgeom/lwpostgis.sql.in	2007-07-06 16:44:21 UTC (rev 2647)
@@ -1948,7 +1948,7 @@
 	LANGUAGE 'C' _IMMUTABLE_STRICT; -- WITH (iscachable,isstrict);
 
 -- Availability: 1.2.2
-CREATEFUNCTION ST_expand(box3d,float8)
+CREATEFUNCTION ST_Expand(box3d,float8)
 	RETURNS box3d
 	AS '@MODULE_FILENAME@', 'BOX3D_expand'
 	LANGUAGE 'C' _IMMUTABLE_STRICT; -- WITH (iscachable,isstrict);
@@ -4421,6 +4421,12 @@
     AS 'SELECT $1 && $2 AND _ST_Touches($1,$2)'
     LANGUAGE 'SQL' _IMMUTABLE; -- WITH (iscachable);
 
+-- Availability: 1.2.2
+CREATEFUNCTION ST_DWithin(geometry, geometry, float8)
+    RETURNS boolean
+    AS 'SELECT $1 && ST_Expand($2,$3) AND $2 && ST_Expand($1,$3) AND ST_Distance($1, $2) < $3'
+    LANGUAGE 'SQL' _IMMUTABLE; -- WITH (iscachable);
+
 -- Deprecation in 1.2.3
 CREATEFUNCTION intersects(geometry,geometry)
    RETURNS boolean



More information about the postgis-commits mailing list