QGIS/python/plugins/processing/tests/testdata/gdal_algorithm_tests.yaml
2017-01-10 09:30:08 +01:00

586 lines
13 KiB
YAML

# See ../README.md for a description of the file format
tests:
# MK: 23.2.2016 / Fails on travis:OSX
# - algorithm: gdal:rasterize
# name: Test (gdal:rasterize)
# params:
# BIGTIFF: 0
# COMPRESS: 4
# DIMENSIONS: 0
# EXTRA: ""
# FIELD: "Bfloatval"
# HEIGHT: 100
# INPUT:
# name: multipolys.gml
# type: vector
# JPEGCOMPRESSION: 75
# NO_DATA: -9999
# PREDICTOR: 1
# RTYPE: 5
# TFW: False
# TILED: False
# WIDTH: 100
# ZLEVEL: 6
# results:
# OUTPUT:
# hash: f1fedeb6782f9389cf43590d4c85ada9155ab61fef6dc285aaeb54d6
# type: rasterhash
- algorithm: gdal:gdalinfo
name: gdalinfo
params:
INPUT:
name: raster.tif
type: raster
NOGCP: false
NOMETADATA: false
results:
OUTPUT:
name: expected/gdal/raster_info.html
type: regex
rules:
- 'Origin = \(270736.067325068172067,4459029.574521748349071\)'
- 'Band 1 Block=16x14 Type=Float32, ColorInterp=Gray'
- ' NoData Value=-32768'
# - algorithm: gdal:polygonize
# name: GDAL polygonize
# params:
# FIELD: DN
# INPUT:
# name: raster.tif
# type: raster
# results:
# OUTPUT:
# name: expected/gdal/polygonize.gml
# type: vector
- algorithm: gdal:ogrinfo
name: ogrinfo
params:
INPUT:
name: lines.gml
type: vector
SUMMARY_ONLY: 'True'
results:
OUTPUT:
name: expected/gdal/vector_info.html
type: regex
rules:
- 'Extent: \(-1.000000, -3.000000\) - \(11.000000, 5.000000\)'
- 'Geometry: Line String'
- 'Feature Count: [6|7]' # On some platforms returns 6 instead of 7...
- algorithm: gdal:buffervectors
name: Buffer lines
params:
DISSOLVEALL: false
DISTANCE: 1.0
GEOMETRY: geometry
INPUT_LAYER:
name: lines.gml
type: vector
MULTI: false
results:
OUTPUT_LAYER:
name: expected/gdal/buffer_lines.gml
type: vector
compare:
geometry:
precision: 7
expectedFailure:
- int(1)
- algorithm: gdal:buffervectors
name: Basic polygon buffer
params:
DISSOLVEALL: false
DISTANCE: 0.5
GEOMETRY: geometry
INPUT_LAYER:
name: polys.gml
type: vector
MULTI: false
results:
OUTPUT_LAYER:
name: expected/gdal/buffer_polys.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: gdal:buffervectors
name: Polygon buffer with dissolve
params:
DISSOLVEALL: true
DISTANCE: 0.5
GEOMETRY: geometry
INPUT_LAYER:
name: polys.gml
type: vector
MULTI: false
results:
OUTPUT_LAYER:
name: expected/gdal/buffer_polys_dissolve.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: gdal:createpointsalonglines
name: Points along lines
params:
DISTANCE: 0.25
GEOMETRY: geometry
INPUT_LAYER:
name: lines.gml
type: vector
results:
OUTPUT_LAYER:
name: expected/gdal/points_along_lines.gml
type: vector
- algorithm: gdal:offsetlinesforlines
name: Offset lines for lines (right-handed)
params:
DISSOLVEALL: false
GEOMETRY: geometry
INPUT_LAYER:
name: lines.gml
type: vector
MULTI: false
RADIUS: -0.5
results:
OUTPUT_LAYER:
name: expected/gdal/offset_lines.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: gdal:singlesidedbufferforlines
name: One-side buffer for lines (left-handed)
params:
DISSOLVEALL: false
GEOMETRY: geometry
INPUT_LAYER:
name: lines.gml
type: vector
LEFTRIGHT: '1'
MULTI: false
RADIUS: 0.5
results:
OUTPUT_LAYER:
name: expected/gdal/one_side_buffer.gml
type: vector
compare:
geometry:
precision: 7
- algorithm: gdal:aspect
name: Aspect with standard parameters
params:
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
TRIG_ANGLE: false
ZERO_FLAT: false
ZEVENBERGEN: false
results:
OUTPUT:
hash: 8436df662a44a00762aa29768e5d6ecfaf2d42e9a4da02d8afc6e3f6
type: rasterhash
- algorithm: gdal:aspect
name: Aspect without NULL (-9999) values (0 instead)
params:
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
TRIG_ANGLE: false
ZERO_FLAT: true
ZEVENBERGEN: false
results:
OUTPUT:
hash: 43cccb440c7febb0095103eee3509b740e9f1bf2b3ad3b8a4c25622e
type: rasterhash
- algorithm: gdal:aspect
name: Aspect with trigonometric angle
params:
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
TRIG_ANGLE: true
ZERO_FLAT: false
ZEVENBERGEN: false
results:
OUTPUT:
hash: a95e8a09a613b551d3f33dfb4975c430f599dc55f761063ae9529124
type: rasterhash
- algorithm: gdal:aspect
name: Aspect zevenbergen
params:
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
TRIG_ANGLE: false
ZERO_FLAT: false
ZEVENBERGEN: true
results:
OUTPUT:
hash: 2cd5868b21efbd286f4977795143c89df77ac8976f8bc2a2c4e310d8
type: rasterhash
- algorithm: gdal:aspect
name: Aspect with edges
params:
BAND: 1
COMPUTE_EDGES: true
INPUT:
name: dem.tif
type: raster
TRIG_ANGLE: false
ZERO_FLAT: false
ZEVENBERGEN: false
results:
OUTPUT:
hash: d3a354c6e5f207779bb58f9bd23fd89a9f90a77d81aafc661d0ae077
type: rasterhash
- algorithm: gdal:cliprasterbyextent
name: Clip raster by extent
params:
BIGTIFF: '0'
COMPRESS: '4'
INPUT:
name: dem.tif
type: raster
JPEGCOMPRESSION: 75
PREDICTOR: 1
PROJWIN: 18.67551824296977,18.697800756150787,45.78984181545589,45.804309302274866
RTYPE: '5'
TFW: false
TILED: false
ZLEVEL: 6
results:
OUTPUT:
hash: 9913a7c0e1ced2c2ce1cd8f0e8103475bc2b0dd4d1d0adafe4920f93
type: rasterhash
- algorithm: gdal:cliprasterbyextent
name: Clip raster by extent and change no data values
params:
BIGTIFF: '0'
COMPRESS: '4'
INPUT:
name: dem.tif
type: raster
JPEGCOMPRESSION: 75
NO_DATA: '-9999'
PREDICTOR: 1
PROJWIN: 18.67460436727692,18.698371162148714,45.78995019401027,45.804344168369234
RTYPE: '5'
TFW: false
TILED: false
ZLEVEL: 6
results:
OUTPUT:
hash: df5de501bcec0c10f738d77f3b48d5545b48f0a22e0e028a8b1ccbe7
type: rasterhash
- algorithm: gdal:cliprasterbymasklayer
name: Clip raster by mask layer
params:
ALPHA_BAND: false
BIGTIFF: '0'
COMPRESS: '4'
CROP_TO_CUTLINE: true
INPUT:
name: dem.tif
type: raster
JPEGCOMPRESSION: 75
KEEP_RESOLUTION: false
MASK:
name: custom/polygon_mask.gml
type: vector
PREDICTOR: 1
RTYPE: '5'
TFW: false
TILED: false
ZLEVEL: 6
results:
OUTPUT:
hash: 4f4720e4efe59a7f238f622659917bbeb5262369d15d5e2917dbcf8b
type: rasterhash
- algorithm: gdal:cliprasterbymasklayer
name: Clip raster by mask layer and change no data value
params:
ALPHA_BAND: false
BIGTIFF: '0'
COMPRESS: '4'
CROP_TO_CUTLINE: true
INPUT:
name: dem.tif
type: raster
JPEGCOMPRESSION: 75
KEEP_RESOLUTION: false
MASK:
name: custom/polygon_mask.gml
type: vector
NO_DATA: '-9999'
PREDICTOR: 1
RTYPE: '5'
TFW: false
TILED: false
ZLEVEL: 6
results:
OUTPUT:
hash: 1e0252e63c65dcf4ed1f2b17d2490d3e0331aeb59d8f59b59554f442
type: rasterhash
- algorithm: gdal:cliprasterbymasklayer
name: Clip raster by mask layer and add alpha band
params:
ALPHA_BAND: true
BIGTIFF: '0'
COMPRESS: '4'
CROP_TO_CUTLINE: true
INPUT:
name: dem.tif
type: raster
JPEGCOMPRESSION: 75
KEEP_RESOLUTION: false
MASK:
name: custom/polygon_mask.gml
type: vector
PREDICTOR: 1
RTYPE: '5'
TFW: false
TILED: false
ZLEVEL: 6
results:
OUTPUT:
hash: 8f69431c6ff7db5174c1ca8e879ae39582fd4ce86f9b53edae0f38ce
type: rasterhash
- algorithm: gdal:hillshade
name: Hillshade
params:
ALTITUDE: 45.0
AZIMUTH: 315.0
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
SCALE: 1.0
ZEVENBERGEN: false
Z_FACTOR: 1.0
results:
OUTPUT:
hash: e5cf91b875b918682e456463165eddc4af4ae8855b143068e198ce2a
type: rasterhash
- algorithm: gdal:hillshade
name: Hillshade with edges calculation
params:
ALTITUDE: 45.0
AZIMUTH: 315.0
BAND: 1
COMPUTE_EDGES: true
INPUT:
name: dem.tif
type: raster
SCALE: 1.0
ZEVENBERGEN: false
Z_FACTOR: 1.0
results:
OUTPUT:
hash: 570671408b020c9cc817e876f0e8081e0b11920c7d297abfe1cb3368
type: rasterhash
- algorithm: gdal:hillshade
name: Hillshade with Zevenbergen formula
params:
ALTITUDE: 45.0
AZIMUTH: 315.0
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
SCALE: 1.0
ZEVENBERGEN: true
Z_FACTOR: 1.0
results:
OUTPUT:
hash: ce2174ab155023367d38785fb867456c6a1ae3535ea0ec5ad7a694d5
type: rasterhash
- algorithm: gdal:slope
name: Slope
params:
AS_PERCENT: false
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
SCALE: 1.0
ZEVENBERGEN: false
results:
OUTPUT:
hash: 319c470de3315f440371d5df8a6e478a8ecaf1cf904a013dbf1b3a6a
type: rasterhash
- algorithm: gdal:slope
name: Slope with edges
params:
AS_PERCENT: false
BAND: 1
COMPUTE_EDGES: true
INPUT:
name: dem.tif
type: raster
SCALE: 1.0
ZEVENBERGEN: false
results:
OUTPUT:
hash: f7f8df8b6517fd8660304f7f2fbd6ade2ae68035f4dd9a224c80b465
type: rasterhash
- algorithm: gdal:slope
name: Slope with Zevenbergen formula
params:
AS_PERCENT: false
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
SCALE: 1.0
ZEVENBERGEN: true
results:
OUTPUT:
hash: 90e42b1bc7be9cf7b4a729c6db44dde0bba39dd33012ade6bc8080e7
type: rasterhash
- algorithm: gdal:slope
name: Slope with percent instead of degree
params:
AS_PERCENT: true
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
SCALE: 1.0
ZEVENBERGEN: false
results:
OUTPUT:
hash: c9dc888254a571e7fbf66691fb72b35f030f87decf59ce67e32ad89d
type: rasterhash
- algorithm: gdal:roughness
name: standard roughness
params:
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
results:
OUTPUT:
hash: ee2b317e022da1001378fac60c9b613a74d3566b9870f9d121e6e322
type: rasterhash
- algorithm: gdal:roughness
name: roughness with edges
params:
BAND: 1
COMPUTE_EDGES: true
INPUT:
name: dem.tif
type: raster
results:
OUTPUT:
hash: aba5167b8a2e97a93b22d406e0363f91c151fd353c0fc56ce24ac5fc
type: rasterhash
- algorithm: gdal:triterrainruggednessindex
name: standard TRI
params:
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
results:
OUTPUT:
hash: c888764a08fae72a129dfff4947149c3185532373d33d4537ecf409c
type: rasterhash
- algorithm: gdal:triterrainruggednessindex
name: TRI with edges
params:
BAND: 1
COMPUTE_EDGES: true
INPUT:
name: dem.tif
type: raster
results:
OUTPUT:
hash: 07376c74de869323125ceacbb5e34438655ff73f63d4b3ff3e268f7f
type: rasterhash
- algorithm: gdal:nearblack
name: standard near black
params:
INPUT:
name: dem.tif
type: raster
NEAR: 15
WHITE: false
results:
OUTPUT:
hash: fff4a08498e93494f3f2cf1a9074451e6fd68341849aedc9e2c45e6a
type: rasterhash
- algorithm: gdal:tpitopographicpositionindex
name: standard TPI
params:
BAND: 1
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
results:
OUTPUT:
hash: 4af1fe42d2a75c92eb9edcad9d77bd6cae958c0212de11e320fad689
type: rasterhash
- algorithm: gdal:tpitopographicpositionindex
name: TPI with edges
params:
BAND: 1
COMPUTE_EDGES: true
INPUT:
name: dem.tif
type: raster
results:
OUTPUT:
hash: f468bb08cbede2b606018a7a45a51cc221307a8421a11daefabeac12
type: rasterhash