Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add new polys and multipolys test datasets
- Loading branch information
Showing
3 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
109 changes: 109 additions & 0 deletions
109
python/plugins/processing/tests/testdata/algorithm_tests.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# See ../README.md for a description of the file format | ||
|
||
tests: | ||
- 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: proc # file is in the qgis tests/testdata directory | ||
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: deleteholes | ||
algorithm: qgis:deleteholes | ||
params: | ||
- type: vector | ||
location: qgs | ||
name: polys.shp | ||
results: | ||
OUTPUT: | ||
type: vector | ||
location: proc | ||
name: expected/polys_deleteholes.geojson | ||
|
||
- name: densify | ||
algorithm: qgis:densifygeometries | ||
params: | ||
- type: vector | ||
location: qgs | ||
name: polys.shp | ||
- 2 # Interval | ||
results: | ||
OUTPUT: | ||
type: vector | ||
location: proc | ||
name: expected/polys_densify.geojson | ||
|
||
- name: polygonstolines | ||
algorithm: qgis:polygonstolines | ||
params: | ||
- type: vector | ||
location: qgs | ||
name: polys.shp | ||
results: | ||
OUTPUT: | ||
type: vector | ||
location: proc | ||
name: expected/polys_to_lines.geojson | ||
|
||
- name: reverselinedirection | ||
algorithm: qgis:reverselinedirection | ||
params: | ||
- type: vector | ||
location: qgs | ||
name: lines.shp | ||
results: | ||
OUTPUT_LAYER: | ||
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 | ||
params: | ||
- type: vector | ||
location: qgs | ||
name: polys.shp | ||
- Name # Field to calculate frequency on | ||
results: | ||
Frequency: | ||
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 |
10 changes: 10 additions & 0 deletions
10
python/plugins/processing/tests/testdata/multipolys.geojson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
|
||
"features": [ | ||
{ "type": "Feature", "properties": { "Bname": "Test", "Bintval": 1, "Bfloatval": 0.123 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 2.0, 1.0 ], [ 2.0, 2.0 ], [ 3.0, 2.0 ], [ 3.0, 3.0 ], [ 4.0, 3.0 ], [ 4.0, 1.0 ], [ 2.0, 1.0 ] ] ] ] } }, | ||
{ "type": "Feature", "properties": { "Bname": null, "Bintval": null, "Bfloatval": null }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 7.0, -1.0 ], [ 8.0, -1.0 ], [ 8.0, 3.0 ], [ 7.0, 3.0 ], [ 7.0, -1.0 ] ] ], [ [ [ 7.0, 6.0 ], [ 7.0, 5.0 ], [ 7.0, 4.0 ], [ 8.0, 4.0 ], [ 9.0, 5.0 ], [ 9.0, 6.0 ], [ 7.0, 6.0 ] ] ] ] } }, | ||
{ "type": "Feature", "properties": { "Bname": "Test", "Bintval": 2, "Bfloatval": -0.123 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 0.0, 0.0 ], [ 0.0, 1.0 ], [ 1.0, 1.0 ], [ 1.0, 0.0 ], [ 0.0, 0.0 ] ] ] ] } }, | ||
{ "type": "Feature", "properties": { "Bname": "Test", "Bintval": 3, "Bfloatval": 0 }, "geometry": null } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
|
||
"features": [ | ||
{ "type": "Feature", "properties": { "name": "aaaaa", "intval": 33, "floatval": 44.123456 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -1.0, -1.0 ], [ 2.0, -1.0 ], [ 2.0, 2.0 ], [ 3.0, 2.0 ], [ 3.0, 3.0 ], [ -1.0, 3.0 ], [ -1.0, -1.0 ] ] ] } }, | ||
{ "type": "Feature", "properties": { "name": "Aaaaa", "intval": -33, "floatval": 0}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 5.0, 5.0 ], [ 4.0, 4.0 ], [ 6.0, 4.0 ], [ 5.0, 5.0 ] ] ] } }, | ||
{ "type": "Feature", "properties": { "name": "bbaaa", "intval": null, "floatval": 0.123 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 2.0, 5.0 ], [ 2.0, 6.0 ], [ 3.0, 6.0 ], [ 3.0, 5.0 ], [ 2.0, 5.0 ] ] ] } }, | ||
{ "type": "Feature", "properties": { "name": "ASDF", "intval": 0, "floatval": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 6.0, 1.0 ], [ 10.0, 1.0 ], [ 10.0, -3.0 ], [ 6.0, -3.0 ], [ 6.0, 1.0 ] ], [ [ 7.0, 0.0 ], [ 9.0, 0.0 ], [ 9.0, -2.0 ], [ 7.0, -2.0 ], [ 7.0, 0.0 ] ] ] } }, | ||
{ "type": "Feature", "properties": { "name": null, "intval": 120, "floatval": -100291.43213 }, "geometry": null } | ||
] | ||
} |