Ejemplo n.º 1
0
    def defineCharacteristics(self):
        self.name = "Distance matrix"
        self.group = "Vector analysis tools"

        self.addParameter(
            ParameterVector(self.INPUT_LAYER, "Input point layer",
                            [ParameterVector.VECTOR_TYPE_POINT]))
        self.addParameter(
            ParameterTableField(self.INPUT_FIELD, "Input unique ID field",
                                self.INPUT_LAYER,
                                ParameterTableField.DATA_TYPE_ANY))
        self.addParameter(
            ParameterVector(self.TARGET_LAYER, "Target point layer",
                            ParameterVector.VECTOR_TYPE_POINT))
        self.addParameter(
            ParameterTableField(self.TARGET_FIELD, "Target unique ID field",
                                self.TARGET_LAYER,
                                ParameterTableField.DATA_TYPE_ANY))
        self.addParameter(
            ParameterSelection(self.MATRIX_TYPE, "Output matrix type",
                               self.MAT_TYPES, 0))
        self.addParameter(
            ParameterNumber(self.NEAREST_POINTS,
                            "Use only the nearest (k) target points", 0, 9999,
                            0))

        self.addOutput(OutputFile(self.DISTANCE_MATRIX, "Distance matrix"))
Ejemplo n.º 2
0
    def defineCharacteristics(self):
        self.name = 'Distance matrix'
        self.group = 'Vector analysis tools'

        self.addParameter(
            ParameterVector(self.INPUT_LAYER, 'Input point layer',
                            [ParameterVector.VECTOR_TYPE_POINT]))
        self.addParameter(
            ParameterTableField(self.INPUT_FIELD, 'Input unique ID field',
                                self.INPUT_LAYER,
                                ParameterTableField.DATA_TYPE_ANY))
        self.addParameter(
            ParameterVector(self.TARGET_LAYER, 'Target point layer',
                            ParameterVector.VECTOR_TYPE_POINT))
        self.addParameter(
            ParameterTableField(self.TARGET_FIELD, 'Target unique ID field',
                                self.TARGET_LAYER,
                                ParameterTableField.DATA_TYPE_ANY))
        self.addParameter(
            ParameterSelection(self.MATRIX_TYPE, 'Output matrix type',
                               self.MAT_TYPES, 0))
        self.addParameter(
            ParameterNumber(self.NEAREST_POINTS,
                            'Use only the nearest (k) target points', 0, 9999,
                            0))

        self.addOutput(OutputTable(self.DISTANCE_MATRIX, 'Distance matrix'))
Ejemplo n.º 3
0
 def defineCharacteristics(self):
     self.name = "Join attributes table"
     self.group = "Vector general tools"
     self.addParameter(ParameterVector(self.INPUT_LAYER, "Input layer", [ParameterVector.VECTOR_TYPE_ANY], False))
     self.addParameter(ParameterVector(self.INPUT_LAYER_2, "Input layer 2", [ParameterVector.VECTOR_TYPE_ANY], False))
     self.addParameter(ParameterTableField(self.TABLE_FIELD, "Table field", self.INPUT_LAYER))
     self.addParameter(ParameterTableField(self.TABLE_FIELD_2, "Table field 2", self.INPUT_LAYER_2))
     self.addOutput(OutputVector(self.OUTPUT_LAYER, "Output layer"))
