File: gdal_algorithm_vector_tests.yaml

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 161
file content (403 lines) | stat: -rw-r--r-- 10,040 bytes parent folder | download | duplicates (6)
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
tests:

  - algorithm: gdal:buffervectors
    name: Buffer lines
    params:
      DISSOLVE: false
      DISTANCE: 0.5
      EXPLODE_COLLECTIONS: false
      GEOMETRY: geometry
      INPUT:
        name: lines.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/buffer_lines.gml
        type: vector
        compare:
          ignore_crs_check: true
          geometry:
            explode_collections: true
            normalize: true
            precision: 4

  - algorithm: gdal:buffervectors
    name: Buffer lines with dissolve
    params:
      DISSOLVE: true
      DISTANCE: 1.0
      EXPLODE_COLLECTIONS: false
      GEOMETRY: geometry
      INPUT:
        name: lines.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/buffer_lines_dissolve.gml
        type: vector
        compare: False # command line is already well tested, let's trust that GDAL gives correct result

  - algorithm: gdal:buffervectors
    name: Buffer polygons
    params:
      DISSOLVE: false
      DISTANCE: 0.5
      EXPLODE_COLLECTIONS: false
      GEOMETRY: geometry
      INPUT:
        name: polys.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/buffer_polys.gml
        type: vector
        compare:
          ignore_crs_check: true
          geometry:
            explode_collections: true
            normalize: true
            precision: 4

  - algorithm: gdal:buffervectors
    name: Buffer polygons with dissolve
    params:
      DISSOLVE: true
      DISTANCE: 0.5
      EXPLODE_COLLECTIONS: false
      GEOMETRY: geometry
      INPUT:
        name: polys.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/buffer_polys_dissolve.gml
        type: vector
        compare: False # command line is already well tested, let's trust that GDAL gives correct result

  - algorithm: gdal:clipvectorbyextent
    name: Clip points by extent
    params:
      EXTENT: 0.6180722891566264,5.408433734939758,0.4337349397590362,2.306024096385542
        [EPSG:4326]
      INPUT:
        name: points.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/clip_points.gml
        type: vector

  - algorithm: gdal:clipvectorbyextent
    name: Clip lines by extent
    params:
      EXTENT: 4.362348178137652,8.698380566801621,-1.193522267206478,3.0914979757085024
        [EPSG:4326]
      INPUT:
        name: lines.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/clip_lines.gml
        type: vector

  - algorithm: gdal:clipvectorbyextent
    name: Clip polygons by extent
    params:
      EXTENT: 0.7143072289156609,4.718222891566264,1.4430722891566266,5.390060240963856
        [EPSG:4326]
      INPUT:
        name: polys.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/clip_polygons.gml
        type: vector
        compare:
          geometry:
            normalize: true

