Changeset: 5160a394ead4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5160a394ead4
Modified Files:
geom/monetdb5/geom.c
Branch: geo
Log Message:
bug fixed
diffs (61 lines):
diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -2832,6 +2832,7 @@ str wkbContainsFilter_bat(int* aBATfilte
bit outBIT;
BATiter aBAT_iter, bBAT_iter;
BUN i=0;
+ int remainingElements =0;
//get the descriptor of the BAT
if ((aBAT = BATdescriptor(*aBAT_id)) == NULL) {
@@ -2857,14 +2858,15 @@ str wkbContainsFilter_bat(int* aBATfilte
BBPreleaseref(bBAT->batCacheid);
throw(MAL, "batgeom.MBRfilter", MAL_MALLOC_FAIL);
}
- if ((bBATfiltered = BATnew(TYPE_void, ATOMindex("wkb"), BATcount(aBAT),
TRANSIENT)) == NULL) {
+ if ((bBATfiltered = BATnew(TYPE_void, ATOMindex("wkb"), BATcount(bBAT),
TRANSIENT)) == NULL) {
BBPreleaseref(aBAT->batCacheid);
BBPreleaseref(bBAT->batCacheid);
throw(MAL, "batgeom.MBRfilter", MAL_MALLOC_FAIL);
}
+
//set the first idx of the output BATs equal to that of the aBAT
BATseqbase(aBATfiltered, aBAT->hseqbase);
- BATseqbase(bBATfiltered, aBAT->hseqbase);
+ BATseqbase(bBATfiltered, bBAT->hseqbase);
//iterator over the BATs
aBAT_iter = bat_iterator(aBAT);
@@ -2874,7 +2876,7 @@ str wkbContainsFilter_bat(int* aBATfilte
str err = NULL;
aWKB = (wkb*) BUNtail(aBAT_iter, i + BUNfirst(aBAT));
bWKB = (wkb*) BUNtail(bBAT_iter, i + BUNfirst(bBAT));
-
+
//check the containment of the MBRs
if((err = mbrContains_wkb(&outBIT, &aWKB, &bWKB)) !=
MAL_SUCCEED) {
str msg;
@@ -2887,17 +2889,18 @@ str wkbContainsFilter_bat(int* aBATfilte
return msg;
}
if(outBIT) {
- BUNappend(aBATfiltered,&aWKB, TRUE); //add the result
to the aBAT
- BUNappend(bBATfiltered,&bWKB, TRUE); //add the result
to the bBAT
+ BUNappend(aBATfiltered,aWKB, TRUE); //add the result to
the aBAT
+ BUNappend(bBATfiltered,bWKB, TRUE); //add the result to
the bBAT
+ remainingElements++;
}
}
//set some properties of the new BATs
- BATsetcount(aBATfiltered, BATcount(aBAT));
+ BATsetcount(aBATfiltered, remainingElements);
BATsettrivprop(aBATfiltered);
BATderiveProps(aBATfiltered,FALSE);
- BATsetcount(bBATfiltered, BATcount(aBAT));
+ BATsetcount(bBATfiltered, remainingElements);
BATsettrivprop(bBATfiltered);
BATderiveProps(bBATfiltered,FALSE);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list