Skip to content

Commit

Permalink
[processing] Add expected test datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Feb 4, 2016
1 parent ff04fd3 commit 8adc871
Show file tree
Hide file tree
Showing 21 changed files with 400 additions and 167 deletions.
116 changes: 36 additions & 80 deletions python/plugins/processing/tests/testdata/algorithm_tests.yaml
@@ -1,109 +1,65 @@
# See ../README.md for a description of the file format

tests:
- name: centroid # Human readable identifier
- name: Centroid # Human readable identifier
algorithm: qgis:polygoncentroids # Algorithm name
params: # A list of parameters (only 1 here)
- type: vector # Param is a vector layer
location: qgs # file is in the qgis tests/testdata directory
name: polys.shp # file name
name: polys.geojson # file name
results: # A map of results (only one here)
OUTPUT_LAYER:
type: vector # Expected result is a vector layer
location: proc # The expected control layer is located in the processing testdata directory
name: expected/polys_centroid.geojson # The relative filepath from the processing testdata directory
name: expected/polys_centroid.gml # The relative filepath from the processing testdata directory
compare:
geometry:
precision: 7

- name: deleteholes
- name: Delete Holes
algorithm: qgis:deleteholes
params:
- type: vector
location: qgs
name: polys.shp
- name: polys.geojson
type: vector
results:
OUTPUT:
name: expected/polys_deleteholes.gml
type: vector
location: proc
name: expected/polys_deleteholes.geojson

- name: densify
algorithm: qgis:densifygeometries
# 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.
- name: Intersection (Collection Fallback)
algorithm: qgis:intersection
params:
- type: vector
location: qgs
name: polys.shp
- 2 # Interval
results:
OUTPUT:
INPUT:
name: multipolys.geojson
type: vector
INPUT2:
name: polys.geojson
type: vector
location: proc
name: expected/polys_densify.geojson

- name: polygonstolines
algorithm: qgis:polygonstolines
params:
- type: vector
location: qgs
name: polys.shp
results:
OUTPUT:
name: expected/intersection_collection_fallback.shp
type: vector
location: proc
name: expected/polys_to_lines.geojson

- name: reverselinedirection
algorithm: qgis:reverselinedirection
- name: Densify geometries
algorithm: qgis:densifygeometries
params:
- type: vector
location: qgs
name: lines.shp
- name: expected/polys_densify.gml
type: vector
- 4
results:
OUTPUT_LAYER:
OUTPUT:
name: expected/polys_densify.gml
type: vector
location: proc
name: expected/lines_reverse.geojson

# MK: 7.1.2016, Reenable once epsilon has been implemented
# - name: reproject
# algorithm: qgis:reprojectlayer
# params:
# - type: vector
# location: qgs
# name: france_parts.shp
# - 'EPSG:2192' # Quoted to make sure the colon isn't mistaken for a key/value pair
# results:
# OUTPUT:
# type: vector
# location: proc
# name: expected/reprojected_france_parts.geojson
# epsilon: 0.000001

- name: frequencyanalysis
algorithm: qgis:frequencyanalysis
- name: Polygons to Lines
algorithm: qgis:polygonstolines
params:
- type: vector
location: qgs
name: polys.shp
- Name # Field to calculate frequency on
- name: multipolys.geojson
type: vector
results:
Frequency:
OUTPUT:
name: expected/polys_to_lines.gml
type: vector
location: proc
name: expected/frequency.csv

# MK: 7.1.2016, Check why this fails on travis (string vs. integer field type)
# - name: sumlinelengths
# algorithm: qgis:sumlinelengths
# params:
# - type: vector
# location: qgs
# name: lines.shp
# - type: vector
# location: qgs
# name: rectangles.shp
# - length
# - count
# results:
# OUTPUT:
# type: vector
# location: proc
# name: expected/sumlinelengths.geojson
Binary file not shown.
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
@@ -0,0 +1 @@
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
Binary file not shown.
Binary file not shown.

This file was deleted.

0 comments on commit 8adc871

Please sign in to comment.