Skip to content
Permalink
Browse files

Adding test to Line Intersection algorithm

Since both input and intersect layers have only one field (fid), the result is the same for both (existing and new) tests. The result now comes with the intersect field, renamed to fid_1 (previously not kept).
  • Loading branch information
gacarrillor authored and nyalldawson committed Nov 24, 2016
1 parent 193d400 commit dccd00dcb10b859f8568bb08bfdbc06142394dcc
@@ -2,6 +2,7 @@
<GMLFeatureClass>
<Name>line_intersection</Name>
<ElementPath>line_intersection</ElementPath>
<!--POINT-->
<GeometryType>1</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
@@ -11,5 +12,10 @@
<ExtentYMin>-0.22085</ExtentYMin>
<ExtentYMax>3.22098</ExtentYMax>
</DatasetSpecificInfo>
<PropertyDefn>
<Name>fid_1</Name>
<ElementPath>fid_1</ElementPath>
<Type>Integer</Type>
</PropertyDefn>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -13,22 +13,26 @@

<gml:featureMember>
<ogr:line_intersection fid="lines.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>9.220978076442222,3.220978076442222</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>9.22097807644222,3.22097807644222</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:fid_1>3</ogr:fid_1>
</ogr:line_intersection>
</gml:featureMember>
<gml:featureMember>
<ogr:line_intersection fid="lines.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3.0,2.8034726769992</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:fid_1>3</ogr:fid_1>
</ogr:line_intersection>
</gml:featureMember>
<gml:featureMember>
<ogr:line_intersection fid="lines.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3.155795677799609,1.0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3.15579567779961,1.0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:fid_1>2</ogr:fid_1>
</ogr:line_intersection>
</gml:featureMember>
<gml:featureMember>
<ogr:line_intersection fid="lines.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>8.779149848187174,-0.220850151812825</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>8.77914984818717,-0.220850151812825</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:fid_1>2</ogr:fid_1>
</ogr:line_intersection>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -1137,8 +1137,9 @@ tests:
hash: 7fe0e0174185fd743e23760f33615adf10f771b4275f320db6f7f4f8
type: rasterhash

# Case 1: Keep all fields
- algorithm: qgis:lineintersections
name: Line intersection
name: Line Intersection Keep All Fields from Both
params:
INPUT_A:
name: lines.gml
@@ -1150,6 +1151,23 @@ tests:
OUTPUT:
name: expected/line_intersection.gml
type: vector

# Case 2: Keep fid field from both layers
- algorithm: qgis:lineintersections
name: Line Intersection Keep fid from Both
params:
FIELD_A: fid
FIELD_B: fid
INPUT_A:
name: lines.gml
type: vector
INPUT_B:
name: simplify_lines.gml
type: vector
results:
OUTPUT:
name: expected/line_intersection.gml
type: vector

- algorithm: qgis:sumlinelengths
name: Sum line lengths

0 comments on commit dccd00d

Please sign in to comment.