# See ../README.md for a description of the file format

tests:

  - name: Centroid # Human readable identifier
    algorithm: native:centroids # Algorithm name
    params: # A list of parameters
      INPUT:
        type: vector    # Param is a vector layer
        name: polys.gml # file name
    results: # A map of results (only one here)
      OUTPUT:
        type: vector   # Expected result is a vector layer
        name: expected/polys_centroid.gml # The relative filepath from the processing testdata directory
        compare:
          geometry:
            precision: 7

  - name: Centroid with non-ascii input
    algorithm: native:centroids
    params:
      INPUT:
        type: vector
        name: polys_non_ascii_ñññ.gml
    results:
      OUTPUT:
        type: vector
        name: expected/polys_centroid.gml
        compare:
          geometry:
            precision: 7

  - name: Aggregate all
    algorithm: qgis:aggregate
    params:
      INPUT:
        name: dissolve_polys.gml
        type: vector
      GROUP_BY: 'NULL'
      AGGREGATES:
        [{
          input: 'fid',
          aggregate: 'concatenate',
          delimiter: ',',
          name: 'fids',
          type: 10,
          length: 255,
          precision: 0
        }, {
          input: 'name',
          aggregate: 'concatenate_unique',
          delimiter: ',',
          name: 'name',
          type: 10,
          length: 255,
          precision: 0
        }, {
          input: 'intval',
          aggregate: 'sum',
          delimiter: '',
          name: 'intval',
          type: 2,
          length: 0,
          precision: 0
        }, {
          aggregate: 'mean',
          input: 'floatval',
          type: 6,
          delimiter: '',
          name: 'floatval',
          length: 0,
          precision: 0
        }]
    results:
      OUTPUT:
        name: expected/aggregate_all.gml
        type: vector

  - name: Aggregate using field
    algorithm: qgis:aggregate
    params:
      INPUT:
        name: dissolve_polys.gml
        type: vector
      GROUP_BY: '"name"'
      AGGREGATES:
        [{
          input: 'fid',
          aggregate: 'concatenate',
          delimiter: ',',
          name: 'fids',
          type: 10,
          length: 50,
          precision: 0
        }, {
          input: 'name',
          aggregate: 'first_value',
          delimiter: ',',
          name: 'name',
          type: 10,
          length: 2,
          precision: 0
        }, {
          input: 'intval',
          aggregate: 'sum',
          delimiter: '',
          name: 'intval',
          type: 2,
          length: 0,
          precision: 0
        }, {
          input: 'floatval',
          aggregate: 'mean',
          delimiter: '',
          name: 'floatval',
          type: 6,
          length: 0,
          precision: 0
        }]
    results:
      OUTPUT:
        name: expected/aggregate_field.gml
        type: vector

  - algorithm: qgis:aggregate
    name: Aggregate using two fields
    params:
      INPUT:
        name: dissolve_polys.gml
        type: vector
      GROUP_BY: array("intval", "name")
      AGGREGATES:
        [{
          input: 'fid',
          aggregate: 'concatenate',
          delimiter: ',',
          name: 'fids',
          type: 10,
          length: 80,
          precision: 0
        }, {
          input: 'name',
          aggregate: 'first_value',
          delimiter: ',',
          name: 'name',
          type: 10,
          length: 2,
          precision: 0
        }, {
          input: 'intval',
          aggregate: 'first_value',
          delimiter: '',
          name: 'intval',
          type: 2,
          length: 0,
          precision: 0
        }, {
          input: 'floatval',
          aggregate: 'mean',
          delimiter: '',
          name: 'floatval',
          type: 6,
          length: 0,
          precision: 0
        }]
    results:
      OUTPUT:
        name: expected/aggregate_two_fields.gml
        type: vector

  - name: Aggregate points
    algorithm: qgis:aggregate
    params:
      INPUT:
        name: points.gml
        type: vector
      GROUP_BY: '"id2"'
      AGGREGATES:
        [{
          input: 'fid',
          aggregate: 'concatenate',
          delimiter: ',',
          name: 'fids',
          type: 10,
          length: 50,
          precision: 0
        }, {
          input: 'to_string("id")',
          aggregate: 'concatenate',
          delimiter: ',',
          name: 'ids',
          type: 10,
          length: 50,
          precision: 0
        }, {
          input: 'id2',
          aggregate: 'first_value',
          delimiter: '',
          name: 'id2',
          type: 6,
          length: 0,
          precision: 0
        }]
    results:
      OUTPUT:
        name: expected/aggregate_points.gml
        type: vector

  - name: Aggregate lines
    algorithm: qgis:aggregate
    params:
      INPUT:
        name: lines.gml
        type: vector
      GROUP_BY: 'NULL'
      AGGREGATES:
        [{
          input: 'fid',
          aggregate: 'concatenate',
          delimiter: ',',
          name: 'fids',
          type: 10,
          length: 255,
          precision: 0
        }]
    results:
      OUTPUT:
        name: expected/aggregate_lines.gml
        type: vector

  - name: Delete Holes
    algorithm: native:deleteholes
    params:
    - name: polys.gml
      type: vector
    results:
      OUTPUT:
        name: expected/polys_deleteholes.gml
        type: vector

  - algorithm: native:clip
    name: Clip lines by polygons
    params:
      INPUT:
        name: custom/lines2.gml
        type: vector
      OVERLAY:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/clip_lines_by_polygon.gml
        type: vector

  - algorithm: native:clip
    name: Clip lines by multipolygon
    params:
      INPUT:
        name: lines.gml
        type: vector
      OVERLAY:
        name: multipolys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/clip_lines_by_multipolygon.gml
        type: vector

  - algorithm: native:clip
    name: Clip polygons by multipolygons
    params:
      INPUT:
        name: polys.gml
        type: vector
      OVERLAY:
        name: multipolys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/clip_polys_by_multipolygon.gml
        type: vector

  - algorithm: native:clip
    name: Clip multipolygons by polygons
    params:
      INPUT:
        name: multipolys.gml
        type: vector
      OVERLAY:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/clip_multipolygons_by_polygons.gml
        type: vector

  - algorithm: native:clip
    name: Clip points by polygons
    params:
      INPUT:
        name: points.gml
        type: vector
      OVERLAY:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/clip_points_by_polygons.gml
        type: vector

  - algorithm: native:clip
    name: Clip points by multipolygons
    params:
      INPUT:
        name: points.gml
        type: vector
      OVERLAY:
        name: multipolys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/clip_points_by_multipolygons.gml
        type: vector

