Browse Source

r.region: Vect_get_map_box() requires level 2 (#1404)

* r.region: Vect_get_map_box() requires level 2

* Use Vect_get_map_box1() instead

* Revert non-working commit
Huidae Cho 4 năm trước cách đây
mục cha
commit
f98bfab4fc
2 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 3 3
      lib/vector/Vlib/box.c
  2. 1 1
      raster/r.region/main.c

+ 3 - 3
lib/vector/Vlib/box.c

@@ -395,12 +395,12 @@ int Vect_get_map_box(const struct Map_info *Map, struct bound_box *Box)
 {
     const struct Plus_head *Plus;
 
+    if (Vect_level(Map) < 2)
+      return 0;
+
     Plus = &(Map->plus);
     Vect_box_copy(Box, &(Plus->box));
 
-    if (Vect_level(Map) < 2)
-      return 0;
-    
     return 1;
 }
 

+ 1 - 1
raster/r.region/main.c

@@ -177,7 +177,7 @@ int main(int argc, char *argv[])
 	if (Vect_open_old(&Map, name, "") != 1)
 	    G_fatal_error(_("Unable to open vector map <%s>"), name);
 
-	Vect_get_map_box(&Map, &box);
+	Vect_get_map_box1(&Map, &box);
 	window.north = box.N;
 	window.south = box.S;
 	window.west = box.W;