コード例 #1
0
ファイル: SelectByLocation.py プロジェクト: AndiJay/QGIS
    def defineCharacteristics(self):
        self.name, self.i18n_name = self.trAlgorithm('Select by location')
        self.group, self.i18n_group = self.trAlgorithm(
            'Vector selection tools')

        self.methods = [
            self.tr('creating new selection'),
            self.tr('adding to current selection'),
            self.tr('removing from current selection')
        ]

        self.addParameter(
            ParameterVector(self.INPUT, self.tr('Layer to select from')))
        self.addParameter(
            ParameterVector(self.INTERSECT,
                            self.tr('Additional layer (intersection layer)')))
        self.addParameter(
            ParameterGeometryPredicate(self.PREDICATE,
                                       self.tr('Geometric predicate'),
                                       left=self.INPUT,
                                       right=self.INTERSECT))
        self.addParameter(
            ParameterNumber(self.PRECISION, self.tr('Precision'), 0.0, None,
                            0.0))
        self.addParameter(
            ParameterSelection(self.METHOD,
                               self.tr('Modify current selection by'),
                               self.methods, 0))
        self.addOutput(
            OutputVector(self.OUTPUT, self.tr('Selected (location)'), True))
コード例 #2
0
ファイル: SpatialJoin.py プロジェクト: giantchen2012/QGIS
    def defineCharacteristics(self):
        self.name, self.i18n_name = self.trAlgorithm('Join attributes by location')
        self.group, self.i18n_group = self.trAlgorithm('Vector general tools')

        self.summarys = [
            self.tr('Take attributes of the first located feature'),
            self.tr('Take summary of intersecting features')
        ]

        self.keeps = [
            self.tr('Only keep matching records'),
            self.tr('Keep all records (including non-matching target records)')
        ]

        self.addParameter(ParameterVector(self.TARGET,
                                          self.tr('Target vector layer')))
        self.addParameter(ParameterVector(self.JOIN,
                                          self.tr('Join vector layer')))
        predicates = list(ParameterGeometryPredicate.predicates)
        predicates.remove('disjoint')
        self.addParameter(ParameterGeometryPredicate(self.PREDICATE,
                                                     self.tr('Geometric predicate'),
                                                     left=self.TARGET, right=self.JOIN,
                                                     enabledPredicates=predicates))
        self.addParameter(ParameterNumber(self.PRECISION,
                                          self.tr('Precision'),
                                          0.0, None, 0.0))
        self.addParameter(ParameterSelection(self.SUMMARY,
                                             self.tr('Attribute summary'), self.summarys))
        self.addParameter(ParameterString(self.STATS,
                                          self.tr('Statistics for summary (comma separated)'),
                                          'sum,mean,min,max,median', optional=True))
        self.addParameter(ParameterSelection(self.KEEP,
                                             self.tr('Joined table'), self.keeps))
        self.addOutput(OutputVector(self.OUTPUT, self.tr('Joined layer')))
コード例 #3
0
ファイル: SpatialJoin.py プロジェクト: GRSEB9S/QGis_plugin
    def defineCharacteristics(self):
        self.name = "Join attributes by location"
        self.group = "Vector general tools"

        self.addParameter(
            ParameterVector(self.TARGET, self.tr('Target vector layer'),
                            [ParameterVector.VECTOR_TYPE_ANY]))
        self.addParameter(
            ParameterVector(self.JOIN, self.tr('Join vector layer'),
                            [ParameterVector.VECTOR_TYPE_ANY]))
        predicates = list(ParameterGeometryPredicate.predicates)
        predicates.remove('disjoint')
        self.addParameter(
            ParameterGeometryPredicate(self.PREDICATE,
                                       self.tr('Geometric predicate'),
                                       left=self.TARGET,
                                       right=self.JOIN,
                                       enabledPredicates=predicates))
        self.addParameter(
            ParameterSelection(self.SUMMARY, self.tr('Attribute summary'),
                               self.SUMMARYS))
        self.addParameter(
            ParameterString(
                self.STATS,
                self.tr('Statistics for summary (comma separated)'),
                'sum,mean,min,max,median',
                optional=True))
        self.addParameter(
            ParameterSelection(self.KEEP, self.tr('Output table'), self.KEEPS))
        self.addOutput(OutputVector(self.OUTPUT, self.tr('Output layer')))
コード例 #4
0
ファイル: ExtractByLocation.py プロジェクト: streamerset/QGIS
 def defineCharacteristics(self):
     self.name, self.i18n_name = self.trAlgorithm('Extract by location')
     self.group, self.i18n_group = self.trAlgorithm('Vector selection tools')
     self.addParameter(ParameterVector(self.INPUT,
         self.tr('Layer to select from'),
         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(ParameterVector(self.INTERSECT,
         self.tr('Additional layer (intersection layer)'),
         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(ParameterGeometryPredicate(self.PREDICATE,
         self.tr('Geometric predicate'),
         left=self.INPUT, right=self.INTERSECT))
     self.addOutput(OutputVector(self.OUTPUT, self.tr('Extracted (location)')))
コード例 #5
0
 def defineCharacteristics(self):
     self.name = 'Select by location'
     self.group = 'Vector selection tools'
     self.addParameter(
         ParameterVector(self.INPUT, self.tr('Layer to select from'),
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterVector(self.INTERSECT,
                         self.tr('Additional layer (intersection layer)'),
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterGeometryPredicate(self.PREDICATE,
                                    self.tr('Geometric predicate'),
                                    left=self.INPUT,
                                    right=self.INTERSECT))
     self.addParameter(
         ParameterSelection(self.METHOD,
                            self.tr('Modify current selection by'),
                            self.METHODS, 0))
     self.addOutput(OutputVector(self.OUTPUT, self.tr('Selection'), True))
コード例 #6
0
ファイル: ExtractByLocation.py プロジェクト: drnextgis/QGIS
    def defineCharacteristics(self):
        self.name, self.i18n_name = self.trAlgorithm('Extract by location')
        self.group, self.i18n_group = self.trAlgorithm(
            'Vector selection tools')
        self.tags = self.tr(
            'extract,filter,location,intersects,contains,within')

        self.addParameter(
            ParameterVector(self.INPUT, self.tr('Layer to select from')))
        self.addParameter(
            ParameterVector(self.INTERSECT,
                            self.tr('Additional layer (intersection layer)')))
        self.addParameter(
            ParameterGeometryPredicate(self.PREDICATE,
                                       self.tr('Geometric predicate'),
                                       left=self.INPUT,
                                       right=self.INTERSECT))
        self.addParameter(
            ParameterNumber(self.PRECISION, self.tr('Precision'), 0.0, None,
                            0.0))
        self.addOutput(
            OutputVector(self.OUTPUT, self.tr('Extracted (location)')))