Browse Source

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 years ago
parent
commit
04376eceaf
1 changed files with 8 additions and 0 deletions
  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);