Skip to content

Commit f4b9bbd

Browse files
committed
Swap unit tests to use native algorithms
1 parent cecdf33 commit f4b9bbd

File tree

5 files changed

+43
-77
lines changed

5 files changed

+43
-77
lines changed

python/plugins/processing/tests/testdata/expected/extract_by_location_intersection.gfs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,5 @@
1212
<ExtentYMin>-3.00000</ExtentYMin>
1313
<ExtentYMax>3.00000</ExtentYMax>
1414
</DatasetSpecificInfo>
15-
<PropertyDefn>
16-
<Name>name</Name>
17-
<ElementPath>name</ElementPath>
18-
<Type>String</Type>
19-
<Width>5</Width>
20-
</PropertyDefn>
21-
<PropertyDefn>
22-
<Name>intval</Name>
23-
<ElementPath>intval</ElementPath>
24-
<Type>Integer</Type>
25-
</PropertyDefn>
26-
<PropertyDefn>
27-
<Name>floatval</Name>
28-
<ElementPath>floatval</ElementPath>
29-
<Type>Real</Type>
30-
</PropertyDefn>
3115
</GMLFeatureClass>
3216
</GMLFeatureClassList>

python/plugins/processing/tests/testdata/expected/extract_by_location_intersection.gml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,18 @@
1212
</gml:boundedBy>
1313

1414
<gml:featureMember>
15-
<ogr:extract_by_location_intersection fid="polys.0">
15+
<ogr:extract_by_location_intersection fid="extract_by_location_intersection.0">
1616
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17-
<ogr:name>aaaaa</ogr:name>
18-
<ogr:intval>33</ogr:intval>
19-
<ogr:floatval>44.123456</ogr:floatval>
2017
</ogr:extract_by_location_intersection>
2118
</gml:featureMember>
2219
<gml:featureMember>
23-
<ogr:extract_by_location_intersection fid="polys.3">
24-
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
25-
<ogr:name>ASDF</ogr:name>
26-
<ogr:intval>0</ogr:intval>
20+
<ogr:extract_by_location_intersection fid="extract_by_location_intersection.1">
21+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
2722
</ogr:extract_by_location_intersection>
2823
</gml:featureMember>
2924
<gml:featureMember>
30-
<ogr:extract_by_location_intersection fid="polys.5">
31-
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
32-
<ogr:name>elim</ogr:name>
33-
<ogr:intval>2</ogr:intval>
34-
<ogr:floatval>3.33</ogr:floatval>
25+
<ogr:extract_by_location_intersection fid="extract_by_location_intersection.2">
26+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
3527
</ogr:extract_by_location_intersection>
3628
</gml:featureMember>
3729
</ogr:FeatureCollection>

python/plugins/processing/tests/testdata/expected/extract_by_location_within.gfs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,5 @@
1212
<ExtentYMin>1.00000</ExtentYMin>
1313
<ExtentYMax>1.00000</ExtentYMax>
1414
</DatasetSpecificInfo>
15-
<PropertyDefn>
16-
<Name>id</Name>
17-
<ElementPath>id</ElementPath>
18-
<Type>Integer</Type>
19-
</PropertyDefn>
20-
<PropertyDefn>
21-
<Name>id2</Name>
22-
<ElementPath>id2</ElementPath>
23-
<Type>Integer</Type>
24-
</PropertyDefn>
2515
</GMLFeatureClass>
2616
</GMLFeatureClassList>

python/plugins/processing/tests/testdata/expected/extract_by_location_within.gml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@
1212
</gml:boundedBy>
1313

1414
<gml:featureMember>
15-
<ogr:extract_by_location_within fid="points.0">
15+
<ogr:extract_by_location_within fid="extract_by_location_within.0">
1616
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1</gml:coordinates></gml:Point></ogr:geometryProperty>
17-
<ogr:id>1</ogr:id>
18-
<ogr:id2>2</ogr:id2>
1917
</ogr:extract_by_location_within>
2018
</gml:featureMember>
2119
<gml:featureMember>
22-
<ogr:extract_by_location_within fid="points.4">
20+
<ogr:extract_by_location_within fid="extract_by_location_within.1">
2321
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,1</gml:coordinates></gml:Point></ogr:geometryProperty>
24-
<ogr:id>5</ogr:id>
25-
<ogr:id2>1</ogr:id2>
2622
</ogr:extract_by_location_within>
2723
</gml:featureMember>
2824
</ogr:FeatureCollection>

python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,38 +2970,42 @@ tests:
29702970
name: expected/convert_poly_nodes.gml
29712971
type: vector
29722972

2973-
# # - algorithm: qgis:extractbylocation
2974-
# # name: polygon intersecting points
2975-
# # params:
2976-
# # INPUT:
2977-
# # name: polys.gml
2978-
# # type: vector
2979-
# # INTERSECT:
2980-
# # name: custom/points.shp
2981-
# # type: vector
2982-
# # PRECISION: 0.0
2983-
# # PREDICATE: '[''intersects'']'
2984-
# # results:
2985-
# # OUTPUT:
2986-
# # name: expected/extract_by_location_intersection.gml
2987-
# # type: vector
2988-
# #
2989-
# # - algorithm: qgis:extractbylocation
2990-
# # name: points within polygons
2991-
# # params:
2992-
# # INPUT:
2993-
# # name: custom/points.shp
2994-
# # type: vector
2995-
# # INTERSECT:
2996-
# # name: polys.gml
2997-
# # type: vector
2998-
# # PRECISION: 0.0
2999-
# # PREDICATE: '[''within'']'
3000-
# # results:
3001-
# # OUTPUT:
3002-
# # name: expected/extract_by_location_within.gml
3003-
# # type: vector
3004-
#
2973+
- algorithm: native:extractbylocation
2974+
name: polygon intersecting points
2975+
params:
2976+
INPUT:
2977+
name: polys.gml
2978+
type: vector
2979+
INTERSECT:
2980+
name: custom/points.shp
2981+
type: vector
2982+
PREDICATE: 0
2983+
results:
2984+
OUTPUT:
2985+
name: expected/extract_by_location_intersection.gml
2986+
type: vector
2987+
compare:
2988+
fields:
2989+
fid: skip
2990+
2991+
- algorithm: native:extractbylocation
2992+
name: points within polygons
2993+
params:
2994+
INPUT:
2995+
name: custom/points.shp
2996+
type: vector
2997+
INTERSECT:
2998+
name: polys.gml
2999+
type: vector
3000+
PREDICATE: 6
3001+
results:
3002+
OUTPUT:
3003+
name: expected/extract_by_location_within.gml
3004+
type: vector
3005+
compare:
3006+
fields:
3007+
fid: skip
3008+
30053009
- algorithm: qgis:addfieldtoattributestable
30063010
name: add float field
30073011
params:

0 commit comments

Comments
 (0)