QGIS/python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
Nyall Dawson 5d504dcafb Unify processing "polygon from layer extent" algorithms
Now that the extra features of the "polygon from vector layer extent"
algorithm are covered by the new "Minimum bounding geometry" algorithm,
we can replace the previous two "polygon from vector extent" and
"polygon from raster extent" algorithms by a single "polygon
from layer extent" algorithm.
2017-09-04 08:42:03 +10:00

3396 lines
76 KiB
YAML

# 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: 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',
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: qgis: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: qgis:densifygeometries
params:
INPUT:
name: multipolys.gml
type: vector
VERTICES: 4
results:
OUTPUT:
name: expected/multipolys_densify.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'
# # Split lines with lines considers two cases
# # case 1: two different layers
# - algorithm: qgis:splitlineswithlines
# name: Split lines with lines
# params:
# INPUT_A:
# name: lines.gml
# type: vector
# INPUT_B:
# name: custom/lines2.gml
# type: vector
# results:
# OUTPUT:
# name: expected/lines_split_with_lines.gml
# type: vector
# compare:
# geometry:
# precision: 7
#
# # case 2 split line layer with iself
# - algorithm: qgis:splitlineswithlines
# name: Split lines with same lines
# params:
# INPUT_A:
# name: custom/lines2.gml
# type: vector
# INPUT_B:
# name: custom/lines2.gml
# type: vector
# results:
# OUTPUT:
# name: expected/lines_split_with_same_lines.gml
# type: vector
# compare:
# geometry:
# precision: 7
#
- algorithm: qgis:listuniquevalues
name: Unique values
params:
INPUT:
name: points.gml
type: vector
FIELD_NAME: id2
results:
OUTPUT:
name: expected/unique_values.gml
type: vector
- algorithm: qgis:addautoincrementalfield
name: Add autoincremental field
params:
INPUT:
name: points.gml
type: vector
results:
OUTPUT:
name: expected/autoincrement_field.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: qgis:fixeddistancebuffer
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: qgis:fixeddistancebuffer
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:mergelines
name: Merge lines algorithm
params:
INPUT:
name: multilines.gml
type: vector
results:
OUTPUT:
name: expected/merge_lines.gml
type: vector
- 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: qgis:boundary
name: Polygon boundary
params:
INPUT:
name: polys.gml
type: vector
results:
OUTPUT:
name: expected/poly_boundary.gml
type: vector
- algorithm: qgis:boundary
name: Multipoly boundary
params:
INPUT:
name: multipolys.gml
type: vector
results:
OUTPUT:
name: expected/multipoly_boundary.gml
type: vector
- algorithm: qgis:boundary
name: Line boundary
params:
INPUT:
name: lines.gml
type: vector
results:
OUTPUT:
name: expected/lines_boundary.gml
type: vector
- algorithm: qgis: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: qgis: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: qgis: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: qgis: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: qgis:pointonsurface
name: Point on polygon surface
params:
INPUT:
name: polys.gml
type: vector
results:
OUTPUT:
name: expected/point_on_poly.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: qgis: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: qgis: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: qgis: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: qgis: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: qgis: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: qgis: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: qgis:fixeddistancebuffer
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: qgis:fixeddistancebuffer
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: qgis:fixeddistancebuffer
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: qgis:fixeddistancebuffer
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: qgis:fixeddistancebuffer
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 (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: qgis: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: 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:extractnodes
name: Test (qgis:extractnodes)
params:
INPUT:
name: multipolys.gml
type: vector
results:
OUTPUT:
name: expected/extract_nodes_multipolys.gml
type: vector
- algorithm: qgis:extractnodes
name: Extract nodes from polygons
params:
INPUT:
name: polys.gml
type: vector
results:
OUTPUT:
name: expected/extract_nodes_polys.gml
type: vector
- algorithm: qgis:extractnodes
name: Extract nodes from multilines
params:
INPUT:
name: multilines.gml
type: vector
results:
OUTPUT:
name: expected/extract_nodes_multilines.gml
type: vector
- algorithm: qgis:extractnodes
name: Extract nodes from lines
params:
INPUT:
name: lines.gml
type: vector
results:
OUTPUT:
name: expected/extract_nodes_lines.gml
type: vector
- algorithm: qgis:simplifygeometries
name: Simplify (lines)
params:
INPUT:
name: lines.gml
type: vector
TOLERANCE: 1.0
results:
OUTPUT:
name: expected/simplify_lines.gml
type: vector
- algorithm: qgis:simplifygeometries
name: Simplify (multilines)
params:
INPUT:
name: multilines.gml
type: vector
TOLERANCE: 1.0
results:
OUTPUT:
name: expected/simplify_multilines.gml
type: vector
- algorithm: qgis: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: qgis: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: qgis: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: qgis: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: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: qgis: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: qgis: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: qgis: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: qgis: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
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: e453e9e36ce314d5197963ac27872a0cc3dfe43764ed586a334c66f0
type: rasterhash
# Case 1: Keep all fields
- algorithm: qgis:lineintersections
name: Line Intersection Keep All Fields from Both
params:
INPUT:
name: lines.gml
type: vector
INTERSECT:
name: simplify_lines.gml
type: vector
results:
OUTPUT:
name: expected/line_intersection.gml
type: vector
# Case 2: Keep fid field from both layers
- algorithm: qgis:lineintersections
name: Line Intersection Keep fid from Both
params:
INPUT_FIELDS: fid
INTERSECT_FIELDS: fid
INPUT:
name: lines.gml
type: vector
INTERSECT:
name: simplify_lines.gml
type: vector
results:
OUTPUT:
name: expected/line_intersection.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:idwinterpolation
name: IDW interpolation using attribute
params:
CELLSIZE_X: 0.02667
CELLSIZE_Y: 0.02667
COLUMNS: 300
DISTANCE_COEFFICIENT: 2.0
EXTENT: 0, 8, -5, 3
INTERPOLATION_DATA:
name: pointsz.gml,False,1,0
type: interpolation
ROWS: 300
results:
OUTPUT:
hash: 56d2671d50444f8571affba3f9e585830b82af5e380394178f521065
type: rasterhash
- algorithm: qgis:idwinterpolation
name: IDW interpolation using Z value
params:
CELLSIZE_X: 0.02667
CELLSIZE_Y: 0.02667
COLUMNS: 300
DISTANCE_COEFFICIENT: 2.0
EXTENT: 0, 8, -5, 3
INTERPOLATION_DATA:
name: pointsz.gml,True,-1,0
type: interpolation
ROWS: 300
results:
OUTPUT:
hash: 56d2671d50444f8571affba3f9e585830b82af5e380394178f521065
type: rasterhash
- algorithm: qgis:tininterpolation
name: TIN interpolation using attribute
params:
CELLSIZE_X: 0.02667
CELLSIZE_Y: 0.02667
COLUMNS: 300
EXTENT: 0, 8, -5, 3
INTERPOLATION_DATA:
name: pointsz.gml,False,1,0
type: interpolation
METHOD: '0'
ROWS: 300
results:
OUTPUT:
hash: 87f40be6ec08f3fcbb5707762de71f6be35bb265c61f594335562a26
type: rasterhash
#TRIANGULATION_FILE:
# name: expected/triangulation.gml
# type: vector
- algorithm: qgis:tininterpolation
name: TIN interpolation using Z value
params:
CELLSIZE_X: 0.02667
CELLSIZE_Y: 0.02667
COLUMNS: 300
EXTENT: 0, 8, -5, 3
INTERPOLATION_DATA:
name: pointsz.gml,True,-1,0
type: interpolation
METHOD: '1'
ROWS: 300
results:
OUTPUT:
hash: 5e14dd0b879884b8b8da56c082947dad681feb4e9f1137f5cda126f8
type: rasterhash
#TRIANULATION_FILE:
# name: expected/triangulation.gml
# type: vector
- algorithm: native:removenullgeometries
name: Remove null geometries
params:
INPUT:
name: polys.gml
type: vector
results:
OUTPUT:
name: expected/remove_null_polys.gml
type: vector
- algorithm: native:extractbyexpression
name: Extract by Expression
params:
EXPRESSION: left( "Name",1)='A'
INPUT:
name: polys.gml
type: vector
results:
OUTPUT:
name: expected/extract_expression.gml
type: vector
- algorithm: qgis:extendlines
name: Extend lines
params:
END_DISTANCE: 0.2
INPUT:
name: lines.gml
type: vector
START_DISTANCE: 0.1
results:
OUTPUT:
name: expected/extend_lines.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:extendlines
name: Extend multilines
params:
END_DISTANCE: 0.4
INPUT:
name: multilines.gml
type: vector
START_DISTANCE: 0.2
results:
OUTPUT:
name: expected/extend_multilines.gml
type: vector
- algorithm: qgis:extractspecificnodes
name: Extract specific nodes lines
params:
INPUT:
name: lines.gml
type: vector
NODES: 0,-1,2,-2
results:
OUTPUT:
name: expected/extract_specific_nodes_lines.gml
type: vector
compare:
fields:
fid: skip
- algorithm: qgis:extractspecificnodes
name: Extract specific nodes polygons
params:
INPUT:
name: polys.gml
type: vector
NODES: 0,-1,5,-5
results:
OUTPUT:
name: expected/extract_specific_nodes_polys.gml
type: vector
compare:
fields:
fid: skip
- algorithm: qgis:geometrybyexpression
name: Geometry by expression (point)
params:
EXPRESSION: 'translate( $geometry,1,1)'
INPUT:
name: points.gml
type: vector
OUTPUT_GEOMETRY: '0'
WITH_M: false
WITH_Z: false
results:
OUTPUT:
name: expected/geometry_by_expression_point.gml
type: vector
- algorithm: qgis:geometrybyexpression
name: Geometry by expression (polygon)
params:
EXPRESSION: ' translate( centroid($geometry),1,1)'
INPUT:
name: polys.gml
type: vector
OUTPUT_GEOMETRY: '2'
WITH_M: false
WITH_Z: false
results:
OUTPUT:
name: expected/geometry_by_expression_poly.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:geometrybyexpression
name: Geometry by expression (line)
params:
EXPRESSION: ' translate( $geometry,1,1)'
INPUT:
name: lines.gml
type: vector
OUTPUT_GEOMETRY: '1'
WITH_M: false
WITH_Z: false
results:
OUTPUT:
name: expected/geometry_by_expression_line.gml
type: vector
- algorithm: qgis:snapgeometries
name: Snap lines to lines
params:
INPUT:
name: snap_lines.gml
type: vector
REFERENCE_LAYER:
name: lines.gml
type: vector
TOLERANCE: 1.0
results:
OUTPUT:
name: expected/snap_lines_to_lines.gml
type: vector
- algorithm: qgis:snapgeometries
name: Snap polygons to polygons
params:
INPUT:
name: snap_polys.gml
type: vector
REFERENCE_LAYER:
name: polys.gml
type: vector
TOLERANCE: 1.0
results:
OUTPUT:
name: expected/snap_polys_to_polys.gml
type: vector
- algorithm: qgis:snapgeometries
name: Snap points to points
params:
INPUT:
name: snap_points.gml
type: vector
REFERENCE_LAYER:
name: points.gml
type: vector
TOLERANCE: 1.0
results:
OUTPUT:
name: expected/snap_points_to_points.gml
type: vector
- algorithm: qgis:snapgeometries
name: Snap points to lines (prefer nodes)
params:
BEHAVIOR: '0'
INPUT:
name: snap_points.gml
type: vector
REFERENCE_LAYER:
name: lines.gml
type: vector
TOLERANCE: 1.0
results:
OUTPUT:
name: expected/snap_point_to_lines_prefer_nodes.gml
type: vector
- algorithm: qgis:snapgeometries
name: Snap points to lines (prefer closest)
params:
BEHAVIOR: '1'
INPUT:
name: snap_points.gml
type: vector
REFERENCE_LAYER:
name: lines.gml
type: vector
TOLERANCE: 1.0
results:
OUTPUT:
name: expected/snap_point_to_lines_prefer_closest.gml
type: vector
- algorithm: qgis:snapgeometries
name: Snap internal
params:
BEHAVIOR: '0'
INPUT:
name: custom/snap_internal.gml
type: vector
REFERENCE_LAYER:
name: custom/snap_internal.gml
type: vector
TOLERANCE: 1.0
results:
OUTPUT:
name: expected/snap_internal.gml
type: vector
- algorithm: qgis:poleofinaccessibility
name: Pole of inaccessibility (polygons)
params:
INPUT:
name: polys.gml
type: vector
TOLERANCE: 1.0e-05
results:
OUTPUT:
name: expected/pole_inaccessibility_polys.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: native:extractbyattribute
name: Extract by attribute (is null)
params:
FIELD: intval
INPUT:
name: polys.gml
type: vector
OPERATOR: '8'
results:
OUTPUT:
name: expected/extract_by_attribute_null.gml
type: vector
- algorithm: native:extractbyattribute
name: Extract by attribute (is not null)
params:
FIELD: intval
INPUT:
name: polys.gml
type: vector
OPERATOR: '9'
results:
OUTPUT:
name: expected/extract_by_attribute_not_null.gml
type: vector
- algorithm: native:extractbyattribute
name: Extract by attribute (starts with)
params:
FIELD: name
INPUT:
name: polys.gml
type: vector
OPERATOR: '6'
VALUE: A
results:
OUTPUT:
name: expected/extract_by_attribute_startswith.gml
type: vector
- algorithm: native:extractbyattribute
name: Extract by attribute (contains)
params:
FIELD: name
INPUT:
name: polys.gml
type: vector
OPERATOR: '7'
VALUE: aaa
results:
OUTPUT:
name: expected/extract_by_attribute_contains.gml
type: vector
- algorithm: native:extractbyattribute
name: Extract by attribute (does not contain)
params:
FIELD: name
INPUT:
name: polys.gml
type: vector
OPERATOR: '10'
VALUE: a
results:
OUTPUT:
name: expected/extract_by_attribute_does_not_contain.gml
type: vector
- algorithm: native:extractbyattribute
name: Extract by attribute (greater)
params:
FIELD: floatval
INPUT:
name: polys.gml
type: vector
OPERATOR: '2'
VALUE: '1'
results:
OUTPUT:
name: expected/extract_by_attribute_greater.gml
type: vector
- algorithm: qgis:createattributeindex
name: Create Attribute Index (only tests for python errors, does not check result)
params:
FIELD: fid
INPUT:
name: lines.gml
type: vector
results: {}
- algorithm: qgis:deletecolumn
name: Delete columns (multiple)
params:
COLUMN: floatval;name
INPUT:
name: polys.gml
type: vector
results:
OUTPUT:
name: expected/delete_columns.gml
type: vector
- algorithm: qgis:deletecolumn
name: Delete columns (single)
params:
COLUMN: intval
INPUT:
name: polys.gml
type: vector
results:
OUTPUT:
name: expected/delete_column.gml
type: vector
- algorithm: qgis:createpointslayerfromtable
name: Create points from table
params:
INPUT:
name: create_points.gml
type: table
MFIELD: mcoord
TARGET_CRS: EPSG:4326
XFIELD: xcoord
YFIELD: ycoord
ZFIELD: zcoord
results:
OUTPUT:
name: expected/create_points.gml
type: vector
- algorithm: qgis:splitwithlines
name: Split lines with lines (new alg)
params:
INPUT:
name: lines.gml
type: vector
LINES:
name: custom/lines2.gml
type: vector
results:
OUTPUT:
name: expected/split_lines_with_lines.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:splitwithlines
name: Split poly with lines
params:
INPUT:
name: polys.gml
type: vector
LINES:
name: lines.gml
type: vector
results:
OUTPUT:
name: expected/split_polys_with_lines.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:splitwithlines
name: Split lines with same lines
params:
INPUT:
name: lines.gml
type: vector
LINES:
name: lines.gml
type: vector
results:
OUTPUT:
name: expected/split_lines_with_lines_same.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:dropgeometries
name: Drop geometries
params:
INPUT:
name: polys.gml
type: vector
results:
OUTPUT:
name: expected/dropped_geometry.csv
type: vector
- algorithm: qgis:creategridlines
name: Create grid (lines)
params:
CRS: EPSG:4326
EXTENT: -1,11.2,-4,6.5
HSPACING: 5.0
VSPACING: 3.0
results:
OUTPUT:
name: expected/grid_lines.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:creategridpolygon
name: Create grid (rectangles)
params:
CRS: EPSG:4326
EXTENT: -1,11.2,-4,6.5
HSPACING: 5.0
TYPE: '0'
VSPACING: 3.0
results:
OUTPUT:
name: expected/grid_rectangles.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:creategridpolygon
name: Create grid (diamond)
params:
CRS: EPSG:4326
EXTENT: -1,11.2,-4,6.5
HSPACING: 5.0
TYPE: '1'
VSPACING: 3.0
results:
OUTPUT:
name: expected/grid_diamond.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:creategridpolygon
name: Create grid (hexagon)
params:
CRS: EPSG:4326
EXTENT: -1,11.2,-4,6.5
HSPACING: 5.0
TYPE: '2'
VSPACING: 5.0
results:
OUTPUT:
name: expected/grid_hexagon.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:creategridlines
name: Create grid (lines with overlay)
params:
CRS: EPSG:4326
EXTENT: -1,11.2,-4,6.5
HOVERLAY: 2.0
HSPACING: 5.0
VOVERLAY: 1.0
VSPACING: 3.0
results:
OUTPUT:
name: expected/grid_lines_overlay.gml
type: vector
- algorithm: qgis:creategridpolygon
name: Create grid (rectangle with overlay)
params:
CRS: EPSG:4326
EXTENT: -1,11.2,-4,6.5
HOVERLAY: 2.0
HSPACING: 5.0
TYPE: '0'
VOVERLAY: 1.0
VSPACING: 3.0
results:
OUTPUT:
name: expected/grid_rectangle_overlay.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:creategridpolygon
name: Create grid (diamond with overlay)
params:
CRS: EPSG:4326
EXTENT: -1,11.2,-4,6.5
HOVERLAY: 2.0
HSPACING: 5.0
TYPE: '1'
VOVERLAY: 1.0
VSPACING: 3.0
results:
OUTPUT:
name: expected/grid_diamond_overlay.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:creategridpolygon
name: Create grid (hexagon with overlay)
params:
CRS: EPSG:4326
EXTENT: -1,11.2,-4,6.5
HOVERLAY: 2.0
HSPACING: 5.0
TYPE: '2'
VOVERLAY: 1.0
VSPACING: 5.0
results:
OUTPUT:
name: expected/grid_hexagon_overlay.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:deleteholes
name: Delete holes (no min)
params:
INPUT:
name: custom/remove_holes.gml
type: vector
MIN_AREA: 0.0
results:
OUTPUT:
name: expected/removed_holes.gml
type: vector
- algorithm: qgis:deleteholes
name: Delete holes (with min)
params:
INPUT:
name: custom/remove_holes.gml
type: vector
MIN_AREA: 5.0
results:
OUTPUT:
name: expected/removed_holes_min_area.gml
type: vector
- algorithm: qgis:basicstatisticsforfields
name: Basic stats datetime
params:
FIELD_NAME: date_time
INPUT_LAYER:
name: custom/datetimes.tab
type: table
results:
OUTPUT_HTML_FILE:
name: expected/basic_statistics_datetime.html
type: regex
rules:
- 'Analyzed field: date_time'
- 'Count: 4'
- 'Unique values: 3'
- 'Minimum value: 2014-11-30T14:30:02'
- 'Maximum value: 2016-11-30T14:29:22'
- 'NULL \(missing\) values: 1'
- algorithm: qgis:basicstatisticsforfields
name: Basic stats date
params:
FIELD_NAME: date
INPUT_LAYER:
name: custom/datetimes.tab
type: table
results:
OUTPUT_HTML_FILE:
name: expected/basic_statistics_date.html
type: regex
rules:
- 'Analyzed field: date'
- 'Count: 4'
- 'Unique values: 3'
- 'Minimum value: 2014-11-30T00:00:00'
- 'Maximum value: 2016-11-30T00:00:00'
- 'NULL \(missing\) values: 1'
- algorithm: qgis:basicstatisticsforfields
name: Basic stats time
params:
FIELD_NAME: time
INPUT_LAYER:
name: custom/datetimes.tab
type: table
results:
OUTPUT_HTML_FILE:
name: expected/basic_statistics_time.html
type: regex
rules:
- 'Analyzed field: time'
- 'Count: 4'
- 'Unique values: 3'
- 'Minimum value: 03:29:40'
- 'Maximum value: 15:29:22'
- 'NULL \(missing\) values: 1'
- algorithm: qgis:rastercalculator
name: Raster Calculator with cellsize
params:
LAYERS:
params:
- name: dem.tif
type: raster
type: multi
CELLSIZE: 0.001
EXPRESSION: dem@1
results:
OUTPUT:
hash: ef97a22ee16e0e28bbdc0341449777b1527e37febc3c4339b2c057c9
type: rasterhash
- algorithm: qgis:rastercalculator
name: Raster Calculator
params:
LAYERS:
params:
- name: dem.tif
type: raster
type: multi
CELLSIZE: 0.0
EXPRESSION: dem@1 * 2
results:
OUTPUT:
hash: fe6e018be13c5a3c17f3f4d0f0dc7686c628cb440b74c4642aa0c939
type: rasterhash
- algorithm: native:orientedminimumboundingbox
name: Oriented minimum bounding box polys
params:
INPUT:
name: custom/oriented_bbox.gml
type: vector
results:
OUTPUT:
name: expected/oriented_bounds.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:orthogonalize
name: Orthogonalize polys
params:
INPUT:
name: custom/polys_to_orth.gml
type: vector
results:
OUTPUT:
name: expected/orthagonal_polys.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:orthogonalize
name: Orthogonalize lines
params:
INPUT:
name: custom/lines_to_orth.gml
type: vector
results:
OUTPUT:
name: expected/orthagonal_lines.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:refactorfields
name: refactor fields
params:
INPUT:
name: multipolys.gml
type: vector
FIELDS_MAPPING:
- expression: '@row_number'
name: 'row_number'
type: 2
length: 0
precision: 0
- expression: >
"fid" || ' - ' || "Bname"
name: 'Bname'
type: 10
length: 30
precision: 0
- expression: '"Bintval" + 1'
name: 'Bintval'
type: 2
length: 0
precision: 0
- expression: '"Bfloatval" * 2'
name: 'Bfloatval'
type: 6
length: 0
precision: 0
results:
OUTPUT:
name: expected/refactorfields.gml
type: vector
- algorithm: native:reprojectlayer
name: reproject vector layer
params:
INPUT:
name: points.gml
type: vector
TARGET_CRS: EPSG:3857
results:
OUTPUT:
name: expected/reprojected.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:variabledistancebuffer
name: variable buffer on points
params:
DISSOLVE: false
FIELD: buffer
INPUT:
name: custom/variable_buffer.gml
type: vector
SEGMENTS: 5
results:
OUTPUT:
name: expected/variable_buffer_points.gml
type: vector
compare:
geometry:
precision: 5
- algorithm: qgis:variabledistancebuffer
name: variable buffer on points with dissolve option
params:
DISSOLVE: true
FIELD: buffer
INPUT:
name: custom/variable_buffer.gml
type: vector
SEGMENTS: 5
results:
OUTPUT:
name: expected/variable_buffer_points_dissolved.gml
type: vector
compare:
geometry:
precision: 5
fields:
id: skip
id2: skip
fid: skip
- algorithm: qgis:adduniquevalueindexfield
name: add unique field based on another field
params:
FIELD: id2
INPUT:
name: points.gml
type: vector
results:
OUTPUT:
name: expected/add_unique_field.gml
type: vector
- algorithm: qgis:linestopolygons
name: convert lines to polygon
params:
INPUT:
name: lines.gml
type: vector
results:
OUTPUT:
name: expected/lines_to_polygon.gml
type: vector
- algorithm: qgis:snappointstogrid
name: Gridify polys
params:
INPUT:
name: polys.gml
type: vector
HSPACING: 2
VSPACING: 2
results:
OUTPUT:
name: expected/gridify_polys.gml
type: vector
- algorithm: qgis:snappointstogrid
name: Gridify lines
params:
INPUT:
name: lines.gml
type: vector
HSPACING: 2
VSPACING: 2
results:
OUTPUT:
name: expected/gridify_lines.gml
type: vector
- algorithm: qgis:distancetonearesthubpoints
name: Hub distance points
params:
INPUT:
name: points.gml
type: vector
HUBS:
name: custom/hub_points.gml
type: vector
FIELD: name
UNIT: 0
results:
OUTPUT:
name: expected/hub_distance_points.gml
type: vector
- algorithm: qgis:distancetonearesthublinetohub
name: Hub distance lines
params:
INPUT:
name: points.gml
type: vector
HUBS:
name: custom/hub_points.gml
type: vector
FIELD: name
UNIT: 0
results:
OUTPUT:
name: expected/hub_distance_lines.gml
type: vector
- algorithm: qgis:hublines
name: Hub lines
params:
HUBS:
name: points.gml
type: vector
SPOKES:
name: custom/spoke_points.gml
type: vector
HUB_FIELD: id
SPOKE_FIELD: id
results:
OUTPUT:
name: expected/hub_lines.gml
type: vector
- algorithm: qgis:pointstopath
name: Points to path (non grouped)
params:
INPUT:
name: points.gml
type: vector
ORDER_FIELD: id
results:
OUTPUT:
name: expected/points_to_path.gml
type: vector
- algorithm: qgis:pointstopath
name: Points to path (grouped)
params:
INPUT:
name: points.gml
type: vector
ORDER_FIELD: id
GROUP_FIELD: id2
results:
OUTPUT:
name:
- expected/points_to_path_grouped.gml
- expected/points_to_path_grouped2.gml
type: vector
- algorithm: qgis:joinattributestable
name: join the attribute table by common field
params:
INPUT:
name: points.gml
type: vector
INPUT_2:
name: table.dbf
type: table
FIELD: id
FIELD_2: ID
results:
OUTPUT:
name: expected/join_attribute_table.gml
type: vector
# # These tests dissabled because algs require access to iface which
# # is not available in the test suite.
# #- algorithm: qgis:shortestpathpointtopoint
# # name: Shortest path (point to point, shortest route)
# # params:
# # DEFAULT_DIRECTION: '2'
# # DEFAULT_SPEED: 5.0
# # END_POINT: 1003534.816864,6222363.591221
# # INPUT_VECTOR:
# # name: roads.gml
# # type: vector
# # START_POINT: 1000943.661493,6220332.253368
# # STRATEGY: '0'
# # TOLERANCE: 0.0
# # results:
# # OUTPUT_LAYER:
# # name: expected/shortest.gml
# # type: vector
# #
# #- algorithm: qgis:shortestpathpointtopoint
# # name: Shortest path (point to point, fastest route)
# # params:
# # DEFAULT_DIRECTION: '2'
# # DEFAULT_SPEED: 60.0
# # END_POINT: 1003534.816864,6222363.591221
# # INPUT_VECTOR:
# # name: roads.gml
# # type: vector
# # SPEED_FIELD: SPEED
# # START_POINT: 1000943.661493,6220332.253368
# # STRATEGY: '1'
# # TOLERANCE: 0.0
# # results:
# # OUTPUT_LAYER:
# # name: expected/fastest.gml
# # type: vector
# #
# #- algorithm: qgis:serviceareafrompoint
# # name: Service area (from point, shortest)
# # params:
# # DEFAULT_DIRECTION: '2'
# # DEFAULT_SPEED: 5.0
# # INPUT_VECTOR:
# # name: roads.gml
# # type: vector
# # START_POINT: 1002660.341692,6222015.780774
# # STRATEGY: '0'
# # TOLERANCE: 0.0
# # TRAVEL_COST: 700.0
# # results:
# # OUTPUT_POINTS:
# # name: expected/servicearea_nodes.gml
# # type: vector
# # OUTPUT_POLYGON:
# # name: expected/servicearea_bounds.gml
# # type: vector
#
- algorithm: qgis:createattributeindex
name: Create attribute index
params:
FIELD: id
INPUT:
name: custom/points.shp
type: vector
in_place: true
results:
INPUT:
name: expected/create_attr_index_points.shp
type: vector
in_place_result: true
- algorithm: qgis:createspatialindex
name: Create spatial index
params:
INPUT:
name: custom/points.shp
type: vector
in_place: true
results:
INPUT:
name: expected/create_attr_index_points.shp
type: vector
in_place_result: true
- algorithm: qgis:truncatetable
name: Truncate table
params:
INPUT:
name: custom/points.shp
type: vector
in_place: true
results:
INPUT:
name: expected/truncated.shp
type: vector
in_place_result: true
- algorithm: qgis:distancematrix
name: Distance matrix (only tests for run, does not check result as rows are in random order)
params:
INPUT_FIELD: fid
INPUT:
name: points.gml
type: vector
MATRIX_TYPE: '0'
NEAREST_POINTS: 0
TARGET_FIELD: fid
TARGET:
name: points.gml
type: vector
results:
OUTPUT:
name: expected/count_unique_points.gml
type: vector
compare: false
- algorithm: qgis:countpointsinpolygon
name: standard count unique points in polygon
params:
CLASSFIELD: id2
FIELD: NUMPOINTS
POINTS:
name: points.gml
type: vector
POLYGONS:
name: polys.gml
type: vector
results:
OUTPUT:
name: expected/count_unique_points.gml
type: vector
- algorithm: qgis:countpointsinpolygon
name: standard count points in polygon weighted
params:
FIELD: NUMPOINTS
POINTS:
name: custom/points_weighted.gml
type: vector
POLYGONS:
name: polys.gml
type: vector
WEIGHT: id
results:
OUTPUT:
name: expected/count_points_weighted.gml
type: vector
- algorithm: qgis:pointsalonglines
name: standard points along lines
params:
DISTANCE: 1.0
END_OFFSET: 0.0
INPUT:
name: lines.gml
type: vector
START_OFFSET: 0.0
results:
OUTPUT:
name: expected/points_along_lines.gml
type: vector
- algorithm: qgis:meancoordinates
name: standard mean coordinates
params:
INPUT:
name: custom/points.shp
type: vector
results:
OUTPUT:
name: expected/mean_coordinates.gml
type: vector
- algorithm: qgis:singlepartstomultipart
name: single part to multipart
params:
FIELD: id
INPUT:
name: custom/single_part_poly.gml
type: vector
results:
OUTPUT:
name: expected/single_to_multi.gml
type: vector
- algorithm: qgis:statisticsbycategories
name: stats by category
params:
VALUES_FIELD_NAME: id
CATEGORIES_FIELD_NAME: id2
INPUT:
name: points.gml
type: vector
results:
OUTPUT:
name: expected/stats_by_category.gml
type: vector
pk: id2
compare:
fields:
fid: skip
# - algorithm: qgis:zonalstatistics
# name: simple zonal statistics
# params:
# COLUMN_PREFIX: _
# GLOBAL_EXTENT: false
# INPUT_RASTER:
# name: dem.tif
# type: raster
# INPUT_VECTOR:
# name: custom/polygon_mask.gml
# type: vector
# RASTER_BAND: 1
# results:
# OUTPUT_LAYER:
# name: expected/zonal_statistics.gml
# type: vector
- algorithm: qgis:fixgeometries
name: Fix geometries
params:
INPUT:
name: invalidgeometries.gml
type: vector
results:
OUTPUT:
name: expected/valid.gml
type: vector
- algorithm: qgis:polygonize
name: Polygonize
params:
KEEP_FIELDS: false
INPUT:
name: custom/polygonize_lines.gml
type: vector
results:
OUTPUT:
name: expected/polygonize.gml
type: vector
- algorithm: qgis:voronoipolygons
name: Standard voronoi
params:
BUFFER: 0.0
INPUT:
name: points.gml
type: vector
results:
OUTPUT:
name: expected/voronoi.gml
type: vector
- algorithm: qgis:voronoipolygons
name: Vornoi with buffer region
params:
BUFFER: 10.0
INPUT:
name: points.gml
type: vector
results:
OUTPUT:
name: expected/voronoi_buffer.gml
type: vector
- algorithm: qgis:explodelines
name: Explode lines
params:
INPUT:
name: lines.gml
type: vector
results:
OUTPUT:
name: expected/explode_lines.gml
type: vector
compare:
fields:
fid: skip
- algorithm: qgis:explodelines
name: Explode multilines
params:
INPUT:
name: multilines.gml
type: vector
results:
OUTPUT:
name: expected/explode_multilines.gml
type: vector
compare:
fields:
fid: skip
- algorithm: qgis:findprojection
name: Find projection
params:
INPUT:
name: custom/find_projection.gml
type: vector
TARGET_AREA: 151.1198,151.1368,-33.9118,-33.9003
TARGET_AREA_CRS: EPSG:4326
results:
OUTPUT:
name: expected/projection_candidates.gml
type: vector
- algorithm: qgis:polygonfromlayerextent
name: Standard polygon from layer extent
params:
BY_FEATURE: false
INPUT:
name: polys.gml
type: vector
results:
OUTPUT:
name: expected/polygon_from_extent.gml
type: vector
- algorithm: qgis:topologicalcoloring
name: Topological coloring
params:
BALANCE: 0
INPUT:
name: custom/adjacent_polys.gml
type: vector
MIN_COLORS: 4
results:
OUTPUT:
type: vector
name:
- expected/topocolor_polys.gml
- expected/topocolor_polys2.gml
- algorithm: qgis:topologicalcoloring
name: Topological coloring w/ min distance
params:
BALANCE: 0
INPUT:
name: custom/adjacent_polys.gml
type: vector
MIN_COLORS: 4
MIN_DISTANCE: 4.0
results:
OUTPUT:
name: expected/topocolor_polys_min_dist.gml
type: vector
- algorithm: qgis:regularpoints
name: Regular point with standard extent
params:
EXTENT: -0.9182432432432436,10.208108108108108,-3.1266891891891904,5.480067567567567
INSET: 0.0
IS_SPACING: false
RANDOMIZE: false
SPACING: 100
CRS: EPSG:4326
results:
OUTPUT:
name: expected/regular_points.gml
type: vector
compare:
geometry:
precision: 5
- algorithm: qgis:rectanglesovalsdiamondsvariable
name: Rectangular buffer shape
params:
HEIGHT: id
INPUT:
name: custom/points_weighted.gml
type: vector
SEGMENTS: 36
SHAPE: '0'
WIDTH: id
results:
OUTPUT:
name: expected/buffer_rect.gml
type: vector
- algorithm: qgis:rectanglesovalsdiamondsvariable
name: Diamond buffer shape
params:
HEIGHT: id
INPUT:
name: custom/points_weighted.gml
type: vector
SEGMENTS: 36
SHAPE: '1'
WIDTH: id
results:
OUTPUT:
name: expected/buffer_diamond.gml
type: vector
- algorithm: qgis:rectanglesovalsdiamondsvariable
name: Oval buffer shape
params:
HEIGHT: id
INPUT:
name: custom/points_weighted.gml
type: vector
SEGMENTS: 36
SHAPE: '2'
WIDTH: id
results:
OUTPUT:
name: expected/buffer_ovals.gml
type: vector
- algorithm: qgis:creategridlines
name: Lines grid 0.1 degree spacing
params:
CRS: EPSG:4326
EXTENT: -0.10453905405405395,8.808021567567568,-2.5010055337837844,4.058021763513514
HOVERLAY: 0.0
HSPACING: 0.1
VOVERLAY: 0.0
VSPACING: 0.1
results:
OUTPUT:
name: expected/create_grid_lines.gml
type: vector
- algorithm: qgis:convertgeometrytype
name: polygon to centroid
params:
INPUT:
name: polys.gml
type: vector
TYPE: '0'
results:
OUTPUT:
name: expected/convert_poly_centroid.gml
type: vector
- algorithm: qgis:convertgeometrytype
name: polygon to multilinestring
params:
INPUT:
name: polys.gml
type: vector
TYPE: '3'
results:
OUTPUT:
name: expected/convert_poly_multiline.gml
type: vector
- algorithm: qgis:convertgeometrytype
name: polygon to nodes
params:
INPUT:
name: polys.gml
type: vector
TYPE: '1'
results:
OUTPUT:
name: expected/convert_poly_nodes.gml
type: vector
# # - algorithm: qgis:extractbylocation
# # name: polygon intersecting points
# # params:
# # INPUT:
# # name: polys.gml
# # type: vector
# # INTERSECT:
# # name: custom/points.shp
# # type: vector
# # PRECISION: 0.0
# # PREDICATE: '[''intersects'']'
# # results:
# # OUTPUT:
# # name: expected/extract_by_location_intersection.gml
# # type: vector
# #
# # - algorithm: qgis:extractbylocation
# # name: points within polygons
# # params:
# # INPUT:
# # name: custom/points.shp
# # type: vector
# # INTERSECT:
# # name: polys.gml
# # type: vector
# # PRECISION: 0.0
# # PREDICATE: '[''within'']'
# # results:
# # OUTPUT:
# # name: expected/extract_by_location_within.gml
# # type: vector
#
- algorithm: qgis:addfieldtoattributestable
name: add float field
params:
FIELD_LENGTH: 10
FIELD_NAME: field
FIELD_PRECISION: 2
FIELD_TYPE: '1'
INPUT:
name: custom/points.shp
type: vector
results:
OUTPUT:
name: expected/add_field.gml
type: vector
# - algorithm: qgis:randompointsinextent
# name: Random point in extent, don't check result
# params:
# CRS: EPSG:4326
# EXTENT: 3.9821361058601132,4.01984877126654,0.9948015122873343,1.0305293005671075
# MIN_DISTANCE: 0.0
# POINT_NUMBER: 5
# results: {}
- algorithm: script:selectbyattribute
name: Select by attribute
params:
INPUT_LAYER:
name: points.gml
type: vector
results:
OUTPUT_LAYER:
name: expected/selected_points.gml
type: vector
- algorithm: script:selectbyexpression
name: Select by expression
params:
INPUT_LAYER:
name: points.gml
type: vector
results:
OUTPUT_LAYER:
name: expected/select_by_expression.gml
type: vector
- algorithm: qgis:randomextract
name: Random extract by number
params:
INPUT:
name: custom/points_weighted.gml
type: vector
METHOD: 0
NUMBER: 4
results:
OUTPUT:
type: vector
name: points_weighted.gml
compare: false
- algorithm: qgis:randomextract
name: Random extract by percentage
params:
INPUT:
name: custom/points_weighted.gml
type: vector
METHOD: 1
NUMBER: 50
results:
OUTPUT:
type: vector
name: points_weighted.gml
compare: false
- algorithm: qgis:heatmapkerneldensityestimation
name: Heatmap (Kernel density estimation)
params:
DECAY: 0.0
INPUT:
name: points.gml
type: vector
KERNEL: '0'
OUTPUT_VALUE: '0'
PIXEL_SIZE: 0.1
RADIUS: 0.5
results:
OUTPUT:
hash: f09384c64f56286ec4146a7b9a679cea7c6711ec4c7d77eec054e364
type: rasterhash
- algorithm: qgis:rasterlayerstatistics
name: Raster layer statistics
params:
INPUT:
name: dem.tif
type: raster
BAND: 1
results:
OUTPUT_HTML_FILE:
name: raster_statistics.html
type: regex
rules:
- 'Minimum value: 85.0'
- 'Maximum value: 243.0'
- 'Range: 158.0'
- 'Sum: 19213301.982429504'
- 'Mean value: 147.17197994967066'
- 'Standard deviation: 43.9618116337985'
- 'Sum of the squares: 252304334.52061242'
- algorithm: qgis:pointsdisplacement
name: Point displacement
params:
DISTANCE: 1.0
HORIZONTAL: false
INPUT:
name: custom/displace_points.gml
type: vector
PROXIMITY: 2.0
results:
OUTPUT:
name: expected/displaced_points.gml
type: vector
- algorithm: qgis:generatepointspixelcentroidsinsidepolygons
name: Pixel centroids inside polygon
params:
INPUT_RASTER:
name: dem.tif
type: raster
INPUT_VECTOR:
name: custom/pixel_polygons.gml
type: vector
results:
OUTPUT:
name: expected/pixel_centroids_polygon.gml
type: vector
- algorithm: qgis:generatepointspixelcentroidsalongline
name: Pixel centroids along line
params:
INPUT_RASTER:
name: dem.tif
type: raster
INPUT_VECTOR:
name: custom/pixel_lines.gml
type: vector
results:
OUTPUT:
name: expected/pixel_centroids_lines.gml
type: vector
- algorithm: qgis:fieldcalculator
name: Test field calculator points
params:
FIELD_LENGTH: 10
FIELD_NAME: test
FIELD_PRECISION: 3
FIELD_TYPE: 1
FORMULA: ' "id2" *2'
INPUT:
name: points.gml
type: vector
NEW_FIELD: true
results:
OUTPUT:
name: expected/field_calculator_points.gml
type: vector
- algorithm: qgis:advancedpythonfieldcalculator
name: Test advanced python calculator
params:
FIELD_LENGTH: 10
FIELD_NAME: new_field
FIELD_PRECISION: 3
FIELD_TYPE: 0
FORMULA: value = __attr[2]*2
GLOBAL: ''
INPUT:
name: points.gml
type: vector
results:
OUTPUT:
name: expected/pycalculator_points.gml
type: vector
- algorithm: qgis:executesql
name: Test execute SQL
params:
INPUT_DATASOURCES:
params:
- name: points.gml
type: vector
type: multi
INPUT_GEOMETRY_FIELD: ''
INPUT_GEOMETRY_TYPE: 0
INPUT_QUERY: select * from input1 where id2=2
INPUT_UID_FIELD: ''
results:
OUTPUT:
name: expected/execute_sql.gml
type: vector
- algorithm: qgis:polygonfromlayerextent
name: Polygon from raster extent
params:
INPUT:
name: dem.tif
type: raster
results:
OUTPUT:
name: expected/raster_extent.gml
type: vector
- algorithm: native:minimumenclosingcircle
name: Minimal enclosing circle each features
params:
BY_FEATURE: true
INPUT:
name: custom/oriented_bbox.gml
type: vector
results:
OUTPUT:
name: expected/enclosing_circles_each.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: qgis:minimumboundinggeometry
name: Minimum enclosing geom (hull, no field)
params:
INPUT:
name: dissolve_polys.gml
type: vector
TYPE: 3
results:
OUTPUT:
name: expected/mbg_hull_nofield.gml
type: vector
compare:
geometry:
precision: 7
fields:
fid: skip
id: skip
- algorithm: qgis:minimumboundinggeometry
name: Minimum enclosing geom (hull, field)
params:
FIELD: name
INPUT:
name: dissolve_polys.gml
type: vector
TYPE: 3
results:
OUTPUT:
name: expected/mbg_hull_field.gml
type: vector
pk: name
compare:
geometry:
precision: 7
fields:
fid: skip
id: skip
- algorithm: qgis:minimumboundinggeometry
name: Minimum enclosing geom (circle, field)
params:
FIELD: name
INPUT:
name: dissolve_polys.gml
type: vector
TYPE: 2
results:
OUTPUT:
name: expected/mbg_circle_field.gml
type: vector
pk: name
compare:
geometry:
precision: 7
fields:
fid: skip
id: skip
- algorithm: qgis:minimumboundinggeometry
name: Minimum enclosing geom (circle, no field)
params:
INPUT:
name: dissolve_polys.gml
type: vector
TYPE: 2
results:
OUTPUT:
name: expected/mbg_circle_nofield.gml
type: vector
compare:
geometry:
precision: 7
fields:
fid: skip
id: skip
- algorithm: qgis:minimumboundinggeometry
name: Minimum enclosing geom (oriented rect, no field)
params:
INPUT:
name: dissolve_polys.gml
type: vector
TYPE: 1
results:
OUTPUT:
name: expected/mbg_rect_nofield.gml
type: vector
compare:
geometry:
precision: 7
fields:
fid: skip
id: skip
- algorithm: qgis:minimumboundinggeometry
name: Minimum enclosing geom (oriented rect, field)
params:
FIELD: name
INPUT:
name: dissolve_polys.gml
type: vector
TYPE: 1
results:
OUTPUT:
name: expected/mbg_rect_field.gml
type: vector
pk: name
compare:
geometry:
precision: 7
fields:
fid: skip
id: skip
- algorithm: qgis:minimumboundinggeometry
name: Minimum enclosing geom (envelope, field)
params:
FIELD: name
INPUT:
name: dissolve_polys.gml
type: vector
TYPE: 0
results:
OUTPUT:
name: expected/mbg_env_field.gml
type: vector
pk: name
compare:
geometry:
precision: 7
fields:
fid: skip
id: skip
- algorithm: qgis:minimumboundinggeometry
name: Minimum enclosing geom (envelope, no field)
params:
INPUT:
name: dissolve_polys.gml
type: vector
TYPE: 0
results:
OUTPUT:
name: expected/mbg_env_nofield.gml
type: vector
compare:
geometry:
precision: 7
fields:
fid: skip
id: skip
- algorithm: native:convexhull
name: Convex hull by feature
params:
INPUT:
name: custom/oriented_bbox.gml
type: vector
results:
OUTPUT:
name: expected/convex_hull_by_feature.gml
type: vector