Skip to content

Commit bf54b95

Browse files
Bernhard Ströblm-kuhn
authored andcommittedMar 14, 2016
[processing] test cases for splitlineswithlines
1 parent 0c719d6 commit bf54b95

File tree

7 files changed

+198
-0
lines changed

7 files changed

+198
-0
lines changed
 
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>lines_split_with_lines</Name>
4+
<ElementPath>lines_split_with_lines</ElementPath>
5+
<GeometryType>2</GeometryType>
6+
<SRSName>EPSG:4326</SRSName>
7+
<DatasetSpecificInfo>
8+
<FeatureCount>10</FeatureCount>
9+
<ExtentXMin>-1.00000</ExtentXMin>
10+
<ExtentXMax>11.00000</ExtentXMax>
11+
<ExtentYMin>-3.00000</ExtentYMin>
12+
<ExtentYMax>5.00000</ExtentYMax>
13+
</DatasetSpecificInfo>
14+
</GMLFeatureClass>
15+
</GMLFeatureClassList>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>-1</gml:X><gml:Y>-3</gml:Y></gml:coord>
10+
<gml:coord><gml:X>11</gml:X><gml:Y>5</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:lines_split_with_lines fid="lines.0">
16+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6,2 9,2 9,3 11,5</gml:coordinates></gml:LineString></ogr:geometryProperty>
17+
</ogr:lines_split_with_lines>
18+
</gml:featureMember>
19+
<gml:featureMember>
20+
<ogr:lines_split_with_lines fid="lines.1">
21+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1,-1 1,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
22+
</ogr:lines_split_with_lines>
23+
</gml:featureMember>
24+
<gml:featureMember>
25+
<ogr:lines_split_with_lines fid="lines.2">
26+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>2.0,1.863317714903586 2,2 3,2 3,3</gml:coordinates></gml:LineString></ogr:geometryProperty>
27+
</ogr:lines_split_with_lines>
28+
</gml:featureMember>
29+
<gml:featureMember>
30+
<ogr:lines_split_with_lines fid="lines.2">
31+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>2,0 2.0,1.863317714903586</gml:coordinates></gml:LineString></ogr:geometryProperty>
32+
</ogr:lines_split_with_lines>
33+
</gml:featureMember>
34+
<gml:featureMember>
35+
<ogr:lines_split_with_lines fid="lines.3">
36+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>4.216014897579145,1.0 5,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
37+
</ogr:lines_split_with_lines>
38+
</gml:featureMember>
39+
<gml:featureMember>
40+
<ogr:lines_split_with_lines fid="lines.3">
41+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>3,1 4.216014897579145,1.0</gml:coordinates></gml:LineString></ogr:geometryProperty>
42+
</ogr:lines_split_with_lines>
43+
</gml:featureMember>
44+
<gml:featureMember>
45+
<ogr:lines_split_with_lines fid="lines.4">
46+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>8.565567160553801,-3.0 10,-3</gml:coordinates></gml:LineString></ogr:geometryProperty>
47+
</ogr:lines_split_with_lines>
48+
</gml:featureMember>
49+
<gml:featureMember>
50+
<ogr:lines_split_with_lines fid="lines.4">
51+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7,-3 8.565567160553801,-3.0</gml:coordinates></gml:LineString></ogr:geometryProperty>
52+
</ogr:lines_split_with_lines>
53+
</gml:featureMember>
54+
<gml:featureMember>
55+
<ogr:lines_split_with_lines fid="lines.5">
56+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6.912027044184866,-2.087972955815135 10,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
57+
</ogr:lines_split_with_lines>
58+
</gml:featureMember>
59+
<gml:featureMember>
60+
<ogr:lines_split_with_lines fid="lines.5">
61+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6,-3 6.912027044184866,-2.087972955815135</gml:coordinates></gml:LineString></ogr:geometryProperty>
62+
</ogr:lines_split_with_lines>
63+
</gml:featureMember>
64+
</ogr:FeatureCollection>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>lines_split_with_same_lines</Name>
4+
<ElementPath>lines_split_with_same_lines</ElementPath>
5+
<GeometryType>2</GeometryType>
6+
<SRSName>EPSG:4326</SRSName>
7+
<DatasetSpecificInfo>
8+
<FeatureCount>4</FeatureCount>
9+
<ExtentXMin>0.77654</ExtentXMin>
10+
<ExtentXMax>8.57235</ExtentXMax>
11+
<ExtentYMin>-4.24413</ExtentYMin>
12+
<ExtentYMax>2.17905</ExtentYMax>
13+
</DatasetSpecificInfo>
14+
</GMLFeatureClass>
15+
</GMLFeatureClassList>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>0.776536312849161</gml:X><gml:Y>-4.244134078212291</gml:Y></gml:coord>
10+
<gml:coord><gml:X>8.572346368715085</gml:X><gml:Y>2.179050279329609</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:lines_split_with_same_lines fid="lines2.0">
16+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>5.445739457564294,-1.472531296140355 5.70391061452514,-1.991620111731844 8.572346368715085,-2.220391061452514 8.554748603351955,-4.244134078212291</gml:coordinates></gml:LineString></ogr:geometryProperty>
17+
</ogr:lines_split_with_same_lines>
18+
</gml:featureMember>
19+
<gml:featureMember>
20+
<ogr:lines_split_with_same_lines fid="lines2.0">
21+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>0.776536312849161,2.179050279329609 4.049720670391062,1.334357541899442 5.445739457564294,-1.472531296140355</gml:coordinates></gml:LineString></ogr:geometryProperty>
22+
</ogr:lines_split_with_same_lines>
23+
</gml:featureMember>
24+
<gml:featureMember>
25+
<ogr:lines_split_with_same_lines fid="lines2.1">
26+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>5.445739457564294,-1.472531296140355 4.595251396648044,-2.202793296089386</gml:coordinates></gml:LineString></ogr:geometryProperty>
27+
</ogr:lines_split_with_same_lines>
28+
</gml:featureMember>
29+
<gml:featureMember>
30+
<ogr:lines_split_with_same_lines fid="lines2.1">
31+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7.956424581005587,0.683240223463688 5.445739457564294,-1.472531296140355</gml:coordinates></gml:LineString></ogr:geometryProperty>
32+
</ogr:lines_split_with_same_lines>
33+
</gml:featureMember>
34+
</ogr:FeatureCollection>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>lines2</Name>
4+
<ElementPath>lines2</ElementPath>
5+
<GeometryType>2</GeometryType>
6+
<SRSName>EPSG:4326</SRSName>
7+
<DatasetSpecificInfo>
8+
<FeatureCount>2</FeatureCount>
9+
<ExtentXMin>0.77654</ExtentXMin>
10+
<ExtentXMax>8.57235</ExtentXMax>
11+
<ExtentYMin>-4.24413</ExtentYMin>
12+
<ExtentYMax>2.17905</ExtentYMax>
13+
</DatasetSpecificInfo>
14+
</GMLFeatureClass>
15+
</GMLFeatureClassList>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>0.7765363128491614</gml:X><gml:Y>-4.244134078212291</gml:Y></gml:coord>
10+
<gml:coord><gml:X>8.572346368715085</gml:X><gml:Y>2.179050279329609</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:lines2 fid="lines2.0">
16+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>0.776536312849161,2.179050279329609 4.049720670391062,1.334357541899442 5.70391061452514,-1.991620111731844 8.572346368715085,-2.220391061452514 8.554748603351955,-4.244134078212291</gml:coordinates></gml:LineString></ogr:geometryProperty>
17+
</ogr:lines2>
18+
</gml:featureMember>
19+
<gml:featureMember>
20+
<ogr:lines2 fid="lines2.1">
21+
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7.956424581005587,0.683240223463688 4.595251396648044,-2.202793296089386</gml:coordinates></gml:LineString></ogr:geometryProperty>
22+
</ogr:lines2>
23+
</gml:featureMember>
24+
</ogr:FeatureCollection>

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,34 @@ tests:
8585
OUTPUT_HTML_FILE:
8686
name: expected/basic_statistics_string.html
8787
type: file
88+
89+
# Split lines with lines considers two cases
90+
# case 1: two different layers
91+
- algorithm: qgis:splitlineswithlines
92+
name: Split lines with lines
93+
params:
94+
INPUT_A:
95+
name: lines.gml
96+
type: vector
97+
INPUT_B:
98+
name: lines2.gml
99+
type: vector
100+
results:
101+
OUTPUT:
102+
name: expected/lines_split_with_lines.gml
103+
type: vector
104+
105+
# case 2 split line layer with iself
106+
- algorithm: qgis:splitlineswithlines
107+
name: Split lines with same lines
108+
params:
109+
INPUT_A:
110+
name: lines2.gml
111+
type: vector
112+
INPUT_B:
113+
name: lines2.gml
114+
type: vector
115+
results:
116+
OUTPUT:
117+
name: expected/lines_split_with_same_lines.gml
118+
type: vector

0 commit comments

Comments
 (0)
Please sign in to comment.