ソースを参照

rtree bugfix

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@51676 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 13 年 前
コミット
6954cf51f2
3 ファイル変更3 行追加6 行削除
  1. 1 0
      lib/vector/rtree/index.c
  2. 2 2
      lib/vector/rtree/node.c
  3. 0 4
      lib/vector/rtree/split.h

+ 1 - 0
lib/vector/rtree/index.c

@@ -37,6 +37,7 @@ struct RTree *RTreeNewIndex(int fd, off_t rootpos, int ndims)
     struct RTree_Node *n;
     int i;
     
+    assert(ndims > 0);
     new_rtree = (struct RTree *)malloc(sizeof(struct RTree));
 
     new_rtree->fd = fd;

+ 2 - 2
lib/vector/rtree/node.c

@@ -65,7 +65,7 @@ void RTreeInitNode(struct RTree *t, struct RTree_Node *n, int type)
     n->level = -1;
 
     for (i = 0; i < MAXCARD; i++)
-	RTreeInitBranch[type](&(n->branch[i]), t);
+	RTreeInitBranch[type](t, &(n->branch[i]));
 }
 
 /* Make a new node and initialize to have all branch cells empty. */
@@ -461,7 +461,7 @@ static void RTreeRemoveBranches(struct RTree_Node *n, struct RTree_Branch *b,
 	    rdist[i].distance += delta * delta;
 	}
 
-	RTreeInitBranch[type](&(n->branch[i]));
+	RTreeInitBranch[type](t, &(n->branch[i]));
     }
 
     /* new branch */

+ 0 - 4
lib/vector/rtree/split.h

@@ -33,10 +33,6 @@ struct RTree_PartitionVars {
     RectReal area[2];
 };
 
-extern struct RTree_Branch BranchBuf[MAXCARD + 1];
-extern int BranchCount;
-extern struct RTree_Rect CoverSplit;
-extern RectReal CoverSplitArea;
 
 /* variables for finding a partition */
 extern struct RTree_PartitionVars Partitions[1];