Changeset: 379916008131 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/379916008131
Modified Files:
        geom/monetdb5/geom.c
        geom/monetdb5/geom.h
        geom/monetdb5/geomBulk.c
        geom/sql/40_geom.sql
Branch: geo-update-dev
Log Message:

Added non-index version of st_intersects filter function.


diffs (64 lines):

diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -5518,6 +5518,9 @@ static mel_func geom_init_funcs[] = {
  command("geom", "Intersectsselect", wkbIntersectsSelectRTree, false, "TODO", 
args(1, 5, batarg("", oid), batarg("b", wkb), batarg("s", oid), arg("c", wkb), 
arg("anti",bit))),
  command("geom", "Intersectsjoin", wkbIntersectsJoinRTree, false, "TODO", 
args(2, 8, batarg("lr",oid),batarg("rr",oid), batarg("a", wkb), batarg("b", 
wkb), 
batarg("sl",oid),batarg("sr",oid),arg("nil_matches",bit),arg("estimate",lng))),
 
+ command("geom", "Intersects_noindex", wkbIntersects, false, "Returns true if 
these Geometries 'spatially intersect in 2D'", args(1,3, 
arg("",bit),arg("a",wkb),arg("b",wkb))),
+ command("geom", "Intersects_noindexselect", wkbIntersectsSelectNoIndex, 
false, "TODO", args(1, 5, batarg("", oid), batarg("b", wkb), batarg("s", oid), 
arg("c", wkb), arg("anti",bit))),
+ command("geom", "Intersects_noindexjoin", wkbIntersectsJoinNoIndex, false, 
"TODO", args(2, 8, batarg("lr",oid),batarg("rr",oid), batarg("a", wkb), 
batarg("b", wkb), 
batarg("sl",oid),batarg("sr",oid),arg("nil_matches",bit),arg("estimate",lng))),
 
  command("geom", "IntersectsMBR", mbrIntersects, false, "TODO", args(1,3, 
arg("",bit),arg("a",mbr),arg("b",mbr))),
 
diff --git a/geom/monetdb5/geom.h b/geom/monetdb5/geom.h
--- a/geom/monetdb5/geom.h
+++ b/geom/monetdb5/geom.h
@@ -217,6 +217,8 @@ geom_export str wkbCoordinateFromMBR_bat
 
 geom_export str geom_sql_upgrade(int);
 
+geom_export str wkbIntersectsJoinNoIndex(bat *lres_id, bat *rres_id, const bat 
*l_id, const bat *r_id, const bat *ls_id, const bat *rs_id, bit *nil_matches, 
lng *estimate);
+geom_export str wkbIntersectsSelectNoIndex(bat* outid, const bat *bid , const 
bat *sid, wkb **wkb_const, bit *anti);
 geom_export str wkbIntersectsJoinRTree(bat *lres_id, bat *rres_id, const bat 
*l_id, const bat *r_id, const bat *ls_id, const bat *rs_id, bit *nil_matches, 
lng *estimate);
 geom_export str wkbIntersectsSelectRTree(bat* outid, const bat *bid , const 
bat *sid, wkb **wkb_const, bit *anti);
 geom_export str mbrIntersects(bit* out, mbr** mbr1, mbr** mbr2);
diff --git a/geom/monetdb5/geomBulk.c b/geom/monetdb5/geomBulk.c
--- a/geom/monetdb5/geomBulk.c
+++ b/geom/monetdb5/geomBulk.c
@@ -213,9 +213,13 @@ wkbIntersectsSelectRTree(bat* outid, con
        return 
filterSelectRTree(outid,bid,sid,*wkb_const,*anti,GEOSIntersects,"geom.wkbIntersectsSelectRTree");
 }
 
+str
+wkbIntersectsSelectNoIndex(bat* outid, const bat *bid , const bat *sid, wkb 
**wkb_const, bit *anti) {
+       return 
filterSelectNoIndex(outid,bid,sid,*wkb_const,*anti,GEOSIntersects,"geom.wkbIntersectsSelectNoIndex");
 }
 
 static str
+filterJoinNoIndex(bat *lres_id, bat *rres_id, const bat *l_id, const bat 
*r_id, double double_flag, const bat *ls_id, const bat *rs_id, bit nil_matches, 
lng *estimate, char (*func) (const GEOSGeometry *, const GEOSGeometry *), const 
char *name)
 {
        (void) double_flag;
        BAT *lres = NULL, *rres = NULL, *l = NULL, *r = NULL, *ls = NULL, *rs = 
NULL;
@@ -385,6 +389,10 @@ wkbIntersectsJoinRTree(bat *lres_id, bat
        return 
filterJoinRTree(lres_id,rres_id,l_id,r_id,0,ls_id,rs_id,*nil_matches,estimate,GEOSIntersects,"geom.wkbIntersectsJoinRTree");
 }
 
+str
+wkbIntersectsJoinNoIndex(bat *lres_id, bat *rres_id, const bat *l_id, const 
bat *r_id, const bat *ls_id, const bat *rs_id, bit *nil_matches, lng *estimate) 
{
+       return 
filterJoinNoIndex(lres_id,rres_id,l_id,r_id,0,ls_id,rs_id,*nil_matches,estimate,GEOSIntersects,"geom.wkbIntersectsJoinNoIndex");
+}
 
 /* mbr bulk function */
 /* Creates the BAT with mbrs from the BAT with geometries. */
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
@@ -21,6 +21,7 @@ CREATE FILTER FUNCTION ST_IntersectsGeog
 
 CREATE FUNCTION ST_IntersectsMBR(mbr1 mbr, mbr2 mbr) RETURNS bool EXTERNAL 
NAME geom."IntersectsMBR";
 CREATE FILTER FUNCTION ST_Intersects(geom1 Geometry, geom2 Geometry) EXTERNAL 
NAME geom."Intersects";
+CREATE FILTER FUNCTION ST_Intersects_NoIndex(geom1 Geometry, geom2 Geometry) 
EXTERNAL NAME geom."Intersects_noindex";
 -------------------------------------------------------------------------
 ------------------------- Geography functions ---------------------------
 -------------------------------------------------------------------------
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to