[GRASS-SVN] r46899 - grass/trunk/lib/vector/rtree

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 1 04:53:00 EDT 2011


Author: mmetz
Date: 2011-07-01 01:53:00 -0700 (Fri, 01 Jul 2011)
New Revision: 46899

Modified:
   grass/trunk/lib/vector/rtree/index.c
   grass/trunk/lib/vector/rtree/index.h
   grass/trunk/lib/vector/rtree/indexf.c
   grass/trunk/lib/vector/rtree/indexm.c
   grass/trunk/lib/vector/rtree/node.c
Log:
remove bounding boxes from vector topology (Radim's TODO): update rtree

Modified: grass/trunk/lib/vector/rtree/index.c
===================================================================
--- grass/trunk/lib/vector/rtree/index.c	2011-07-01 08:52:08 UTC (rev 46898)
+++ grass/trunk/lib/vector/rtree/index.c	2011-07-01 08:53:00 UTC (rev 46899)
@@ -132,6 +132,8 @@
 	RTreeDestroyNode(t->root, t->root->level ? t->nodecard : t->leafcard);
 
     free(t);
+    
+    return;
 }
 
 /*

Modified: grass/trunk/lib/vector/rtree/index.h
===================================================================
--- grass/trunk/lib/vector/rtree/index.h	2011-07-01 08:52:08 UTC (rev 46898)
+++ grass/trunk/lib/vector/rtree/index.h	2011-07-01 08:53:00 UTC (rev 46899)
@@ -46,10 +46,10 @@
  * this is LFS dependent, not good
  * on 32 bit without LFS this is 9.69
  * on 32 bit with LFS and on 64 bit this is 9 */
-#define MAXCARD 18
+#define MAXCARD 9
 
 /* R*-tree: number of branches to be force-reinserted when adding a branch */
-#define FORCECARD 2
+#define FORCECARD 3
 
 /* maximum no of levels = tree depth */
 #define MAXLEVEL 20        /* 8^MAXLEVEL items are guaranteed to fit into the tree */
@@ -90,7 +90,7 @@
  * It can terminate the search early by returning 0 in which case
  * the search will return the number of hits found up to that point.
  */
-typedef int SearchHitCallback(int id, void *arg);
+typedef int SearchHitCallback(int id, struct Rect rect, void *arg);
 
 struct RTree;
 

Modified: grass/trunk/lib/vector/rtree/indexf.c
===================================================================
--- grass/trunk/lib/vector/rtree/indexf.c	2011-07-01 08:52:08 UTC (rev 46898)
+++ grass/trunk/lib/vector/rtree/indexf.c	2011-07-01 08:53:00 UTC (rev 46899)
@@ -91,7 +91,8 @@
 		    RTreeOverlap(r, &(s[top].sn.branch[i].rect), t)) {
 		    hitCount++;
 		    if (shcb) {	/* call the user-provided callback */
-			if (!shcb(s[top].sn.branch[i].child.id, cbarg)) {
+			if (!shcb(s[top].sn.branch[i].child.id,
+			          s[top].sn.branch[i].rect, cbarg)) {
 			    /* callback wants to terminate search early */
 			    return hitCount;
 			}

Modified: grass/trunk/lib/vector/rtree/indexm.c
===================================================================
--- grass/trunk/lib/vector/rtree/indexm.c	2011-07-01 08:52:08 UTC (rev 46898)
+++ grass/trunk/lib/vector/rtree/indexm.c	2011-07-01 08:53:00 UTC (rev 46899)
@@ -83,7 +83,8 @@
 		    RTreeOverlap(r, &(s[top].sn->branch[i].rect), t)) {
 		    hitCount++;
 		    if (shcb) {	/* call the user-provided callback */
-			if (!shcb(s[top].sn->branch[i].child.id, cbarg)) {
+			if (!shcb(s[top].sn->branch[i].child.id,
+			          s[top].sn->branch[i].rect, cbarg)) {
 			    /* callback wants to terminate search early */
 			    return hitCount;
 			}

Modified: grass/trunk/lib/vector/rtree/node.c
===================================================================
--- grass/trunk/lib/vector/rtree/node.c	2011-07-01 08:52:08 UTC (rev 46898)
+++ grass/trunk/lib/vector/rtree/node.c	2011-07-01 08:53:00 UTC (rev 46899)
@@ -263,6 +263,8 @@
 
     /* Free this node */
     RTreeFreeNode(n);
+    
+    return;
 }
 
 /****************************************************************



More information about the grass-commit mailing list