#  # These datasets should produce a geometry collection and not a polygon only
#  # dataset. If the algorithm is fixed, a new test should be introduced to
#  # check this behavior.
#  # This test should stay in place because for shapefiles there should always
#  # be a polygon result created since it does not support geometry collections.
  - algorithm: qgis:intersection
    name: Intersects multipolygons with polygons
    params:
      INPUT:
        name: multipolys.gml
        type: vector
      OVERLAY:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/intersection_collection_fallback.shp
        type: vector

  - name: Densify geometries
    algorithm: native:densifygeometries
    params:
      INPUT:
        name: multipolys.gml
        type: vector
      VERTICES: 4
    results:
      OUTPUT:
        name: expected/multipolys_densify.gml
        type: vector

  - algorithm: qgis:densifygeometriesgivenaninterval
    name: Densify polygons by interval
    params:
      INPUT:
        name: polys.gml
        type: vector
      INTERVAL: 1.0
    results:
      OUTPUT:
        name: expected/densify_by_interval_polys.gml
        type: vector

  - name: Polygons to Lines
    algorithm: qgis:polygonstolines
    params:
    - name: multipolys.gml
      type: vector
    results:
      OUTPUT:
        name: expected/polys_to_lines.gml
        type: vector
        compare:
          fields:
            fid: skip

  - algorithm: qgis:basicstatisticsforfields
    name: Basic statistics for numeric fields
    params:
    - name: multipolys.gml
      type: vector
    - 'Bfloatval'
    results:
      OUTPUT_HTML_FILE:
        name: basic_statistics_numeric_float.html
        type: regex
        rules:
          - 'Analyzed field: Bfloatval'
          - 'Count: 3'
          - 'Unique values: 3'
          - 'Minimum value: -0.123'
          - 'Maximum value: 0.123'
          - 'Range: 0.246'
          - 'Sum: 0.0'
          - 'Mean value: 0.0'
          - 'Median value: 0.0'
          - 'Standard deviation: 0.100429079454'
          - 'Coefficient of Variation: 0'
          - 'Minority \(rarest occurring value\): -0.123'
          - 'Majority \(most frequently occurring value\): -0.123'
          - 'First quartile: -0.0615'
          - 'Third quartile: 0.0615'
          - 'NULL \(missing\) values: 1'
          - 'Interquartile Range \(IQR\): 0.123'

  - algorithm: qgis:basicstatisticsforfields
    name: Basic statistics for text fields
    params:
    - name: multipolys.gml
      type: vector
    - 'Bname'
    results:
      OUTPUT_HTML_FILE:
        name: expected/basic_statistics_string.html
        type: regex
        rules:
          - 'Analyzed field: Bname'
          - 'Count: 4'
          - 'Unique values: 2'
          - 'Minimum value: Test'
          - 'Maximum value: Test'
          - 'Minimum length: 0'
          - 'Maximum length: 4'
          - 'Mean length: 3.0'
          - 'NULL \(missing\) values: 1'

  - algorithm: qgis:listuniquevalues
    name: Unique values
    params:
      INPUT:
        name: points.gml
        type: vector
      FIELDS: id2
    results:
      OUTPUT:
        name: expected/unique_values.gml
        type: vector
        pk:
        - id2

  - algorithm: qgis:listuniquevalues
    name: Unique values (multiple fields)
    params:
      FIELDS:
      - name
      - intval
      INPUT:
        name: dissolve_polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/unique_values_multiple.gml
        type: vector
        compare:
          fields:
            fid: skip
        pk:
        - name
        - intval

  - algorithm: native:addautoincrementalfield
    name: Add autoincremental field
    params:
      INPUT:
        name: points.gml
        type: vector
    results:
      OUTPUT:
        name: expected/autoincrement_field.gml
        type: vector

  - algorithm: native:addautoincrementalfield
    name: Add autoincremental field with start value
    params:
      FIELD_NAME: AUTO
      INPUT:
        name: points.gml
        type: vector
      START: 10
    results:
      OUTPUT:
        name: expected/autoincrement_field_start.gml
        type: vector

  - algorithm: native:addautoincrementalfield
    name: Add autoincremental field with name
    params:
      FIELD_NAME: my_field
      INPUT:
        name: points.gml
        type: vector
      START: 0
    results:
      OUTPUT:
        name: expected/autoincrement_field_field_name.gml
        type: vector

  - algorithm: native:addautoincrementalfield
    name: Add incremental field (grouped)
    params:
      FIELD_NAME: AUTO
      GROUP_FIELDS:
      - intval
      - name
      INPUT:
        name: dissolve_polys.gml
        type: vector
      START: 6
    results:
      OUTPUT:
        name: expected/autoincrement_grouped.gml
        type: vector

  - algorithm: native:addautoincrementalfield
    name: Add incremental field (with sorting)
    params:
      FIELD_NAME: AUTO
      INPUT:
        name: points.gml
        type: vector
      SORT_ASCENDING: true
      SORT_EXPRESSION: 99-id
      SORT_NULLS_FIRST: false
      START: 0
    results:
      OUTPUT:
        name: expected/autoincrement_sort.gml
        type: vector

  - algorithm: native:dissolve
    name: Dissolve using field
    params:
      FIELD: name
      INPUT:
        name: dissolve_polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/dissolve_field.gml
        type: vector

  - algorithm: native:dissolve
    name: Dissolve using two fields
    params:
      FIELD: intval;name
      INPUT:
        name: dissolve_polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/dissolve_two_fields.gml
        type: vector

  - name: Dissolve with geometries reported as valid but as invalid with isGeosValid
    algorithm: native:dissolve
    params:
      INPUT:
        name: custom/innerRingTouchesOuterRing.gml
        type: vector
    results:
      OUTPUT:
        type: vector
        name: expected/innerRingTouchesOuterRing_output.gml
        compare:
          geometry:
            precision: 0

  - name: Dissolve with NULL geometries
    algorithm: native:dissolve
    params:
      INPUT:
        name: custom/nullGeometryDissolve.gml
        type: vector
    results:
      OUTPUT:
        type: vector
        name: expected/nullGeometryDissolve_output.gml
        compare:
          geometry:
            precision: 7

  - name: Dissolve with invalid geometries
    algorithm: native:dissolve
    skipInvalid: true
    params:
      INPUT:
        name: custom/PolygonDissolveTest.gml
        type: vector
    results:
      OUTPUT:
        type: vector
        name: expected/PolygonDissolveTest_output.gml
        compare:
          geometry:
            precision: 7

  - algorithm: native:buffer
    name: Basic polygon buffer
    params:
      DISSOLVE: 'False'
      DISTANCE: 0.5
      INPUT:
        name: polys.gml
        type: vector
      SEGMENTS: 5
    results:
      OUTPUT:
        name: expected/buffer_polys.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:buffer
    name: Polygon buffer with dissolve
    params:
      DISSOLVE: 'True'
      DISTANCE: 0.5
      INPUT:
        name: polys.gml
        type: vector
      SEGMENTS: 5
    results:
      OUTPUT:
        name: expected/buffer_polys_dissolve.gml
        type: vector
        compare:
          geometry:
            precision: 7
          fields:
            fid: skip
            name: skip
            intval: skip
            floatval: skip

  - algorithm: qgis:rectanglesovalsdiamondsfixed
    name: Create fixed distance rectange buffers around points
    params:
      HEIGHT: 0.25
      INPUT:
        name: points.gml
        type: vector
      ROTATION: 45
      SEGMENTS: 36
      SHAPE: 0
      WIDTH: 0.5
    results:
      OUTPUT:
        name: expected/rectanglesovalsdiamondsfixed.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: qgis:rectanglesovalsdiamondsvariable
    name: Rectangles ovals diamonds variable
    params:
      HEIGHT: id
      INPUT:
        name: points.gml
        type: vector
      ROTATION: id2
      SEGMENTS: 1
      SHAPE: 0
      WIDTH: id
    results:
      OUTPUT:
        name: expected/rectanglesovalsdiamondsvariable.gml
        type: vector

  - algorithm: native:mergelines
    name: Merge lines algorithm
    params:
      INPUT:
        name: multilines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/merge_lines.gml
        type: vector

  - algorithm: native:mergevectorlayers
    name: Merge points
    params:
      LAYERS:
        params:
        - name: custom/points.shp
          type: vector
        - name: custom/pointszm.shp
          type: vector
        type: multi
    results:
      OUTPUT:
        name: expected/merged_points.gml
        type: vector
        compare:
          fields:
            fid: skip
            path: skip

  - algorithm: native:mergevectorlayers
    name: Merge polygons
    params:
      LAYERS:
        params:
        - name: multipolys.gml
          type: vector
        - name: polys.gml
          type: vector
        type: multi
    results:
      OUTPUT:
        name: expected/merged_polys.gml
        type: vector
        compare:
          fields:
            fid: skip
            path: skip

  - algorithm: native:mergevectorlayers
    name: Merge polygons with CRS
    params:
      CRS: EPSG:3785
      LAYERS:
        params:
        - name: multipolys.gml
          type: vector
        - name: polys.gml
          type: vector
        type: multi
    results:
      OUTPUT:
        name: expected/merged_polys_crs.gml
        type: vector
        compare:
          fields:
            fid: skip
            layer: skip
            path: skip
          geometry:
            precision: 0

  - algorithm: native:multiparttosingleparts
    name: Multiparts to singleparts
    params:
      INPUT:
        name: multilines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/multi_to_single.gml
        type: vector

  - algorithm: native:boundingboxes
    name: Bounding boxes for lines
    params:
      INPUT:
        name: lines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/lines_bounds.gml
        type: vector

  - algorithm: native:boundingboxes
    name: Bounding boxes for multilines
    params:
      INPUT:
        name: multilines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/multiline_bounds.gml
        type: vector

  - algorithm: native:boundingboxes
    name: Bounding boxes for multipolygons
    params:
      INPUT:
        name: multipolys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/multipoly_bounds.gml
        type: vector

  - algorithm: native:boundingboxes
    name: Bounding boxes for points
    params:
      INPUT:
        name: points.gml
        type: vector
    results:
      OUTPUT:
        name: expected/point_bounds.gml
        type: vector

  - algorithm: native:boundingboxes
    name: Bounding boxes for polygons
    params:
      INPUT:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/poly_bounds.gml
        type: vector

  - algorithm: native:boundingboxes
    name: Bounding boxes for multipoints
    params:
      INPUT:
        name: multipoints.gml
        type: vector
    results:
      OUTPUT:
        name: expected/multipoint_bounds.gml
        type: vector

  - algorithm: native:boundary
    name: Polygon boundary
    params:
      INPUT:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/poly_boundary.gml
        type: vector

  - algorithm: native:boundary
    name: Multipoly boundary
    params:
      INPUT:
        name: multipolys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/multipoly_boundary.gml
        type: vector

  - algorithm: native:boundary
    name: Line boundary
    params:
      INPUT:
        name: lines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/lines_boundary.gml
        type: vector

  - algorithm: native:boundary
    name: Multiline boundary
    params:
      INPUT:
        name: multilines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/multiline_boundary.gml
        type: vector

  - algorithm: qgis:setmvalue
    name: Set M Value
    params:
      INPUT:
        name: points.gml
        type: vector
      M_VALUE: 7
    results:
      OUTPUT:
        name: expected/set_m_value.shp
        type: vector

  - algorithm: qgis:setzvalue
    name: Set Z Value
    params:
      INPUT:
        name: points.gml
        type: vector
      Z_VALUE: 6
    results:
      OUTPUT:
        name: expected/set_z_value.shp
        type: vector

  - algorithm: native:dropmzvalues
    name: Drop M Value
    params:
      INPUT:
        name: custom/pointszm.shp
        type: vector
      DROP_Z_VALUES: False
      DROP_M_VALUES: True
    results:
      OUTPUT:
        name: expected/m_dropped.shp
        type: vector

  - algorithm: native:dropmzvalues
    name: Drop Z Value
    params:
      INPUT:
        name: custom/pointszm.shp
        type: vector
      DROP_Z_VALUES: True
      DROP_M_VALUES: False
    results:
      OUTPUT:
        name: expected/z_dropped.shp
        type: vector

  - algorithm: native:dropmzvalues
    name: Drop ZM Value
    params:
      INPUT:
        name: custom/pointszm.shp
        type: vector
      DROP_Z_VALUES: True
      DROP_M_VALUES: True
    results:
      OUTPUT:
        name: expected/zm_dropped.shp
        type: vector

  - algorithm: native:explodehstorefield
    name: Test explode HStore field with all keys
    params:
      EXPECTED_FIELDS: ''
      FIELD: hstore
      INPUT:
        name: custom/hstore.gml
        type: vector
    results:
      OUTPUT:
        name: expected/hstore_all_keys.gml
        type: vector

  - algorithm: native:explodehstorefield
    name: Test explode HStore field with 2 fields
    params:
      EXPECTED_FIELDS: internet_access,cuisine,doesntexist
      FIELD: hstore
      INPUT:
        name: custom/hstore.gml
        type: vector
    results:
      OUTPUT:
        name: expected/hstore_two_fields.gml
        type: vector

  - algorithm: native:pointonsurface
    name: Point on polygon surface
    params:
      INPUT:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/point_on_poly.gml
        type: vector

  - algorithm: native:pointonsurface
    name: Point on all parts of multi polygon surface
    params:
      INPUT:
        name: multipolys.gml
        type: vector
      ALL_PARTS: true
    results:
      OUTPUT:
        name: expected/point_on_multipoly.gml
        type: vector

  - algorithm: qgis:pointonsurface
    name: Point on multipoint surface
    params:
      INPUT:
        name: multipoints.gml
        type: vector
    results:
      OUTPUT:
        name: expected/point_on_multipoint.gml
        type: vector

  - algorithm: qgis:pointonsurface
    name: Point on line surface
    params:
      INPUT:
        name: lines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/point_on_line.gml
        type: vector

  - algorithm: native:reverselinedirection
    name: Reverse line direction
    params:
      INPUT:
        name: lines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/lines_reversed.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:reverselinedirection
    name: Reverse multiline direction
    params:
      INPUT:
        name: multilines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/reverse_multiline.gml
        type: vector

  - algorithm: native:offsetline
    name: Offset line positive
    params:
      DISTANCE: 1.0
      INPUT:
        name: lines.gml
        type: vector
      JOIN_STYLE: '0'
      MITER_LIMIT: 2
      SEGMENTS: 8
    results:
      OUTPUT:
        name: expected/line_offset_round_positive.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:offsetline
    name: Offset line negative
    params:
      DISTANCE: -1.0
      INPUT:
        name: lines.gml
        type: vector
      JOIN_STYLE: '0'
      MITER_LIMIT: 2
      SEGMENTS: 8
    results:
      OUTPUT:
        name: expected/line_offset_round_negative.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:offsetline
    name: Offset line miter
    params:
      DISTANCE: 1.0
      INPUT:
        name: lines.gml
        type: vector
      JOIN_STYLE: '1'
      MITER_LIMIT: 2
      SEGMENTS: 4
    results:
      OUTPUT:
        name: expected/line_offset_miter.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:offsetline
    name: Offset line bevel
    params:
      DISTANCE: 1.0
      INPUT:
        name: lines.gml
        type: vector
      JOIN_STYLE: '2'
      MITER_LIMIT: 2
      SEGMENTS: 8
    results:
      OUTPUT:
        name: expected/line_offset_bevel.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:offsetline
    name: Offset multilines
    params:
      DISTANCE: 1.0
      INPUT:
        name: multilines.gml
        type: vector
      JOIN_STYLE: '0'
      MITER_LIMIT: 2
      SEGMENTS: 8
    results:
      OUTPUT:
        name: expected/multiline_offset.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:buffer
    name: Buffer polygons using bevel
    params:
      DISSOLVE: false
      DISTANCE: 1.0
      END_CAP_STYLE: '0'
      INPUT:
        name: polys.gml
        type: vector
      JOIN_STYLE: '2'
      MITER_LIMIT: 2
      SEGMENTS: 5
    results:
      OUTPUT:
        name: expected/buffer_polys_bevel.gml
        type: vector

  - algorithm: native:buffer
    name: Buffer polygons using miter
    params:
      DISSOLVE: false
      DISTANCE: 1.0
      END_CAP_STYLE: '0'
      INPUT:
        name: polys.gml
        type: vector
      JOIN_STYLE: '1'
      MITER_LIMIT: 2
      SEGMENTS: 5
    results:
      OUTPUT:
        name: expected/buffer_polys_miter.gml
        type: vector

  - algorithm: native:buffer
    name: Buffer lines
    params:
      DISSOLVE: false
      DISTANCE: 1.0
      END_CAP_STYLE: '0'
      INPUT:
        name: lines.gml
        type: vector
      JOIN_STYLE: '0'
      MITER_LIMIT: 2
      SEGMENTS: 5
    results:
      OUTPUT:
        name: expected/buffer_lines.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:buffer
    name: Buffer lines (flat)
    params:
      DISSOLVE: false
      DISTANCE: 1.0
      END_CAP_STYLE: '1'
      INPUT:
        name: lines.gml
        type: vector
      JOIN_STYLE: '0'
      MITER_LIMIT: 2
      SEGMENTS: 5
    results:
      OUTPUT:
        name: expected/buffer_lines_flat.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:buffer
    name: Buffer lines (square)
    params:
      DISSOLVE: false
      DISTANCE: 1.0
      END_CAP_STYLE: '2'
      INPUT:
        name: lines.gml
        type: vector
      JOIN_STYLE: '0'
      MITER_LIMIT: 2
      SEGMENTS: 5
    results:
      OUTPUT:
        name: expected/buffer_lines_square.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:centroids
    name: Centroid (lines)
    params:
      INPUT:
        name: lines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/centroid_lines.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:centroids
    name: Centroid (multilines)
    params:
      INPUT:
        name: multilines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/centroid_multilines.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:centroids
    name: Centroid (multipoints)
    params:
      INPUT:
        name: multipoints.gml
        type: vector
    results:
      OUTPUT:
        name: expected/centroid_multipoint.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:centroids
    name: Centroid (multipolygons)
    params:
      INPUT:
        name: multipolys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/centroid_multipolys.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:centroids
    name: Centroid (multipolygons)
    params:
      INPUT:
        name: multipolys.gml
        type: vector
      ALL_PARTS: true
    results:
      OUTPUT:
        name: expected/centroid_multipoly_all_parts.gml
        type: vector

  - algorithm: native:centroids
    name: Centroid (points)
    params:
      INPUT:
        name: points.gml
        type: vector
    results:
      OUTPUT:
        name: expected/centroid_points.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:centroids
    name: Centroid (polygons)
    params:
      INPUT:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/centroid_polys.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:translategeometry
    name: Lines translated
    params:
      DELTA_X: 0.1
      DELTA_Y: -0.2
      INPUT:
        name: lines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/lines_translated.gml
        type: vector

  - algorithm: native:translategeometry
    name: Translate Z/M
    params:
      DELTA_M: 4.0
      DELTA_X: 0.0
      DELTA_Y: 0.0
      DELTA_Z: 3.0
      INPUT:
        name: custom/pointszm.shp
        type: vector
    results:
      OUTPUT:
        name: expected/translate_z_m.shp
        type: vector

  - algorithm: qgis:singlesidedbuffer
    name: Single sided buffer lines (left, round)
    params:
      DISTANCE: 1.0
      INPUT:
        name: lines.gml
        type: vector
      JOIN_STYLE: '0'
      MITER_LIMIT: 2
      SEGMENTS: 8
      SIDE: '0'
    results:
      OUTPUT:
        name: expected/single_sided_buffer_line.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: qgis:singlesidedbuffer
    name: Single sided buffer lines (Right, miter)
    params:
      DISTANCE: 1.0
      INPUT:
        name: lines.gml
        type: vector
      JOIN_STYLE: '1'
      MITER_LIMIT: 2
      SEGMENTS: 8
      SIDE: '1'
    results:
      OUTPUT:
        name: expected/single_sided_buffer_line_miter.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: qgis:singlesidedbuffer
    name: Single sided buffer multiline (bevel)
    params:
      DISTANCE: 1.0
      INPUT:
        name: multilines.gml
        type: vector
      JOIN_STYLE: '2'
      MITER_LIMIT: 2
      SEGMENTS: 8
      SIDE: '0'
    results:
      OUTPUT:
        name: expected/single_sided_buffer_multiline_bevel.gml
        type: vector

  - algorithm: qgis:extractvertices
    name: Extract vertices from multipolygons
    params:
      INPUT:
        name: multipolys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/extract_nodes_multipolys.gml
        type: vector
        compare:
          fields:
            distance:
              precision: 7
            angle:
              precision: 7

  - algorithm: qgis:extractvertices
    name: Extract vertices from polygons
    params:
      INPUT:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/extract_nodes_polys.gml
        type: vector
        compare:
          fields:
            distance:
              precision: 7
            angle:
              precision: 7

  - algorithm: qgis:extractvertices
    name: Extract vertices from multilines
    params:
      INPUT:
        name: multilines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/extract_nodes_multilines.gml
        type: vector
        compare:
          fields:
            distance:
              precision: 7
            angle:
              precision: 7

  - algorithm: qgis:extractvertices
    name: Extract vertices from lines
    params:
      INPUT:
        name: lines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/extract_nodes_lines.gml
        type: vector
        compare:
          fields:
            distance:
              precision: 7
            angle:
              precision: 7

  - algorithm: native:simplifygeometries
    name: Simplify (lines)
    params:
      INPUT:
        name: lines.gml
        type: vector
      TOLERANCE: 1.0
    results:
      OUTPUT:
        name: expected/simplify_lines.gml
        type: vector

  - algorithm: native:simplifygeometries
    name: Simplify (multilines)
    params:
      INPUT:
        name: multilines.gml
        type: vector
      TOLERANCE: 1.0
    results:
      OUTPUT:
        name: expected/simplify_multilines.gml
        type: vector

  - algorithm: native:simplifygeometries
    name: Simplify (visval)
    params:
      INPUT:
        name: simplify_lines.gml
        type: vector
      METHOD: '2'
      TOLERANCE: 1.0
    results:
      OUTPUT:
        name: expected/simplify_vis_lines.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:simplifygeometries
    name: Simplify (grid)
    params:
      INPUT:
        name: simplify_lines.gml
        type: vector
      METHOD: '1'
      TOLERANCE: 5.0
    results:
      OUTPUT:
        name: expected/simplify_grid_lines.gml
        type: vector
        compare:
          geometry:
            precision: 7

  - algorithm: native:smoothgeometry
    name: Smooth (lines)
    params:
      INPUT:
        name: lines.gml
        type: vector
      ITERATIONS: 1
      MAX_ANGLE: 180.0
      OFFSET: 0.25
    results:
      OUTPUT:
        name: expected/smoothed_lines.gml
        type: vector

  - algorithm: native:smoothgeometry
    name: Smooth (lines, with max angle)
    params:
      INPUT:
        name: lines.gml
        type: vector
      ITERATIONS: 1
      MAX_ANGLE: 60.0
      OFFSET: 0.25
    results:
      OUTPUT:
        name: expected/smoothed_lines_max_angle.gml
        type: vector

  - algorithm: qgis:exportaddgeometrycolumns
    name: Add Geometry PointZ
    params:
      CALC_METHOD: '0'
      INPUT:
        name: pointsz.gml
        type: vector
    results:
      OUTPUT:
        name: expected/add_geometry_pointz.gml
        type: vector

  - algorithm: qgis:exportaddgeometrycolumns
    name: Export line info
    params:
      CALC_METHOD: 0
      INPUT:
        name: lines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/export_line_info.gml
        type: vector

  - algorithm: qgis:exportaddgeometrycolumns
    name: Export multiline info
    params:
      CALC_METHOD: 0
      INPUT:
        name: multilines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/export_multiline_info.gml
        type: vector

  - algorithm: qgis:exportaddgeometrycolumns
    name: Export multipoint info
    params:
      CALC_METHOD: 0
      INPUT:
        name: multipoints.gml|layername=multipoints
        type: vector
    results:
      OUTPUT:
        name: expected/add_geometry_info_multipoint.gml
        type: vector

  - algorithm: qgis:texttofloat
    name: Text to float
    params:
      FIELD: 'text_float'
      INPUT:
        name: custom/text_to_float.gml
        type: vector
    results:
      OUTPUT:
        name: expected/text_to_float.gml
        type: vector

  - algorithm: qgis:countpointsinpolygon
    name: Count points in polygon
    params:
      FIELD: NUMPOINTS
      POINTS:
        name: points_in_polys.gml
        type: vector
      POLYGONS:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/points_in_polys.gml
        type: vector

  - algorithm: native:aspect
    name: Aspect from QGIS analysis library
    params:
      INPUT:
        name: dem.tif
        type: raster
      Z_FACTOR: 1.0
    results:
      OUTPUT:
        hash:
        - 762865ee485a6736d188402aa10e6fd38a812a9e45a7dd2d4885a63a
        - f6a8e64647ae93a94f2a4945add8986526a7a07bc85849f3690d15b2
        type: rasterhash

  - algorithm: native:slope
    name: Slope from QGIS analysis library
    params:
      INPUT:
        name: dem.tif
        type: raster
      Z_FACTOR: 1.0
    results:
      OUTPUT:
        hash:
        - 151ea76a21b286c16567eb6b4b692925a84145b65561a0017effb1a1
        - 177475642c57428b395bc0a1e7e86fc1cfd4d86ffc19f31ff8bc964d
        type: rasterhash

  - algorithm: native:ruggednessindex
    name: Ruggedness index from QGIS analysis library
    params:
      INPUT:
        name: dem.tif
        type: raster
      Z_FACTOR: 1.0
    results:
      OUTPUT:
        hash: ff630246e8dc19c7217d81261c6b64f965c17fa04d3e41d7979c1f1e
        type: rasterhash

  - algorithm: native:hillshade
    name: Hillshade from QGIS analysis library
    params:
      AZIMUTH: 300.0
      INPUT:
        name: dem.tif
        type: raster
      V_ANGLE: 40.0
      Z_FACTOR: 1.0
    results:
      OUTPUT:
        hash:
        - 58365b3715b925d6286e7f082ebd9c2a20f09fa1c922176d3f238002
        - 75cca4c1a870a1e21185a2d85b33b6d9958a69fc6ebb04e4d6ceb8a3
        - c05cd8dbfb00200a3803dcdc74ad177588eb8379867c4046463f73f1
        - 8f59f545b5df01f213b7a2233eb364d05b5801676d1f4285ad1225a1
        type: rasterhash

  - algorithm: qgis:relief
    name: Relief (automatic colors generation)
    params:
      AUTO_COLORS: true
      INPUT:
        name: dem.tif
        type: raster
      Z_FACTOR: 1.0
    results:
      OUTPUT:
        hash:
        - 7fe0e0174185fd743e23760f33615adf10f771b4275f320db6f7f4f8
        - 094a2d0dea250690084e0812bf1e8f8666043d17d6a71de278810bb9
        type: rasterhash

  - algorithm: qgis:relief
    name: Relief (custom colors)
    params:
      AUTO_COLORS: false
      COLORS: 85.000000, 104.436508, 7, 165, 144;104.436508, 104.436508, 12, 221, 162;104.436508,
        104.436508, 33, 252, 183;104.436508, 104.436508, 247, 252, 152;104.436508, 104.436508,
        252, 196, 8;104.436508, 190.333333, 252, 166, 15;190.333333, 226.698413, 175,
        101, 15;226.698413, 226.698413, 255, 133, 92;226.698413, 243.000000, 204, 204,
        204
      INPUT:
        name: dem.tif
        type: raster
      Z_FACTOR: 1.0
    results:
      OUTPUT:
        hash:
        - 7fe0e0174185fd743e23760f33615adf10f771b4275f320db6f7f4f8
        - 094a2d0dea250690084e0812bf1e8f8666043d17d6a71de278810bb9
        type: rasterhash

  - algorithm: qgis:createconstantrasterlayer
    name: Create constant raster
    params:
      EXTENT: 270736.0673250682,270899.8544675339,4458899.000550019,4459029.574521748
      TARGET_CRS: EPSG:23030
      PIXEL_SIZE: 10.0
      NUMBER: 3.0
    results:
      OUTPUT:
        hash: 56172fe81f40efba9fadcaeccdbab247e99c8725990a94d9609769f6
        type: rasterhash

  - algorithm: native:lineintersections
    name: Line intersections all fields
    params:
      INPUT:
        name: custom/line_intersection1.gml
        type: vector
      INTERSECT:
        name: custom/line_intersection2.gml
        type: vector
    results:
      OUTPUT:
        name: expected/line_intersection_all_fields.gml
        type: vector
        pk:
        - name
        - name_2
        compare:
          fields:
            fid: skip
            fid_2: skip

  - algorithm: native:lineintersections
    name: Line intersections all fields (custom prefix)
    params:
      INPUT:
        name: custom/line_intersection1.gml
        type: vector
      INTERSECT:
        name: custom/line_intersection2.gml
        type: vector
      INTERSECT_FIELDS_PREFIX: pre_
    results:
      OUTPUT:
        name: expected/line_intersection_prefix.gml
        type: vector
        pk: [ name, pre_name ]
        compare:
          fields:
            fid: skip
            pre_fid: skip

  - algorithm: native:lineintersections
    name: Line intersections some fields
    params:
      INPUT:
        name: custom/line_intersection1.gml
        type: vector
      INPUT_FIELDS:
      - name
      INTERSECT:
        name: custom/line_intersection2.gml
        type: vector
      INTERSECT_FIELDS:
      - name
    results:
      OUTPUT:
        name: expected/line_intersection_partial_fields.gml
        type: vector
        compare:
          fields:
            fid: skip

  - algorithm: native:lineintersections
    name: Line intersections with geometry collection
    params:
      INPUT:
        name: custom/line_intersection_collection1.gml
        type: vector
      INTERSECT:
        name: custom/line_intersection_collection2.gml
        type: vector
    results:
      OUTPUT:
        name: expected/line_intersection_collection.gml
        type: vector

  - algorithm: qgis:sumlinelengths
    name: Sum line lengths
    params:
      COUNT_FIELD: line_count
      LEN_FIELD: line_len
      LINES:
        name: lines.gml
        type: vector
      POLYGONS:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/sum_line_length.gml
        type: vector

  - algorithm: qgis:delaunaytriangulation
    name: Delaunay triangulation (multipoint data)
    params:
      INPUT:
        name: multipoints.gml
        type: vector
    results:
      OUTPUT:
        name: expected/multipoint_delaunay.gml
        type: vector

  - algorithm: qgis:polygonfromlayerextent
    name: Polygon from layer extent rounded to 0
    params:
      BY_FEATURE: false
      INPUT:
        name: polys.gml
        type: vector
      ROUND_TO: 0.0
    results:
      OUTPUT:
        name: expected/polygon_from_extent.gml
        type: vector

  - algorithm: qgis:polygonfromlayerextent
    name: Polygon from layer extent rounded to 2
    params:
      BY_FEATURE: false
      INPUT:
        name: lines.gml
        type: vector
      ROUND_TO: 2.0
    results:
      OUTPUT:
        name: expected/polygon_from_extent_rounded_2.gml
        type: vector

  - algorithm: native:pointtolayer
    name: Test (native:pointtolayer)
    params:
      INPUT: 1000000.000000,1550000.000000 [EPSG:3857]
    results:
      OUTPUT:
        name: expected/point_to_layer.gml
        type: vector

  - algorithm: qgis:climbalongline
    name: Climb line layer with DTM
    params:
      INPUT:
        name: custom/climb_line.shp
        type: vector
    results:
      OUTPUT:
        name: expected/climb_layer_result.shp
        type: vector

# See ../README.md for a description of the file format