コード例 #1
0
ファイル: grid.py プロジェクト: caomw/grass
 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
コード例 #2
0
    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
コード例 #3
0
ファイル: grid.py プロジェクト: starseeker/archival
 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
コード例 #4
0
ファイル: abstract.py プロジェクト: caomw/grass
    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