def define_mapset_inputs(self): """Add the mapset information to the input maps """ for inmap in self.module.inputs: inm = self.module.inputs[inmap] if inm.type in ('raster', 'vector') and inm.value: if '@' not in inm.value: mset = get_mapset_raster(inm.value) inm.value = inm.value + '@%s' % mset
def exist(self): """Return True if the map already exist, and set the mapset if were not set. call the C function `G_find_raster`. >>> ele = RasterAbstractBase('elevation') >>> ele.exist() True """ if self.name: if self.mapset == '': mapset = functions.get_mapset_raster(self.name, self.mapset) self.mapset = mapset if mapset else '' return True if mapset else False return bool(functions.get_mapset_raster(self.name, self.mapset)) else: return False