# Fail on Travis with
# ERROR 1: TopologyException: Input geom 1 is invalid: Self-intersection at or near point 2 -1 at 2 -1
#  - algorithm: gdal:clipvectorbypolygon
#    name: Clip points by polygons
#    params:
#      INPUT:
#        name: points.gml
#        type: vector
#      MASK:
#        name: polys.gml
#        type: vector
#      OPTIONS: ''
#    results:
#      OUTPUT:
#        name: expected/gdal/clip_points_by_polygon.gml
#        type: vector
#
#  - algorithm: gdal:clipvectorbypolygon
#    name: Clip lines by polygons
#    params:
#      INPUT:
#        name: lines.gml
#        type: vector
#      MASK:
#        name: polys.gml
#        type: vector
#      OPTIONS: ''
#    results:
#      OUTPUT:
#        name: expected/gdal/clip_lines_by_polygon.gml
#        type: vector

  - algorithm: gdal:clipvectorbypolygon
    name: Clip lines by multipolygons (GEOS >= 3.11)
    condition:
      geos:
        at_least: 31100
    params:
      INPUT:
        name: lines.gml
        type: vector
      MASK:
        name: multipolys.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/geos311/clip_lines_by_multipolygon.gml
        type: vector

  - algorithm: gdal:clipvectorbypolygon
    name: Clip lines by multipolygons (GEOS < 3.11)
    condition:
      geos:
        less_than: 31100
    params:
      INPUT:
        name: lines.gml
        type: vector
      MASK:
        name: multipolys.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/clip_lines_by_multipolygon.gml
        type: vector

  - algorithm: gdal:executesql
    name: Execute SQL
    params:
      DIALECT: 0
      INPUT:
        name: polys.gml
        type: vector
      OPTIONS: ''
      SQL: SELECT * FROM polys2 WHERE intval=2
    results:
      OUTPUT:
        name: expected/gdal/execute_sql.gml
        type: vector

  - algorithm: gdal:offsetcurve
    name: Offset curve (right-sided) (GEOS >= 3.11)
    condition:
      geos:
        at_least: 31100
    params:
      DISTANCE: -0.5
      GEOMETRY: geometry
      INPUT:
        name: lines.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/geos311/offset_lines.gml
        type: vector
        compare:
          ignore_crs_check: true
          geometry:
            explode_collections: true

  - 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:ogrinfo
    name: ogrinfo all layers
    params:
      INPUT:
        name: points_lines.gpkg
        type: vector
      SUMMARY_ONLY: 'True'
      ALL_LAYERS: 'True'
    results:
      OUTPUT:
        name: expected/gdal/vector_info_2.html
        type: regex
        rules:
          - 'Layer name: points'
          - 'Geometry: Point'
          - 'Feature Count: 9'
          - 'Extent: \(0.000000, -5.000000\) - \(8.000000, 3.000000\)'
          - 'Layer name: lines'
          - 'Geometry: Line String'
          - 'Feature Count: 7'
          - 'Extent: \(-1.000000, -3.000000\) - \(11.000000, 5.000000\)'

  - algorithm: gdal:ogrinfojson
    name: ogrinfo (json)
    condition:
      gdal:
        at_least: 3070000
    params:
      INPUT:
        name: lines.gml
        type: vector
    results:
      OUTPUT:
        name: expected/gdal/vector_info.json
        type: regex
        rules:
          - '"extent":\[\n\s*-1.0,\s*-3.0,\n\s*11.0,\n\s*5.0\n\s*\],'
          - '"type":"LineString",'
          - '"featureCount":[6|7],' # On some platforms returns 6 instead of 7...

  - algorithm: gdal:ogrinfojson
    name: ogrinfo (json) all layers
    condition:
      gdal:
        at_least: 3070000
    params:
      INPUT:
        name: points_lines.gpkg
        type: vector
      ALL_LAYERS: true
    results:
      OUTPUT:
        name: expected/gdal/vector_info_2.json
        type: regex
        rules:
          - '"name":"points",'
          - '"type":"Point",'
          - '"extent":\[\n\s*0.0,\s*-5.0,\n\s*8.0,\n\s*3.0\n\s*\],'
          - '"featureCount":9,'
          - '"name":"lines",'
          - '"type":"LineString",'
          - '"extent":\[\n\s*-1.0,\s*-3.0,\n\s*11.0,\n\s*5.0\n\s*\],'
          - '"featureCount":7,'

  - algorithm: gdal:onesidebuffer
    name: One-sided buffer (left-handed)
    params:
      BUFFER_SIDE: 1
      DISSOLVE: false
      DISTANCE: 0.5
      EXPLODE_COLLECTIONS: false
      GEOMETRY: geometry
      INPUT:
        name: lines.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/one_side_buffer.gml
        type: vector
        compare:
          ignore_crs_check: true
          geometry:
            explode_collections: true
            normalize: true
            precision: 1
            snap_to_grid: .1

  - algorithm: gdal:pointsalonglines
    name: Points along lines
    params:
      DISTANCE: 0.25
      GEOMETRY: geometry
      INPUT:
        name: lines.gml
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/points_along_lines.gml
        type: vector
        compare:
          ignore_crs_check: true
          geometry:
            explode_collections: true

  - algorithm: gdal:dissolve
    name: Dissolve points (multipoint output)
    params:
      COMPUTE_AREA: false
      COMPUTE_STATISTICS: false
      COUNT_FEATURES: false
      EXPLODE_COLLECTIONS: false
      FIELD: TestField
      GEOMETRY: geometry
      INPUT:
        name: custom/dissolve_points.shp
        type: vector
      KEEP_ATTRIBUTES: false
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/gdal/dissolved_points.gml
        type: vector
        compare:
          fields:
            fid: skip

  - algorithm: gdal:convertformat
    name: Convert only one layer from GPKG to GML (gdal:convertformat)
    params:
      CONVERT_ALL_LAYERS: false
      INPUT:
        name: points_lines.gpkg|layername=points
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/results_convert_only_one_layer_points.gml
        type: vector
        compare:
          fields:
            fid: skip

  - algorithm: gdal:convertformat
    name: Convert all layers from GPKG to GML (gdal:convertformat)
    params:
      CONVERT_ALL_LAYERS: true
      INPUT:
        name: points_lines.gpkg|layername=points
        type: vector
      OPTIONS: ''
    results:
      OUTPUT:
        name: expected/results_convert_all_layers_points_lines.gml
        type: vector
        compare:
          fields:
            fid: skip