浏览代码

Vlib: open old sidx in file mode

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54012 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 年之前
父节点
当前提交
04376eceaf
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      lib/vector/Vlib/open.c

+ 8 - 0
lib/vector/Vlib/open.c

@@ -1056,6 +1056,14 @@ int Vect_open_sidx(struct Map_info *Map, int mode)
         /* initialize spatial index */
         Plus->Spidx_new = FALSE;
 
+	if (mode == 0) {
+            /* free old indices */
+            dig_spidx_free(Plus);
+            /* initialize file based indices */
+            Plus->Spidx_file = 1;
+            dig_spidx_init(Plus);
+	}
+
         /* load head */
         if (dig_Rd_spidx_head(&(Plus->spidx_fp), Plus) == -1) {
             fclose(Plus->spidx_fp.file);