示例#1
0
def processASZ():
    """Compute attributes for Area Source Zones:
        - activity parameters using Roger Musson's code
    """
    
    global metadata
    
    print "loading ASZ layer"
    metadata['asz_layer'] = areasource.loadAreaSourceFromSHP(
        metadata['infile_name'], metadata['data'].mmax, 
        metadata['background_layer'])

    pr = metadata['asz_layer'].dataProvider()
    pr.select()
    print "features:", pr.featureCount()
    print "fields:", pr.fieldCount()
    
    all_features = [feat.id() for feat in pr]
    #all_features = [292]
    metadata['asz_layer'].setSelectedFeatures(all_features)
    
    print "computing attributes for ASZ layer"
    engine.computeASZ(metadata['asz_layer'], 
        metadata['catalog'], ui_mode=False)

    return metadata['asz_layer']
示例#2
0
def processASZ():
    """Compute attributes for Area Source Zones:
        - activity parameters using Roger Musson's code
    """

    global metadata

    print "loading ASZ layer"
    metadata['asz_layer'] = areasource.loadAreaSourceFromSHP(
        metadata['infile_name'], metadata['data'].mmax,
        metadata['background_layer'])

    pr = metadata['asz_layer'].dataProvider()
    pr.select()
    print "features:", pr.featureCount()
    print "fields:", pr.fieldCount()

    all_features = [feat.id() for feat in pr]
    #all_features = [292]
    metadata['asz_layer'].setSelectedFeatures(all_features)

    print "computing attributes for ASZ layer"
    engine.computeASZ(metadata['asz_layer'],
                      metadata['catalog'],
                      ui_mode=False)

    return metadata['asz_layer']
示例#3
0
    def computeASZ(self):
        """Compute attributes for selected feature in ASZ layer. Only one
        feature can be selected."""

        if not utils.check_only_one_feature_selected(self.area_source_layer):
            return

        (mindepth, maxdepth) = eqcatalog.getMinMaxDepth(self)
        
        engine.computeASZ(self.area_source_layer, self.catalog, mindepth, 
            maxdepth, ui_mode=True)
            
        self.showASZ()