Beispiel #1
0
    def do_operation(self):
        """ perform create mapping scheme operation """

        # input/output verification already performed during set input/ouput
        ms = MappingScheme(self._taxonomy)
        zone = MappingSchemeZone('ALL')
        stats = Statistics(self._taxonomy)
        stats.finalize()
        stats.get_tree().value = zone.name
        ms.assign(zone, stats)

        self.outputs[0].value = ms
Beispiel #2
0
 def do_operation(self):
     """ perform create mapping scheme operation """
     
     # input/output verification already performed during set input/ouput
     ms = MappingScheme(self._taxonomy)
     zone = MappingSchemeZone('ALL')
     stats = Statistics(self._taxonomy)
     stats.finalize()
     stats.get_tree().value = zone.name
     ms.assign(zone, stats)
     
     self.outputs[0].value = ms
Beispiel #3
0
 def saveMSBranch(self):
     """ 
     event handler for btn_save
     - open "Save mapping scheme" dialog box to save current set of values/weights
       as a single level mapping scheme
     """
     ms = MappingScheme(self.taxonomy)
     stats = Statistics(self.taxonomy)
     root = stats.get_tree()
     for v, w in map(None, self.levelModel.values, self.levelModel.weights):
         node = StatisticNode(root, '', v)
         node.weight = w
         root.children.append(node)
     stats.finalized = True
     ms.assign(MappingSchemeZone('ALL'), stats)
     
     self.dlgSave.setMS(ms, True)
     self.dlgSave.exec_()
Beispiel #4
0
    def do_operation(self):
        """ perform create mapping scheme operation """

        # input/output verification already performed during set input/ouput
        zone_layer = self.inputs[0].value
        zone_field = self.inputs[1].value

        # load zone
        try:
            zone_classes = layer_field_stats(zone_layer, zone_field)
        except AssertionError as err:
            raise OperatorError(str(err), self.__class__)

        # merge to create stats
        ms = MappingScheme(self._taxonomy)
        for _zone, _count in zone_classes.iteritems():
            stats = Statistics(self._taxonomy)
            stats.finalize()
            stats.get_tree().value = _zone
            ms.assign(MappingSchemeZone(_zone), stats)

        self.outputs[0].value = ms
Beispiel #5
0
    def do_operation(self):
        """ perform create mapping scheme operation """
        
        # input/output verification already performed during set input/ouput        
        zone_layer = self.inputs[0].value
        zone_field = self.inputs[1].value
        
        # load zone
        try:
            zone_classes = layer_field_stats(zone_layer, zone_field)
        except AssertionError as err:
            raise OperatorError(str(err), self.__class__)
        
        # merge to create stats
        ms = MappingScheme(self._taxonomy)
        for _zone, _count in zone_classes.iteritems():
            stats = Statistics(self._taxonomy)
            stats.finalize()
            stats.get_tree().value = _zone                
            ms.assign(MappingSchemeZone(_zone), stats)

        self.outputs[0].value = ms