Example #1
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
Example #2
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'))
Example #3
0
 def defineCharacteristics(self):
     self.name = "Convex hull"
     self.group = "Vector geometry tools"
     self.addParameter(ParameterVector(ConvexHull.INPUT, "Input layer", [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(ParameterTableField(ConvexHull.FIELD, "Field (optional, only used if creating convex hulls by classes)", ConvexHull.INPUT, optional = True))
     self.addParameter(ParameterSelection(ConvexHull.METHOD, "Method", ConvexHull.METHODS))
     self.addOutput(OutputVector(ConvexHull.OUTPUT, "Convex hull"))
Example #4
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'))
Example #5
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'))
    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'))
Example #7
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'))
Example #8
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"))
Example #9
0
    def defineCharacteristics(self):
        self.name = 'Concave hull (k-nearest neighbors)'
        self.group = 'Concave hull'

        self.addParameter(
            ParameterVector(self.INPUT, 'Input layer',
                            [ParameterVector.VECTOR_TYPE_ANY], False))
        self.addParameter(
            ParameterBoolean(self.SELECTED_ONLY,
                             'Use selected features only',
                             default=True))
        self.addParameter(
            ParameterNumber(self.KNEIGHBORS,
                            'Number of neighbors',
                            1,
                            default=3))
        self.addParameter(
            ParameterTableField(
                self.FIELD,
                'Field (optional, only used if creating concave hulls by classes)',
                self.INPUT,
                optional=True))
        self.addParameter(
            ParameterSelection(self.METHOD, 'Method', self.METHODS))
        self.addOutput(OutputVector(self.OUTPUT, 'Output layer'))
Example #10
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"))
Example #11
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'))
Example #12
0
 def defineCharacteristics(self):
     self.name = "Polygonize"
     self.group = "[GDAL] Conversion"
     self.addParameter(
         ParameterRaster(polygonize.INPUT, "Input layer", False))
     self.addParameter(
         ParameterString(polygonize.FIELD, "Output field name", "DN"))
     self.addOutput(OutputVector(polygonize.OUTPUT, "Output layer"))
    def defineCharacteristics(self):
        self.name = "Export/Add geometry columns"
        self.group = "Vector table tools"

        self.addParameter(ParameterVector(self.INPUT, "Input layer", [ParameterVector.VECTOR_TYPE_ANY]))
        self.addParameter(ParameterSelection(self.METHOD, "Calculate using", self.CALC_METHODS, 0))

        self.addOutput(OutputVector(self.OUTPUT, "Output layer"))
Example #14
0
 def defineCharacteristics(self):
     self.name = 'Polygonize (raster to vector)'
     self.group = '[GDAL] Conversion'
     self.addParameter(
         ParameterRaster(polygonize.INPUT, 'Input layer', False))
     self.addParameter(
         ParameterString(polygonize.FIELD, 'Output field name', 'DN'))
     self.addOutput(OutputVector(polygonize.OUTPUT, 'Output layer'))
    def defineCharacteristics(self):
        self.name = 'De UTM 29N ED50 para PT-TM06/ETRS89'
        self.group = 'Transformação de Datum em Vectores'

        self.addParameter(
            ParameterVector(self.INPUT, 'Ficheiro de Entrada',
                            [ParameterVector.VECTOR_TYPE_ANY]))
        self.addOutput(OutputVector(self.OUTPUT, 'Ficheiro de Saída'))
Example #16
0
    def defineCharacteristics(self):
        self.name = "Simplify geometries"
        self.group = "Vector geometry tools"

        self.addParameter(ParameterVector(self.INPUT, "Input layer", [ParameterVector.VECTOR_TYPE_POLYGON, ParameterVector.VECTOR_TYPE_LINE]))
        self.addParameter(ParameterNumber(self.TOLERANCE, "Tolerance", 0.0, 10000000.0, 1.0))

        self.addOutput(OutputVector(self.OUTPUT, "Simplified layer"))
Example #17
0
    def defineCharacteristics(self):
        self.name = 'Generate points (pixel centroids) inside polygons'
        self.group = 'Vector analysis tools'

        self.addParameter(ParameterRaster(self.INPUT_RASTER, 'Raster layer'))
        self.addParameter(ParameterVector(self.INPUT_VECTOR, 'Vector layer',
                          [ParameterVector.VECTOR_TYPE_POLYGON]))
        self.addOutput(OutputVector(self.OUTPUT_LAYER, 'Output layer'))
Example #18
0
    def defineCharacteristics(self):
        self.name = "Polygon from layer extent"
        self.group = "Vector general tools"

        self.addParameter(ParameterVector(self.INPUT_LAYER, "Input layer", [ParameterVector.VECTOR_TYPE_ANY]))
        self.addParameter(ParameterBoolean(self.BY_FEATURE, "Calculate extent for each feature separately", False))

        self.addOutput(OutputVector(self.OUTPUT, "Output layer"))
Example #19
0
    def defineCharacteristics(self):
        self.name = 'Delaunay triangulation'
        self.group = 'Vector geometry tools'

        self.addParameter(ParameterVector(self.INPUT, 'Input layer',
                          [ParameterVector.VECTOR_TYPE_POINT]))

        self.addOutput(OutputVector(self.OUTPUT, 'Delaunay triangulation'))
Example #20
0
    def defineCharacteristics(self):
        self.name = 'From UTM 29N ED50 to ETR89-PTTM06'
        self.group = 'Vector Datum Transformations'

        self.addParameter(
            ParameterVector(self.INPUT, 'Input layer',
                            [ParameterVector.VECTOR_TYPE_ANY]))
        self.addOutput(OutputVector(self.OUTPUT, 'Output layer'))
Example #21
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"))
Example #22
0
    def buildParametersDialog(self):
        for input in self.process.inputs:
            inputType = type(input)
            if inputType == VectorInput:
                self.addParameter(
                    ParameterVector(str(input.identifier), str(input.title),
                                    ParameterVector.VECTOR_TYPE_ANY,
                                    input.minOccurs == 0))
            elif inputType == MultipleVectorInput:
                self.addParameter(
                    ParameterMultipleInput(str(input.identifier),
                                           str(input.title),
                                           ParameterVector.VECTOR_TYPE_ANY,
                                           input.minOccurs == 0))
            elif inputType == StringInput:
                self.addParameter(
                    ParameterString(str(input.identifier), str(input.title)))
            elif inputType == TextInput:
                self.addParameter(
                    ParameterString(str(input.identifier), str(input.title)))
            elif inputType == RasterInput:
                self.addParameter(
                    ParameterRaster(str(input.identifier), str(input.title),
                                    input.minOccurs == 0))
            elif inputType == MultipleRasterInput:
                self.addParameter(
                    ParameterMultipleInput(str(input.identifier),
                                           str(input.title),
                                           ParameterMultipleInput.TYPE_RASTER,
                                           input.minOccurs == 0))
            elif inputType == FileInput:
                #self.addParameter(ParameterFile(str(input.identifier), str(input.title), False, input.minOccurs == 0))
                self.addParameter(
                    ParameterFile(str(input.identifier), str(input.title)))
            elif inputType == MultipleFileInput:
                pass  #Not supported
            elif inputType == SelectionInput:
                self.addParameter(
                    ParameterSelection(str(input.identifier), str(input.title),
                                       input.valList))
            elif inputType == ExtentInput:
                self.addParameter(
                    ParameterExtent(str(input.identifier), str(input.title)))
            elif inputType == CrsInput:
                self.addParameter(
                    ParameterCrs(str(input.identifier), "Projection", None))

        for output in self.process.outputs:
            outputType = type(output)
            if outputType == VectorOutput:
                self.addOutput(
                    OutputVector(str(output.identifier), str(output.title)))
            elif outputType == RasterOutput:
                self.addOutput(
                    OutputRaster(str(output.identifier), str(output.title)))
            elif outputType == StringOutput:
                self.addOutput(
                    OutputString(str(output.identifier), str(output.title)))
Example #23
0
    def defineCharacteristics(self):
        self.name = 'From Datum Lisboa to ETRS89-PTTM06'
        self.group = 'Vector Datum Transformations'

        self.addParameter(ParameterVector(self.INPUT, 'Input layer',
                          [ParameterVector.VECTOR_TYPE_ANY]))
        self.addParameter(ParameterSelection(self.GRID, 'NTv2 Grid to use (source)',
                          self.GRID_OPTIONS))
        self.addOutput(OutputVector(self.OUTPUT, 'Output layer'))
Example #24
0
    def defineCharacteristics(self):
        self.name = 'Polygon centroids'
        self.group = 'Vector geometry tools'

        self.addParameter(
            ParameterVector(self.INPUT_LAYER, 'Input layer',
                            [ParameterVector.VECTOR_TYPE_POLYGON]))

        self.addOutput(OutputVector(self.OUTPUT_LAYER, 'Output layer'))
Example #25
0
    def defineCharacteristics(self):
        self.name = "Delaunay triangulation"
        self.group = "Vector geometry tools"

        self.addParameter(
            ParameterVector(self.INPUT, "Input layer",
                            [ParameterVector.VECTOR_TYPE_POINT]))

        self.addOutput(OutputVector(self.OUTPUT, "Delaunay triangulation"))
Example #26
0
 def defineCharacteristics(self):
     self.name = 'Create equivalent numerical field'
     self.group = 'Vector table tools'
     self.addParameter(
         ParameterVector(self.INPUT, 'Input layer',
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterTableField(self.FIELD, 'Class field', self.INPUT))
     self.addOutput(OutputVector(self.OUTPUT, 'Output layer'))
 def defineCharacteristics(self):
     self.name = "Create equivalent numerical field"
     self.group = "Vector table tools"
     self.addParameter(
         ParameterVector(self.INPUT, "Input layer",
                         [ParameterVector.VECTOR_TYPE_ANY]))
     self.addParameter(
         ParameterTableField(self.FIELD, "Class field", self.INPUT))
     self.addOutput(OutputVector(self.OUTPUT, "Output layer"))
    def defineCharacteristics(self):
        self.name = "Singleparts to multipart"
        self.group = "Vector geometry tools"

        self.addParameter(ParameterVector(self.INPUT, "Input layer"))
        self.addParameter(
            ParameterTableField(self.FIELD, "Unique ID field", self.INPUT))

        self.addOutput(OutputVector(self.OUTPUT, "Output layer"))
    def defineCharacteristics(self):
        self.name = 'Singleparts to multipart'
        self.group = 'Vector geometry tools'

        self.addParameter(ParameterVector(self.INPUT, 'Input layer'))
        self.addParameter(ParameterTableField(self.FIELD, 'Unique ID field',
                          self.INPUT))

        self.addOutput(OutputVector(self.OUTPUT, 'Output layer'))
Example #30
0
 def defineCharacteristics(self):
     self.name = "las2iso"
     self.group = "Tools"
     self.addParameter(ParameterFile(las2iso.INPUT, "Input las layer"))
     self.addParameter(ParameterNumber(las2iso.INTERVAL, "Interval between isolines", 0, None, 10.0))
     self.addParameter(ParameterNumber(las2iso.CLEAN, "Clean isolines shorter than (0 = do not clean)", None, None, 0.0))
     self.addParameter(ParameterNumber(las2iso.SIMPLIFY, "simplify segments shorter than (0 = do not simplify)", None, None, 0.0))
     self.addOutput(OutputVector(las2iso.OUTPUT, "Output isolines"))
     self.addCommonParameters()