Changeset: 597c7a9fe762 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=597c7a9fe762
Modified Files:
        geom/monetdb5/geom.mal
        geom/sql/40_geom.sql
Branch: geo
Log Message:

mbr functions added in 40_geom.sql and geom.mal


diffs (62 lines):

diff --git a/geom/monetdb5/geom.mal b/geom/monetdb5/geom.mal
--- a/geom/monetdb5/geom.mal
+++ b/geom/monetdb5/geom.mal
@@ -262,8 +262,32 @@ comment "Transforms a geometry from one 
 
 command mbr(:wkb) :mbr address wkbMBR
 comment "Creates the mbr for the given wkb.";
-command mbrOverlaps(a:mbr, b:mbr) :bit address mbrOverlaps
-comment "Returns true if the two mbrs overlap";
+command mbrOverlaps(box1:mbr, box2:mbr) :bit address mbrOverlaps
+comment "Returns true if box1 overlaps box2";
+command mbrOverlapOrLeft(box1:mbr, box2:mbr) :bit address mbrOverlapOrLeft
+comment "Returns true if box1 overlaps or is to the left of box2";
+command mbrOverlapOrBelow(box1:mbr, box2:mbr) :bit address mbrOverlapOrBelow
+comment "Returns true if box1 overlaps or is below box2";
+command mbrOverlapOrRight(box1:mbr, box2:mbr) :bit address mbrOverlapOrRight
+comment "Returns true if box1 overlalps or is right of box2";
+command mbrLeft(box1:mbr, box2:mbr) :bit address mbrLeft
+comment "Returns true if box1 is left of box2";
+command mbrBelow(box1:mbr, box2:mbr) :bit address mbrBelow
+comment "Returns true if box1 is below box2";
+command mbrEqual(box1:mbr, box2:mbr) :bit address mbrEqual
+comment "Returns true if box1 is the same as box2";
+command mbrRight(box1:mbr, box2:mbr) :bit address mbrRight
+comment "Returns true if box1 is right of box2";
+command mbrContained(box1:mbr, box2:mbr) :bit address mbrContained
+comment "Returns true if box1 is contained by box2";
+command mbrOverlapOrAbove(box1:mbr, box2:mbr) :bit address mbrOverlapOrAbove
+comment "Returns true if box1 overlaps or is above box2";
+command mbrAbove(box1:mbr, box2:mbr) :bit address mbrAbove
+comment "Returns true if box1 is above box2";
+command mbrContains(box1:mbr, box2:mbr) :bit address mbrContains
+comment "Returns true if box1 contains box2";
+command mbrDistance(box1:mbr, box2:mbr) :dbl address mbrDistance
+comment "Returns the distance of the centroids of the two boxes";
 command coordinateFromWKB(:wkb, :int) :dbl address wkbCoordinateFromWKB
 comment "returns xmin (=1), ymin (=2), xmax (=3) or ymax(=4) of the provided 
geometry";
 command coordinateFromMBR(:mbr, :int) :dbl address wkbCoordinateFromMBR
diff --git a/geom/sql/40_geom.sql b/geom/sql/40_geom.sql
--- a/geom/sql/40_geom.sql
+++ b/geom/sql/40_geom.sql
@@ -64,7 +64,19 @@ CREATE TYPE mbr EXTERNAL NAME mbr;
 -- as that returns Geometry objects, and we prefer the explicit mbr's
 -- minimum bounding rectangle (mbr)
 CREATE FUNCTION mbr(geom Geometry) RETURNS mbr external name geom."mbr";
-CREATE FUNCTION mbrOverlaps(box1 mbr, box2 mbr) RETURNS boolean external name 
geom."mbrOverlaps";
+CREATE FUNCTION mbrOverlap(box1 mbr, box2 mbr) RETURNS boolean external name 
geom."mbrOverlap";
+CREATE FUNCTION mbrOverlapOrLeft(box1 mbr, box2 mbr) RETURNS boolean external 
name geom."mbrOverlapOrLeft";
+CREATE FUNCTION mbrOverlapOrBelow(box1 mbr, box2 mbr) RETURNS boolean external 
name geom."mbrOverlapOrBelow";
+CREATE FUNCTION mbrOverlapOrRight(box1 mbr, box2 mbr) RETURNS boolean external 
name geom."mbrOverlapOrRight";
+CREATE FUNCTION mbrLeft(box1 mbr, box2 mbr) RETURNS boolean external name 
geom."mbrLeft";
+CREATE FUNCTION mbrBelow(box1 mbr, box2 mbr) RETURNS boolean external name 
geom."mbrBelow";
+CREATE FUNCTION mbrEqual(box1 mbr, box2 mbr) RETURNS boolean external name 
geom."mbrEqual";
+CREATE FUNCTION mbrRight(box1 mbr, box2 mbr) RETURNS boolean external name 
geom."mbrRight";
+CREATE FUNCTION mbrContained(box1 mbr, box2 mbr) RETURNS boolean external name 
geom."mbrContained";
+CREATE FUNCTION mbrOverlapOrAbove(box1 mbr, box2 mbr) RETURNS boolean external 
name geom."mbrOverlapOrAbove";
+CREATE FUNCTION mbrAbove(box1 mbr, box2 mbr) RETURNS boolean external name 
geom."mbrAbove";
+CREATE FUNCTION mbrContains(box1 mbr, box2 mbr) RETURNS boolean external name 
geom."mbrContains";
+CREATE FUNCTION mbrDistance(box1 mbr, box2 mbr) RETURNS double external name 
geom."mbrDistance";
 
 
 -------------------------------------------------------------------------
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to