Przeglądaj źródła

cosmetics for t->ndims < NUMDIMS

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44953 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 14 lat temu
rodzic
commit
df825f1363
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      lib/vector/rtree/rect.c

+ 8 - 0
lib/vector/rtree/rect.c

@@ -337,6 +337,14 @@ struct Rect RTreeCombineRect(struct Rect *r, struct Rect *rr, struct RTree *t)
 	j = i + NUMDIMS;
 	new_rect.boundary[j] = MAX(r->boundary[j], rr->boundary[j]);
     }
+
+    /* set remaining boundaries to zero */
+    for (; i < NUMDIMS; i++) {
+	new_rect.boundary[i] = MIN(r->boundary[i], rr->boundary[i]);
+	j = i + NUMDIMS;
+	new_rect.boundary[j] = MAX(r->boundary[j], rr->boundary[j]);
+    }
+
     return new_rect;
 }