File: qgis_algorithm_tests.yaml

package info (click to toggle)
qgis 2.18.28%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,007,948 kB
  • sloc: cpp: 671,774; python: 158,539; xml: 35,690; ansic: 8,346; sh: 1,766; perl: 1,669; sql: 999; yacc: 836; lex: 461; makefile: 292
file content (628 lines) | stat: -rw-r--r-- 15,210 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
# 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
        name: polys.gml # file name
    results: # A map of results (only one here)
      OUTPUT_LAYER:
        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: Delete Holes
    algorithm: qgis:deleteholes
    params:
    - name: polys.gml
      type: vector
    results:
      OUTPUT:
        name: expected/polys_deleteholes.gml
        type: vector

  - algorithm: qgis: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: qgis: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: qgis: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: qgis: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: qgis: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: qgis: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.
  - name: Intersection (Collection Fallback)
    algorithm: qgis:intersection
    params:
      INPUT:
        name: multipolys.gml
        type: vector
      INPUT2:
        name: polys.gml
        type: vector
      IGNORE_NULL: True
    results:
      OUTPUT:
        name: expected/intersection_collection_fallback.shp
        type: vector

  - name: Densify geometries
    algorithm: qgis:densifygeometries
    params:
    - name: multipolys.gml
      type: vector
    - '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

  - algorithm: qgis:basicstatisticsfornumericfields
    name: Test (qgis:basicstatisticsfornumericfields)
    params:
    - name: multipolys.gml
      type: vector
    - 'Bfloatval'
    results:
      OUTPUT_HTML_FILE:
        name: basic_statistics_numeric_float.html
        type: regex
        rules:
          - 'Analyzed layer: multipolys.gml'
          - '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:basicstatisticsfortextfields
    name: Test (qgis:basicstatisticsfortextfields)
    params:
    - name: multipolys.gml
      type: vector
    - 'Bname'
    results:
      OUTPUT_HTML_FILE:
        name: expected/basic_statistics_string.html
        type: file

  # 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:addautoincrementalfield
    name: Add autoincremental field
    params:
      INPUT:
        name: points.gml
        type: vector
    results:
      OUTPUT:
        name: expected/autoincrement_field.gml
        type: vector

  # Eliminate sliver polygons
  # case 1: merge with largest area
  - algorithm: qgis:eliminatesliverpolygons
    name: Eliminate sliver polygons largest area
    params:
      ATTRIBUTE: 'fid'
      COMPARISON: '0'
      COMPARISONVALUE: 'polys.5'
      INPUT:
        name: polys.gml
        type: vector
      KEEPSELECTION: 'False'
      MODE: '0'
    results:
      OUTPUT:
        name: expected/eliminate_largest_area.gml
        type: vector

  # case 2: merge with smallest area
  - algorithm: qgis:eliminatesliverpolygons
    name: Eliminate sliver polygons smallest area
    params:
      ATTRIBUTE: 'fid'
      COMPARISON: '0'
      COMPARISONVALUE: 'polys.5'
      INPUT:
        name: polys.gml
        type: vector
      KEEPSELECTION: 'False'
      MODE: '1'
    results:
      OUTPUT:
        name: expected/eliminate_smallest_area.gml
        type: vector

  # case 3: merge with longest common boundary
  - algorithm: qgis:eliminatesliverpolygons
    name: Eliminate sliver polygons largest area
    params:
      ATTRIBUTE: 'fid'
      COMPARISON: '0'
      COMPARISONVALUE: 'polys.5'
      INPUT:
        name: polys.gml
        type: vector
      KEEPSELECTION: 'False'
      MODE: '2'
    results:
      OUTPUT:
        name: expected/eliminate_largest_area.gml
        type: vector

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

  - algorithm: qgis:dissolve
    name: Dissolve using two fields
    params:
      DISSOLVE_ALL: false
      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: qgis:dissolve
    params:
      DISSOLVE_ALL: 'True'
      FIELD: None
      INPUT:
        name: custom/innerRingTouchesOuterRing.gml
        type: vector
    results:
      OUTPUT:
        type: vector
        name: expected/innerRingTouchesOuterRing_output.gml
        compare:
          geometry:
            precision: 5

  - name: Dissolve with NULL geometries
    algorithm: qgis:dissolve
    params:
      DISSOLVE_ALL: 'True'
      FIELD: None
      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: qgis:dissolve
    params:
      DISSOLVE_ALL: 'True'
      FIELD: None
      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

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

  - algorithm: qgis:mergelines
    name: Merge lines algorithm
    params:
      INPUT_LAYER:
        name: multilines.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/merge_lines.gml
        type: vector

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

  - algorithm: qgis:boundingboxes
    name: Bounding boxes for lines
    params:
      INPUT_LAYER:
        name: lines.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/lines_bounds.gml
        type: vector

  - algorithm: qgis:boundingboxes
    name: Bounding boxes for multilines
    params:
      INPUT_LAYER:
        name: multilines.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/multiline_bounds.gml
        type: vector

  - algorithm: qgis:boundingboxes
    name: Bounding boxes for multipolygons
    params:
      INPUT_LAYER:
        name: multipolys.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/multipoly_bounds.gml
        type: vector

  - algorithm: qgis:boundingboxes
    name: Bounding boxes for points
    params:
      INPUT_LAYER:
        name: points.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/point_bounds.gml
        type: vector

  - algorithm: qgis:boundingboxes
    name: Bounding boxes for polygons
    params:
      INPUT_LAYER:
        name: polys.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/poly_bounds.gml
        type: vector

  - algorithm: qgis:boundingboxes
    name: Bounding boxes for multipoints
    params:
      INPUT_LAYER:
        name: multipoints.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/multipoint_bounds.gml
        type: vector

  - algorithm: qgis:boundary
    name: Polygon boundary
    params:
      INPUT_LAYER:
        name: polys.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/poly_boundary.gml
        type: vector

  - algorithm: qgis:boundary
    name: Multipoly boundary
    params:
      INPUT_LAYER:
        name: multipolys.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/multipoly_boundary.gml
        type: vector

  - algorithm: qgis:boundary
    name: Line boundary
    params:
      INPUT_LAYER:
        name: lines.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/lines_boundary.gml
        type: vector

  - algorithm: qgis:boundary
    name: Multiline boundary
    params:
      INPUT_LAYER:
        name: multilines.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/multiline_boundary.gml
        type: vector

  - algorithm: qgis:pointonsurface
    name: Point on polygon surface
    params:
      INPUT_LAYER:
        name: polys.gml
        type: vector
    results:
      OUTPUT_LAYER:
        name: expected/point_on_poly.gml
        type: vector

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

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

  - algorithm: qgis:union
    name: Test Union (basic)
    params:
      INPUT:
        name: custom/union1_a.geojson
        type: vector
      INPUT2:
        name: custom/union1_b.geojson
        type: vector
    results:
      OUTPUT:
        name: expected/union1.gml
        type: vector
        # TODO: may need improvements to comparison
        # - unordered comparison
        #   (features could be written in different order and still being correct output)
        # - geometry equality comparison instead of WKT string comparison
        #   (geometries could different order of coordinate but still being correct output)

  - algorithm: qgis:singlepartstomultipart
    name: Singleparts to multiparts
    params:
      INPUT:
        name: custom/single_part_poly.gml
        type: vector
      FIELD: id
    results:
      OUTPUT:
        name: expected/single_to_multi.gml
        type: vector

  - algorithm: qgis:extractbyexpression
    name: Test (qgis:extractbyexpression)
    params:
      EXPRESSION: left("Name", 1) = 'A'
      INPUT:
        name: polys.gml
        type: vector
    results:
      OUTPUT:
        name: expected/extract_expression.gml
        type: vector