Re: [GRASS-dev] [GRASS GIS] #3834: Add .save() method to pygrass.gis.region.Region

2019-05-05 Thread GRASS GIS
#3834: Add .save() method to pygrass.gis.region.Region
--+-
  Reporter:  pmav99   |  Owner:  grass-dev@…
  Type:  enhancement  | Status:  new
  Priority:  normal   |  Milestone:  7.8.0
 Component:  PyGRASS  |Version:  svn-trunk
Resolution:   |   Keywords:
   CPU:  Unspecified  |   Platform:  Unspecified
--+-

Comment (by neteler):

 Should this go into lib/python/pygrass/gis/region.py ?

-- 
Ticket URL: 
GRASS GIS 

___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] [GRASS GIS] #3834: Add .save() method to pygrass.gis.region.Region

2019-04-30 Thread GRASS GIS
#3834: Add .save() method to pygrass.gis.region.Region
--+-
  Reporter:  pmav99   |  Owner:  grass-dev@…
  Type:  enhancement  | Status:  new
  Priority:  normal   |  Milestone:  7.8.0
 Component:  PyGRASS  |Version:  svn-trunk
Resolution:   |   Keywords:
   CPU:  Unspecified  |   Platform:  Unspecified
--+-
Changes (by martinl):

 * milestone:   => 7.8.0


-- 
Ticket URL: 
GRASS GIS 

___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] [GRASS GIS] #3834: Add .save() method to pygrass.gis.region.Region

2019-04-30 Thread GRASS GIS
#3834: Add .save() method to pygrass.gis.region.Region
-+-
 Reporter:  pmav99   |  Owner:  grass-dev@…
 Type:  enhancement  | Status:  new
 Priority:  normal   |  Milestone:
Component:  PyGRASS  |Version:  svn-trunk
 Keywords:   |CPU:  Unspecified
 Platform:  Unspecified  |
-+-
 The {{{Region()}}} objects are missing a method for saving the Region
 settings to a Region file.
 As a result, it is not really possible to use {{{WIND_OVERRIDE}}} with
 {{{Region}}} objects without resorting to use `g.region`. The following
 snippet is a possible implementation of a {{{save()}}} method:

 {{{
 def save(self, filename):
 """
 Save the Region settings to the specified Region file.

 This is the equivalent of `g.region save=filename --overwrite`

 The region file will be created inside the `$MAPSET/windows`
 directory.
 """
 if not grass.legal_name(filename):
 raise ValueError("Illegal filename: %s", filename)
 self.adjust()
 ret = libgis.G_put_element_window(self.byref(), "windows",
 filename)
 if ret < 0:
 raise ValueError("Couldn't save the region settings at: %s",
 filename)
 }}}

-- 
Ticket URL: 
GRASS GIS 

___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev