Przeglądaj źródła

only read region, don't alter WIND file (https://trac.osgeo.org/grass/ticket/2230)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59387 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 11 lat temu
rodzic
commit
6b1e2b4011

+ 1 - 1
lib/python/pygrass/gis/region.py

@@ -204,7 +204,7 @@ class Region(object):
                          border='1', kdec='b')
                          border='1', kdec='b')
 
 
     def __unicode__(self):
     def __unicode__(self):
-        return grass.pipe_command("g.region", flags="p").communicate()[0]
+        return grass.pipe_command("g.region", flags="pu").communicate()[0]
 
 
     def __str__(self):
     def __str__(self):
         return self.__unicode__()
         return self.__unicode__()

+ 2 - 1
lib/python/pygrass/modules/interface/module.py

@@ -10,9 +10,10 @@ Created on Tue Apr  2 18:41:27 2013
 >>> import copy
 >>> import copy
 >>> region = pymod.Module("g.region")
 >>> region = pymod.Module("g.region")
 >>> region.flags["p"].value = True
 >>> region.flags["p"].value = True
+>>> region.flags["u"].value = True
 >>> region.flags["3"].value = True
 >>> region.flags["3"].value = True
 >>> region.get_bash()
 >>> region.get_bash()
-'g.region -p -3'
+'g.region -p -u -3'
 >>> new_region = copy.deepcopy(region)
 >>> new_region = copy.deepcopy(region)
 >>> new_region.inputs["res"].value = "10"
 >>> new_region.inputs["res"].value = "10"
 >>> new_region.get_bash()
 >>> new_region.get_bash()

+ 5 - 5
lib/python/script/core.py

@@ -978,11 +978,11 @@ def gisenv():
 
 
 def locn_is_latlong():
 def locn_is_latlong():
     """!Tests if location is lat/long. Value is obtained
     """!Tests if location is lat/long. Value is obtained
-    by checking the "g.region -p" projection code.
+    by checking the "g.region -pu" projection code.
 
 
     @return True for a lat/long region, False otherwise
     @return True for a lat/long region, False otherwise
     """
     """
-    s = read_command("g.region", flags='p')
+    s = read_command("g.region", flags='pu')
     kv = parse_key_val(s, ':')
     kv = parse_key_val(s, ':')
     if kv['projection'].split(' ')[0] == '3':
     if kv['projection'].split(' ')[0] == '3':
         return True
         return True
@@ -991,7 +991,7 @@ def locn_is_latlong():
 
 
 
 
 def region(region3d=False, complete=False):
 def region(region3d=False, complete=False):
-    """!Returns the output from running "g.region -g", as a
+    """!Returns the output from running "g.region -gu", as a
     dictionary. Example:
     dictionary. Example:
 
 
     @param region3d True to get 3D region
     @param region3d True to get 3D region
@@ -1009,7 +1009,7 @@ def region(region3d=False, complete=False):
 
 
     @return dictionary of region values
     @return dictionary of region values
     """
     """
-    flgs = 'g'
+    flgs = 'gu'
     if region3d:
     if region3d:
         flgs += '3'
         flgs += '3'
     if complete:
     if complete:
@@ -1067,7 +1067,7 @@ def region_env(region3d=False, **kwargs):
     if not kwargs:  # return current region
     if not kwargs:  # return current region
         return grass_region
         return grass_region
 
 
-    # read other values from `g.region -g`
+    # read other values from `g.region -gu`
     flgs = 'ug'
     flgs = 'ug'
     if region3d:
     if region3d:
         flgs += '3'
         flgs += '3'