Skip to content
Permalink
Browse files

[processing] test cases for splitlineswithlines

  • Loading branch information
bstroebl authored and m-kuhn committed Mar 14, 2016
1 parent 0c719d6 commit bf54b9529af4db639e59c36cdd2f182ff024fcfe
@@ -0,0 +1,15 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>lines_split_with_lines</Name>
<ElementPath>lines_split_with_lines</ElementPath>
<GeometryType>2</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
<FeatureCount>10</FeatureCount>
<ExtentXMin>-1.00000</ExtentXMin>
<ExtentXMax>11.00000</ExtentXMax>
<ExtentYMin>-3.00000</ExtentYMin>
<ExtentYMax>5.00000</ExtentYMax>
</DatasetSpecificInfo>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=""
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-1</gml:X><gml:Y>-3</gml:Y></gml:coord>
<gml:coord><gml:X>11</gml:X><gml:Y>5</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.0">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6,2 9,2 9,3 11,5</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1,-1 1,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.2">
<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>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.2">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>2,0 2.0,1.863317714903586</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.3">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>4.216014897579145,1.0 5,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.3">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>3,1 4.216014897579145,1.0</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.4">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>8.565567160553801,-3.0 10,-3</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.4">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7,-3 8.565567160553801,-3.0</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.5">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6.912027044184866,-2.087972955815135 10,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.5">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6,-3 6.912027044184866,-2.087972955815135</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,15 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>lines_split_with_same_lines</Name>
<ElementPath>lines_split_with_same_lines</ElementPath>
<GeometryType>2</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
<FeatureCount>4</FeatureCount>
<ExtentXMin>0.77654</ExtentXMin>
<ExtentXMax>8.57235</ExtentXMax>
<ExtentYMin>-4.24413</ExtentYMin>
<ExtentYMax>2.17905</ExtentYMax>
</DatasetSpecificInfo>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=""
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>0.776536312849161</gml:X><gml:Y>-4.244134078212291</gml:Y></gml:coord>
<gml:coord><gml:X>8.572346368715085</gml:X><gml:Y>2.179050279329609</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:lines_split_with_same_lines fid="lines2.0">
<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>
</ogr:lines_split_with_same_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_same_lines fid="lines2.0">
<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>
</ogr:lines_split_with_same_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_same_lines fid="lines2.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>5.445739457564294,-1.472531296140355 4.595251396648044,-2.202793296089386</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_same_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_same_lines fid="lines2.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7.956424581005587,0.683240223463688 5.445739457564294,-1.472531296140355</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines_split_with_same_lines>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,15 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>lines2</Name>
<ElementPath>lines2</ElementPath>
<GeometryType>2</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
<FeatureCount>2</FeatureCount>
<ExtentXMin>0.77654</ExtentXMin>
<ExtentXMax>8.57235</ExtentXMax>
<ExtentYMin>-4.24413</ExtentYMin>
<ExtentYMax>2.17905</ExtentYMax>
</DatasetSpecificInfo>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=""
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>0.7765363128491614</gml:X><gml:Y>-4.244134078212291</gml:Y></gml:coord>
<gml:coord><gml:X>8.572346368715085</gml:X><gml:Y>2.179050279329609</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:lines2 fid="lines2.0">
<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>
</ogr:lines2>
</gml:featureMember>
<gml:featureMember>
<ogr:lines2 fid="lines2.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7.956424581005587,0.683240223463688 4.595251396648044,-2.202793296089386</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines2>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -85,3 +85,34 @@ tests:
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: lines2.gml
type: vector
results:
OUTPUT:
name: expected/lines_split_with_lines.gml
type: vector

# case 2 split line layer with iself
- algorithm: qgis:splitlineswithlines
name: Split lines with same lines
params:
INPUT_A:
name: lines2.gml
type: vector
INPUT_B:
name: lines2.gml
type: vector
results:
OUTPUT:
name: expected/lines_split_with_same_lines.gml
type: vector

0 comments on commit bf54b95

Please sign in to comment.
You can’t perform that action at this time.