[GRASS-dev] [GRASS GIS] #3828: pygrass.gis.Region.from_* should raise a ValueError if the specified map does not exist.
GRASS GIS
trac at osgeo.org
Sat Apr 27 07:56:53 PDT 2019
#3828: pygrass.gis.Region.from_* should raise a ValueError if the specified map
does not exist.
-------------------------+-------------------------
Reporter: pmav99 | Owner: grass-dev@…
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: PyGRASS | Version: svn-trunk
Keywords: | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
I think it would be better if
{{{
pygrass.gis.Region.from_rast(raster_name)
pygrass.gis.Region.from_vect(vector_name)
}}}
would raise a {{{ValueError}}} if the specified map name cannot be found.
With the current implementation, the region remains unchanged and you have
no clue about that:
https://grass.osgeo.org/grass77/manuals/libpython/_modules/pygrass/gis/region.html#Region.from_rast
Note, it might make sense to raise the Exception from within
{{{get_mapset_raster()}}} but that function is used in more places and I
haven't checked if this will break anything.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3828>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list