Ejemplo n.º 4
0
 def defineCharacteristics(self):
     self.name = 'Intersection'
     self.group = 'Vector overlay tools'
     self.addParameter(ParameterVector(self.INPUT, 'Input layer',
                       [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(ParameterVector(self.INPUT2,
                       'Intersect layer',
                       [ParameterVector.VECTOR_TYPE_ANY]))
     self.addOutput(OutputVector(self.OUTPUT, 'Intersection'))
Ejemplo n.º 5
0
 def defineCharacteristics(self):
     self.name = 'Extract by location'
     self.group = 'Vector selection tools'
     self.addParameter(ParameterVector(self.INPUT, 'Layer to select from',
                       [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(ParameterVector(self.INTERSECT,
                       'Additional layer (intersection layer)',
                       [ParameterVector.VECTOR_TYPE_ANY]))
     self.addOutput(OutputVector(self.OUTPUT, 'Selection'))
Ejemplo n.º 6
0
 def defineCharacteristics(self):
     self.name = 'Difference'
     self.group = 'Vector overlay tools'
     self.addParameter(
         ParameterVector(Difference.INPUT, 'Input layer',
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterVector(Difference.OVERLAY, 'Difference layer',
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addOutput(OutputVector(Difference.OUTPUT, 'Difference'))
Ejemplo n.º 7
0
 def defineCharacteristics(self):
     self.name = "Join by location"
     self.group = "Vector general tools"
     self.addParameter(ParameterVector(SpatialJoin.INPUT1, "Target vector layer", [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(ParameterVector(SpatialJoin.INPUT2, "Join vector layer", [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(ParameterSelection(self.SUMMARY, "Attribute summary", self.SUMMARYS, 0))
     self.addParameter(ParameterString(self.STATS, "Statistics for summary (comma separated)", "sum,mean,min,max,median"))
     self.addParameter(ParameterSelection(self.GEOMETRY, "Output geometry", self.GEOMETRYS, 0))
     self.addParameter(ParameterSelection(self.KEEP, "Output table", self.KEEPS, 0))
     self.addOutput(OutputVector(SpatialJoin.OUTPUT, "Output layer"))
Ejemplo n.º 8
0
 def defineCharacteristics(self):
     self.name = "Intersection"
     self.group = "Vector overlay tools"
     self.addParameter(
         ParameterVector(Intersection.INPUT, "Input layer",
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterVector(Intersection.INPUT2, "Intersect layer",
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addOutput(OutputVector(Intersection.OUTPUT, "Intersection"))
Ejemplo n.º 9
0
    def defineCharacteristics(self):
        self.name = "Line intersections"
        self.group = "Vector overlay tools"

        self.addParameter(ParameterVector(self.INPUT_A, "Input layer", [ParameterVector.VECTOR_TYPE_LINE]))
        self.addParameter(ParameterVector(self.INPUT_B, "Intersect layer", [ParameterVector.VECTOR_TYPE_LINE]))
        self.addParameter(ParameterTableField(self.FIELD_A, "Input unique ID field", self.INPUT_A))
        self.addParameter(ParameterTableField(self.FIELD_B, "Intersect unique ID field", self.INPUT_B))

        self.addOutput(OutputVector(self.OUTPUT, "Output layer"))
Ejemplo n.º 10
0
 def defineCharacteristics(self):
     self.name = "Clip"
     self.group = "Vector overlay tools"
     self.addParameter(
         ParameterVector(Clip.INPUT, "Input layer",
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterVector(Clip.OVERLAY, "Clip layer",
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addOutput(OutputVector(Clip.OUTPUT, "Clipped"))
Ejemplo n.º 11
0
 def defineCharacteristics(self):
     self.name = 'Clip'
     self.group = 'Vector overlay tools'
     self.addParameter(
         ParameterVector(Clip.INPUT, 'Input layer',
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterVector(Clip.OVERLAY, 'Clip layer',
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addOutput(OutputVector(Clip.OUTPUT, 'Clipped'))
Ejemplo n.º 12
0
 def defineCharacteristics(self):
     self.name = "Difference"
     self.group = "Vector overlay tools"
     self.addParameter(
         ParameterVector(Difference.INPUT, "Input layer",
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterVector(Difference.OVERLAY, "Difference layer",
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addOutput(OutputVector(Difference.OUTPUT, "Difference"))
Ejemplo n.º 13
0
    def defineCharacteristics(self):
        self.name = 'Count points in polygon'
        self.group = 'Vector analysis tools'
        self.addParameter(
            ParameterVector(self.POLYGONS, 'Polygons',
                            [ParameterVector.VECTOR_TYPE_POLYGON]))
        self.addParameter(
            ParameterVector(self.POINTS, 'Points',
                            [ParameterVector.VECTOR_TYPE_POINT]))
        self.addParameter(
            ParameterString(self.FIELD, 'Count field name', 'NUMPOINTS'))

        self.addOutput(OutputVector(self.OUTPUT, 'Result'))
Ejemplo n.º 14
0
    def defineCharacteristics(self):
        self.name = "Count points in polygon"
        self.group = "Vector analysis tools"
        self.addParameter(
            ParameterVector(self.POLYGONS, "Polygons",
                            [ParameterVector.VECTOR_TYPE_POLYGON]))
        self.addParameter(
            ParameterVector(self.POINTS, "Points",
                            [ParameterVector.VECTOR_TYPE_POINT]))
        self.addParameter(
            ParameterString(self.FIELD, "Count field name", "NUMPOINTS"))

        self.addOutput(OutputVector(self.OUTPUT, "Result"))
Ejemplo n.º 15
0
    def defineCharacteristics(self):
        self.name = 'Line intersections'
        self.group = 'Vector overlay tools'

        self.addParameter(ParameterVector(self.INPUT_A, 'Input layer',
                          [ParameterVector.VECTOR_TYPE_LINE]))
        self.addParameter(ParameterVector(self.INPUT_B, 'Intersect layer',
                          [ParameterVector.VECTOR_TYPE_LINE]))
        self.addParameter(ParameterTableField(self.FIELD_A,
                          'Input unique ID field', self.INPUT_A))
        self.addParameter(ParameterTableField(self.FIELD_B,
                          'Intersect unique ID field', self.INPUT_B))

        self.addOutput(OutputVector(self.OUTPUT, 'Output layer'))
Ejemplo n.º 16
0
 def defineCharacteristics(self):
     self.allowOnlyOpenedLayers = True
     self.name = "Select by location"
     self.group = "Vector selection tools"
     self.addParameter(
         ParameterVector(self.INPUT, "Layer to select from",
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterVector(self.INTERSECT,
                         "Additional layer (intersection layer)",
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterSelection(self.METHOD, "Modify current selection by",
                            self.METHODS, 0))
     self.addOutput(OutputVector(self.OUTPUT, "Selection", True))
Ejemplo n.º 17
0
 def defineCharacteristics(self):
     self.allowOnlyOpenedLayers = True
     self.name = 'Select by location'
     self.group = 'Vector selection tools'
     self.addParameter(
         ParameterVector(self.INPUT, 'Layer to select from',
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterVector(self.INTERSECT,
                         'Additional layer (intersection layer)',
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterSelection(self.METHOD, 'Modify current selection by',
                            self.METHODS, 0))
     self.addOutput(OutputVector(self.OUTPUT, 'Selection', True))
Ejemplo n.º 18
0
    def defineCharacteristics(self):
        self.name = 'Simulate flow in storm water conveyance systems'
        self.group = 'Simulation'

        self.addParameter(ParameterString(self.TITLE, 'Title', 'Swmm Simulation'))

        self.addParameter(ParameterTable(self.OPTIONS, 'Analysis options', True))
        self.addParameter(ParameterTable(self.REPORT, 'Output reporting instructions', True))
        self.addParameter(ParameterTable(self.FILES, 'Interface file options', True))
        self.addParameter(ParameterTable(self.RAINGAGES, 'Rain gage information', True))
        self.addParameter(ParameterTable(self.HYDROGRAPHS, 'Unit hydrograph data used to construct RDII inflows', True))
        self.addParameter(ParameterTable(self.EVAPORATION, 'Evaporation data', True))
        self.addParameter(ParameterTable(self.TEMPERATURE, 'Air temperature and snow melt data', True))
        self.addParameter(ParameterVector(self.SUBCATCHMENTS, 'Basic subcatchment information', [ParameterVector.VECTOR_TYPE_POLYGON], True))
        self.addParameter(ParameterTable(self.SUBAREAS, 'Subcatchment impervious/pervious sub-area data', True))
        self.addParameter(ParameterTable(self.INFILTRATION, 'Subcatchment infiltration parameters', True))
        self.addParameter(ParameterTable(self.LID_CONTROLS, 'Low impact development control information', True))
        self.addParameter(ParameterTable(self.LID_USAGE, 'Assignment of LID controls to subcatchments', True))
        self.addParameter(ParameterTable(self.AQUIFERS, 'Groundwater aquifer parameters', True))
        self.addParameter(ParameterTable(self.GROUNDWATER, 'Subcatchment groundwater parameters', True))
        self.addParameter(ParameterTable(self.SNOWPACKS, 'Subcatchment snow pack parameters', True))
        self.addParameter(ParameterVector(self.JUNCTIONS, 'Junction node information', [ParameterVector.VECTOR_TYPE_POINT], True))
        self.addParameter(ParameterTable(self.OUTFALLS, 'Outfall node information', True))
        self.addParameter(ParameterVector(self.DIVIDERS, 'Flow divider node information', [ParameterVector.VECTOR_TYPE_POINT], True))
        self.addParameter(ParameterVector(self.STORAGE, 'Storage node information', [ParameterVector.VECTOR_TYPE_POINT], True))
        self.addParameter(ParameterVector(self.CONDUITS, 'Conduit link information', [ParameterVector.VECTOR_TYPE_LINE], True))
        self.addParameter(ParameterVector(self.PUMPS, 'Pump link information', [ParameterVector.VECTOR_TYPE_POINT], True))
        self.addParameter(ParameterVector(self.ORIFICES, 'Orifice link information', [ParameterVector.VECTOR_TYPE_POINT], True))
        self.addParameter(ParameterVector(self.WEIRS, 'Weir link information', [ParameterVector.VECTOR_TYPE_POINT], True))
        self.addParameter(ParameterVector(self.OUTLETS, 'Outlet link information', [ParameterVector.VECTOR_TYPE_POINT], True))
        self.addParameter(ParameterTable(self.XSECTIONS, 'Conduit, orifice, and weir cross-section geometry', True))
        self.addParameter(ParameterTable(self.TRANSECTS, 'Transect geometry for conduits with irregular cross-sections', True))
        self.addParameter(ParameterTable(self.LOSSES, 'Conduit entrance/exit losses and flap valves', True))
        self.addParameter(ParameterTable(self.CONTROLS, 'Rules that control pump and regulator operation', True))
        self.addParameter(ParameterTable(self.POLLUTANTS, 'Pollutant information', True))
        self.addParameter(ParameterTable(self.LANDUSES, 'Land use categories', True))
        self.addParameter(ParameterTable(self.COVERAGES, 'Assignment of land uses to subcatchments', True))
        self.addParameter(ParameterTable(self.BUILDUP, 'Buildup functions for pollutants and land uses', True))
        self.addParameter(ParameterTable(self.WASHOFF, 'Washoff functions for pollutants and land uses', True))
        self.addParameter(ParameterTable(self.TREATMENT, 'Pollutant removal functions at conveyance system nodes', True))
        self.addParameter(ParameterTable(self.INFLOWS, 'External hydrograph/pollutograph inflow at nodes', True))
        self.addParameter(ParameterTable(self.DWF, 'Baseline dry weather sanitary inflow at nodes', True))
        self.addParameter(ParameterTable(self.PATTERNS, 'Periodic variation in dry weather inflow', True))
        self.addParameter(ParameterTable(self.RDII, 'Rainfall-dependent I/I information at nodes', True))
        self.addParameter(ParameterTable(self.LOADINGS, 'Initial pollutant loads on subcatchments', True))
        self.addParameter(ParameterTable(self.CURVES, 'x-y tabular data referenced in other sections', True))
        self.addParameter(ParameterTable(self.TIMESERIES, 'Time series data referenced in other sections', True))


        self.addOutput(OutputVector(self.NODE_OUTPUT, 'Node output layer'))
        self.addOutput(OutputTable(self.NODE_TABLE_OUTPUT, 'Node output table'))
        self.addOutput(OutputVector(self.LINK_OUTPUT, 'Link output layer'))
        pass
Ejemplo n.º 19
0
    def defineCharacteristics(self):
        self.name = 'Basic statistics for numeric fields'
        self.group = 'Vector table tools'

        self.addParameter(
            ParameterVector(self.INPUT_LAYER, 'Input vector layer',
                            ParameterVector.VECTOR_TYPE_ANY, False))
        self.addParameter(
            ParameterTableField(self.FIELD_NAME,
                                'Field to calculate statistics on',
                                self.INPUT_LAYER,
                                ParameterTableField.DATA_TYPE_NUMBER))

        self.addOutput(
            OutputHTML(self.OUTPUT_HTML_FILE, 'Statistics for numeric field'))

        self.addOutput(OutputNumber(self.CV, 'Coefficient of Variation'))
        self.addOutput(OutputNumber(self.MIN, 'Minimum value'))
        self.addOutput(OutputNumber(self.MAX, 'Maximum value'))
        self.addOutput(OutputNumber(self.SUM, 'Sum'))
        self.addOutput(OutputNumber(self.MEAN, 'Mean value'))
        self.addOutput(OutputNumber(self.COUNT, 'Count'))
        self.addOutput(OutputNumber(self.RANGE, 'Range'))
        self.addOutput(OutputNumber(self.MEDIAN, 'Median'))
        self.addOutput(OutputNumber(self.UNIQUE, 'Number of unique values'))
        self.addOutput(OutputNumber(self.STD_DEV, 'Standard deviation'))
Ejemplo n.º 20
0
 def defineCharacteristics(self):
     self.name = 'Join attributes table'
     self.group = 'Vector general tools'
     self.addParameter(
         ParameterVector(self.INPUT_LAYER, 'Input layer',
                         [ParameterVector.VECTOR_TYPE_ANY], False))
     self.addParameter(
         ParameterVector(self.INPUT_LAYER_2, 'Input layer 2',
                         [ParameterVector.VECTOR_TYPE_ANY], False))
     self.addParameter(
         ParameterTableField(self.TABLE_FIELD, 'Table field',
                             self.INPUT_LAYER))
     self.addParameter(
         ParameterTableField(self.TABLE_FIELD_2, 'Table field 2',
                             self.INPUT_LAYER_2))
     self.addOutput(OutputVector(self.OUTPUT_LAYER, 'Output layer'))
Ejemplo n.º 21
0
    def defineCharacteristics(self):
        self.name = 'Grid (Inverse distance to a power)'
        self.group = '[GDAL] Analysis'
        self.addParameter(
            ParameterVector(self.INPUT, 'Input layer',
                            [ParameterVector.VECTOR_TYPE_POINT]))
        self.addParameter(
            ParameterTableField(self.Z_FIELD, 'Z field', self.INPUT,
                                ParameterTableField.DATA_TYPE_NUMBER, True))
        self.addParameter(ParameterNumber(self.POWER, 'Power', 0, 100.0, 2.0))
        self.addParameter(
            ParameterNumber(self.SMOTHING, 'Smothing', 0.0, 99999999.999999,
                            0.0))
        self.addParameter(
            ParameterNumber(self.RADIUS_1, 'Radius 1', 0.0, 99999999.999999,
                            0.0))
        self.addParameter(
            ParameterNumber(self.RADIUS_2, 'Radius 2', 0.0, 99999999.999999,
                            0.0))
        self.addParameter(
            ParameterNumber(self.MAX_POINTS, 'Max points', 0.0,
                            99999999.999999, 0.0))
        self.addParameter(
            ParameterNumber(self.MIN_POINTS, 'Min points', 0.0,
                            99999999.999999, 0.0))
        self.addParameter(ParameterNumber(self.ANGLE, 'Angle', 0.0, 359.0,
                                          0.0))
        self.addParameter(
            ParameterNumber(self.NODATA, 'Nodata', -99999999.999999,
                            99999999.999999, 0.0))

        self.addOutput(OutputRaster(self.OUTPUT, 'Output file'))
Ejemplo n.º 22
0
 def defineCharacteristics(self):
     self.name = "Add autoincremental field"
     self.group = "Vector table tools"
     self.addParameter(
         ParameterVector(self.INPUT, "Input layer",
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addOutput(OutputVector(self.OUTPUT, "Output layer"))
Ejemplo n.º 23
0
 def defineCharacteristics(self):
     self.name = 'Add autoincremental field'
     self.group = 'Vector table tools'
     self.addParameter(
         ParameterVector(self.INPUT, 'Input layer',
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addOutput(OutputVector(self.OUTPUT, 'Output layer'))
Ejemplo n.º 24
0
    def defineCharacteristics(self):
        self.name = 'Lines to polygons'
        self.group = 'Vector geometry tools'

        self.addParameter(ParameterVector(self.INPUT, 'Input layer',
                          [ParameterVector.VECTOR_TYPE_LINE]))
        self.addOutput(OutputVector(self.OUTPUT, 'Output layer'))
Ejemplo n.º 25
0
    def defineCharacteristics(self):
        self.name = 'Import into PostGIS'
        self.group = 'Database'
        self.addParameter(ParameterVector(self.INPUT, 'Layer to import'))

        self.DB_CONNECTIONS = self.dbConnectionNames()
        self.addParameter(
            ParameterSelection(self.DATABASE, 'Database (connection name)',
                               self.DB_CONNECTIONS))

        self.addParameter(ParameterString(self.SCHEMA, 'Schema (schema name)'))
        self.addParameter(ParameterString(self.TABLENAME,
                                          'Table to import to'))
        self.addParameter(
            ParameterTableField(self.PRIMARY_KEY,
                                'Primary key field',
                                self.INPUT,
                                optional=True))
        self.addParameter(
            ParameterString(self.GEOMETRY_COLUMN, 'Geometry column',
                            'the_geom'))
        self.addParameter(ParameterBoolean(self.OVERWRITE, 'Overwrite', True))
        self.addParameter(
            ParameterBoolean(self.CREATEINDEX, 'Create spatial index', True))
        self.addParameter(
            ParameterBoolean(self.LOWERCASE_NAMES,
                             'Convert field names to lowercase', False))
        self.addParameter(
            ParameterBoolean(self.DROP_STRING_LENGTH,
                             'Drop length constraints on character fields',
                             False))
Ejemplo n.º 26
0
    def defineCharacteristics(self):
        """Here we define the inputs and output of the algorithm, along
        with some other properties.

        This will give the algorithm its semantics, and allow to use it
        in the modeler. As a rule of thumb, do not produce anything not
        declared here. It will work fine in the toolbox, but it will
        not work in the modeler. If that's what you intend, then set
        self.showInModeler = False
        """

        # The name that the user will see in the toolbox
        self.name = 'Save selected features'

        # The branch of the toolbox under which the algorithm will
        # appear
        self.group = 'Vector general tools'

        # We add the input vector layer. It can have any kind of
        # geometry. It is a mandatory (not optional) one, hence the
        # False argument
        self.addParameter(ParameterVector(self.INPUT_LAYER, 'Input layer',
                          [ParameterVector.VECTOR_TYPE_ANY], False))

        # We add a vector layer as output
        self.addOutput(OutputVector(self.OUTPUT_LAYER,
                       'Output layer with selected features'))
Ejemplo n.º 27
0
 def defineCharacteristics(self):
     self.name = "Explode lines"
     self.group = "Vector geometry tools"
     self.addParameter(
         ParameterVector(self.INPUT, "Input layer",
                         [ParameterVector.VECTOR_TYPE_LINE]))
     self.addOutput(OutputVector(self.OUTPUT, "Output layer"))
Ejemplo n.º 28
0
 def defineCharacteristics(self):
     self.name = 'Eliminate sliver polygons'
     self.group = 'Vector geometry tools'
     self.addParameter(ParameterVector(self.INPUT, 'Input layer',
                       [ParameterVector.VECTOR_TYPE_POLYGON]))
     self.addParameter(ParameterBoolean(self.KEEPSELECTION,
                       'Use current selection in input layer (works only \
                       if called from toolbox)', False))
     self.addParameter(ParameterTableField(self.ATTRIBUTE,
                       'Selection attribute', self.INPUT))
     self.comparisons = [
         '==',
         '!=',
         '>',
         '>=',
         '<',
         '<=',
         'begins with',
         'contains',
         ]
     self.addParameter(ParameterSelection(self.COMPARISON, 'Comparison',
                       self.comparisons, default=0))
     self.addParameter(ParameterString(self.COMPARISONVALUE, 'Value',
                       default='0'))
     self.addParameter(ParameterSelection(self.MODE,
                       'Merge selection with the neighbouring polygon \
                       with the largest', self.MODES))
     self.addOutput(OutputVector(self.OUTPUT, 'Cleaned layer'))
Ejemplo n.º 29
0
    def defineCharacteristics(self):
        """Here we define the inputs and output of the algorithm, along
        with some other properties.
        """
        self.name = 'Clip a vector layer to the hemisphere centred on a ' \
            'user specified point'
        self.group = 'Clip to Hemisphere'

        self.addParameter(
            ParameterVector(self.INPUT_LAYER, 'Input layer',
                            [ParameterVector.VECTOR_TYPE_ANY], False))
        self.addParameter(
            ParameterNumber(self.CENTER_LATITUDE, 'Latitude of '
                            'center of hemisphere',
                            default=0.0))
        self.addParameter(
            ParameterNumber(self.CENTER_LONGITUDE, 'Longitude '
                            'of center of hemisphere',
                            default=0.0))
        self.addParameter(
            ParameterNumber(self.SEGMENTS, 'Number of segments '
                            'for approximating the hemisphere',
                            default=500))
        self.addOutput(
            OutputVector(self.OUTPUT_LAYER, 'Output clipped to hemisphere'))
Ejemplo n.º 30
0
 def defineCharacteristics(self):
     self.name = 'Advanced Python field calculator'
     self.group = 'Vector table tools'
     self.addParameter(
         ParameterVector(self.INPUT_LAYER, 'Input layer',
                         [ParameterVector.VECTOR_TYPE_ANY], False))
     self.addParameter(
         ParameterString(self.FIELD_NAME, 'Result field name', 'NewField'))
     self.addParameter(
         ParameterSelection(self.FIELD_TYPE, 'Field type', self.TYPE_NAMES))
     self.addParameter(
         ParameterNumber(self.FIELD_LENGTH, 'Field length', 1, 255, 10))
     self.addParameter(
         ParameterNumber(self.FIELD_PRECISION, 'Field precision', 0, 10, 0))
     self.addParameter(
         ParameterString(self.GLOBAL,
                         'Global expression',
                         multiline=True,
                         optional=True))
     self.addParameter(
         ParameterString(self.FORMULA,
                         'Formula',
                         'value = ',
                         multiline=True))
     self.addOutput(OutputVector(self.OUTPUT_LAYER, 'Output layer'))