Exemple #1
0
 def SetName(self, name):
     if not self.hidden:
         if self._mapType is None:
             raise ValueError("To set layer name, the type of layer must be specified.")
         if self._mapType in ('strds', 'stvds', 'str3ds'):
             try:
                 name = validateTimeseriesName(name, self._mapType)
                 self._maps = getRegisteredMaps(name, self._mapType)
             except (GException, gcore.ScriptError) as e:
                 raise ValueError(str(e))
         else:
             self._maps = validateMapNames(name.split(','), self._mapType)
     self._name = name
     self.label = name
Exemple #2
0
 def SetName(self, name):
     if not self.hidden:
         if self._mapType is None:
             raise ValueError(
                 "To set layer name, the type of layer must be specified.")
         if self._mapType in ('strds', 'stvds', 'str3ds'):
             try:
                 name = validateTimeseriesName(name, self._mapType)
                 self._maps = getRegisteredMaps(name, self._mapType)
             except (GException, gcore.ScriptError) as e:
                 raise ValueError(str(e))
         else:
             self._maps = validateMapNames(name.split(','), self._mapType)
     self._name = name
     self.label = name
Exemple #3
0
    def _gatherInformation(self, timeseries, etype, timeseriesList, infoDict):
        """Get info about timeseries and check topology (raises GException)"""
        id = validateTimeseriesName(timeseries, etype)
        sp = tgis.dataset_factory(etype, id)
        # Insert content from db
        sp.select()
        # Get ordered map list
        maps = sp.get_registered_maps_as_objects()

        if not sp.check_temporal_topology(maps):
            raise GException(_("Topology of Space time dataset %s is invalid." % id))

        timeseriesList.append(id)
        infoDict[id] = {}
        infoDict[id]['etype'] = etype
        infoDict[id]['temporal_type'] = sp.get_temporal_type()
        if sp.is_time_relative():
            infoDict[id]['unit'] = sp.get_relative_time_unit()
        infoDict[id]['granularity'] = sp.get_granularity()
        infoDict[id]['map_time'] = sp.get_map_time()
        infoDict[id]['maps'] = maps
Exemple #4
0
    def _gatherInformation(self, timeseries, etype, timeseriesList, infoDict):
        """Get info about timeseries and check topology (raises GException)"""
        id = validateTimeseriesName(timeseries, etype)
        sp = tgis.dataset_factory(etype, id)
        # Insert content from db
        sp.select()
        # Get ordered map list
        maps = sp.get_registered_maps_as_objects()

        if not sp.check_temporal_topology(maps):
            raise GException(_("Topology of Space time dataset %s is invalid." % id))

        timeseriesList.append(id)
        infoDict[id] = {}
        infoDict[id]["etype"] = etype
        infoDict[id]["temporal_type"] = sp.get_temporal_type()
        if sp.is_time_relative():
            infoDict[id]["unit"] = sp.get_relative_time_unit()
        infoDict[id]["granularity"] = sp.get_granularity()
        infoDict[id]["map_time"] = sp.get_map_time()
        infoDict[id]["maps"] = maps