Skip to content
Permalink
Browse files

[processing] add tests for network analysis algorithms

Tests dissabled for now, as algorithms require access to QGIS iface.
  • Loading branch information
alexbruy committed Dec 13, 2016
1 parent 77ecfb9 commit ab823c4c66c9c60ca2b79b7ce4c45ac3ed7601f7
@@ -0,0 +1,16 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>fastest</Name>
<ElementPath>fastest</ElementPath>
<!--LINESTRING-->
<GeometryType>2</GeometryType>
<SRSName>EPSG:32733</SRSName>
<DatasetSpecificInfo>
<FeatureCount>1</FeatureCount>
<ExtentXMin>1000953.57974</ExtentXMin>
<ExtentXMax>1003540.98718</ExtentXMax>
<ExtentYMin>6219890.54669</ExtentYMin>
<ExtentYMax>6222358.69756</ExtentYMax>
</DatasetSpecificInfo>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -0,0 +1,19 @@
<?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>1000953.579740714</gml:X><gml:Y>6219890.54669478</gml:Y></gml:coord>
<gml:coord><gml:X>1003540.987180206</gml:X><gml:Y>6222358.69755776</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:fastest fid="fastest.0">
<ogr:geometryProperty><gml:LineString srsName="EPSG:32733"><gml:coordinates>1000953.57974071,6220312.94386716 1001107.24684923,6220391.87436156 1001202.14148585,6220278.54570253 1001223.5527025,6220254.162188 1001246.61300986,6220217.55052604 1001256.7885771,6220198.09709699 1001288.75671853,6220134.59225221 1001316.12250986,6220076.61143154 1001343.39016642,6220022.54512089 1001398.88208812,6219947.57470368 1001446.00944971,6219890.54669478 1001690.15771473,6220308.37238282 1001859.8438323,6220539.82106708 1002257.84768038,6220937.82878925 1002518.75791724,6221133.53444839 1002622.66996036,6221162.46807726 1002667.16458207,6221195.87188063 1002845.50542017,6221400.90692838 1003028.1814962,6221611.96830289 1003474.59453034,6222127.67457486 1003406.90500878,6222189.64158806 1003472.3070191,6222272.11630568 1003483.81137232,6222286.60579404 1003540.98718021,6222358.69755776</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:fastest>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,22 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>servicearea</Name>
<ElementPath>servicearea</ElementPath>
<!--POLYGON-->
<GeometryType>3</GeometryType>
<SRSName>EPSG:32733</SRSName>
<DatasetSpecificInfo>
<FeatureCount>2</FeatureCount>
<ExtentXMin>1001968.37489</ExtentXMin>
<ExtentXMax>1003285.47179</ExtentXMax>
<ExtentYMin>6221400.90693</ExtentYMin>
<ExtentYMax>6222727.93692</ExtentYMax>
</DatasetSpecificInfo>
<PropertyDefn>
<Name>type</Name>
<ElementPath>type</ElementPath>
<Type>String</Type>
<Width>5</Width>
</PropertyDefn>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -0,0 +1,26 @@
<?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>1001968.37489204</gml:X><gml:Y>6221400.90692838</gml:Y></gml:coord>
<gml:coord><gml:X>1003285.47179071</gml:X><gml:Y>6222727.93691723</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:servicearea fid="servicearea.0">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:32733"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1002845.50542017,6221400.90692838 1001968.37489204,6221502.13083684 1002180.65496167,6222555.77455478 1002527.19655281,6222727.93691723 1003198.63616199,6222463.1404267 1003285.47179071,6222319.99149044 1002845.50542017,6221400.90692838</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:type>upper</ogr:type>
</ogr:servicearea>
</gml:featureMember>
<gml:featureMember>
<ogr:servicearea fid="servicearea.1">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:32733"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1002302.22841804,6221576.64258306 1002137.81278244,6221630.62018051 1002286.87770297,6222431.05239093 1002657.05576802,6222472.25802353 1002852.09477137,6222467.55382686 1003172.94058079,6222436.28679202 1003028.1814962,6221611.96830289 1002302.22841804,6221576.64258306</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:type>lower</ogr:type>
</ogr:servicearea>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,16 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>shortest</Name>
<ElementPath>shortest</ElementPath>
<!--LINESTRING-->
<GeometryType>2</GeometryType>
<SRSName>EPSG:32733</SRSName>
<DatasetSpecificInfo>
<FeatureCount>1</FeatureCount>
<ExtentXMin>1000953.57974</ExtentXMin>
<ExtentXMax>1003540.98718</ExtentXMax>
<ExtentYMin>6220312.94387</ExtentYMin>
<ExtentYMax>6222436.28679</ExtentYMax>
</DatasetSpecificInfo>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -0,0 +1,19 @@
<?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>1000953.57974071</gml:X><gml:Y>6220312.94386716</gml:Y></gml:coord>
<gml:coord><gml:X>1003540.98718021</gml:X><gml:Y>6222436.28679202</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:shortest fid="shortest.0">
<ogr:geometryProperty><gml:LineString srsName="EPSG:32733"><gml:coordinates>1000953.57974071,6220312.94386716 1001107.24684923,6220391.87436156 1001186.34740161,6220459.66433954 1001230.60014311,6220497.58606688 1001417.00785562,6220703.65963346 1001474.56242038,6220771.95914347 1001535.25328051,6220851.26299517 1001730.88604383,6221182.3451556 1001806.08518826,6221307.13224234 1001821.61736105,6221332.90322892 1001835.96992268,6221356.72100035 1001891.40736133,6221430.94581986 1001930.78353526,6221467.36521594 1001968.37489204,6221502.13083684 1002137.81278244,6221630.62018051 1002215.13556068,6221689.25446887 1002288.4678461,6221744.85964495 1002334.20638747,6221779.49098284 1002425.63766482,6221848.74446543 1002462.62346654,6221875.38780442 1002518.06990805,6221915.34875741 1002626.85249869,6221993.7562202 1002657.33259138,6222018.20620536 1002781.74783802,6222107.45193255 1002852.18578258,6222162.74032983 1002903.48249244,6222204.64725757 1002916.58033846,6222216.16749784 1002945.17950103,6222241.31856099 1002991.11072264,6222281.72914386 1003040.80096358,6222322.18412711 1003081.26058941,6222355.11171034 1003105.74257399,6222376.7841218 1003153.88971381,6222419.41498029 1003172.94058079,6222436.28679202 1003285.47179071,6222319.99149044 1003330.95107314,6222272.98904849 1003394.25380049,6222340.63979273 1003441.51556356,6222297.15044041 1003465.11136422,6222304.2892544 1003483.26027016,6222288.61783917 1003483.81137232,6222286.60579404 1003540.98718021,6222358.69755776</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:shortest>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -1162,7 +1162,7 @@ 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
@@ -1850,7 +1850,7 @@ tests:
type: rasterhash

- algorithm: qgis:rastercalculator
name: Raster Calculator
name: Raster Calculator
params:
LAYERS:
params:
@@ -1893,7 +1893,6 @@ tests:
geometry:
precision: 7


- algorithm: qgis:orthogonalize
name: Orthogonalize lines
params:
@@ -1908,3 +1907,56 @@ tests:
geometry:
precision: 7

# These tests dissabled because algs require access to iface which
# is not available in the test suite.
#- algorithm: qgis:shortestpath
# name: Shortest path (shortest route)
# params:
# DEFAULT_DIRECTION: '2'
# DEFAULT_SPEED: 5.0
# END_POINT: 1003534.816864,6222363.591221
# INPUT_VECTOR:
# name: roads.gml
# type: vector
# START_POINT: 1000943.661493,6220332.253368
# STRATEGY: '0'
# TOLERANCE: 0.0
# results:
# OUTPUT_LAYER:
# name: expected/shortest.gml
# type: vector

#- algorithm: qgis:shortestpath
# name: Shortest path (fastest route)
# params:
# DEFAULT_DIRECTION: '2'
# DEFAULT_SPEED: 60.0
# END_POINT: 1003534.816864,6222363.591221
# INPUT_VECTOR:
# name: roads.gml
# type: vector
# SPEED_FIELD: SPEED
# START_POINT: 1000943.661493,6220332.253368
# STRATEGY: '1'
# TOLERANCE: 0.0
# results:
# OUTPUT_LAYER:
# name: expected/fastest.gml
# type: vector

#- algorithm: qgis:servicearea
# name: Service area (route length)
# params:
# DEFAULT_DIRECTION: '2'
# DEFAULT_SPEED: 5.0
# INPUT_VECTOR:
# name: roads.gml
# type: vector
# START_POINT: 1002660.341692,6222015.780774
# STRATEGY: '0'
# TOLERANCE: 0.0
# TRAVEL_COST: 700.0
# results:
# OUTPUT_LAYER:
# name: expected/servicearea.gml
# type: vector
@@ -0,0 +1,21 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>roads</Name>
<ElementPath>roads</ElementPath>
<!--LINESTRING-->
<GeometryType>2</GeometryType>
<SRSName>EPSG:32733</SRSName>
<DatasetSpecificInfo>
<FeatureCount>105</FeatureCount>
<ExtentXMin>1000449.94001</ExtentXMin>
<ExtentXMax>1005036.20988</ExtentXMax>
<ExtentYMin>6219385.32394</ExtentYMin>
<ExtentYMax>6223414.48676</ExtentYMax>
</DatasetSpecificInfo>
<PropertyDefn>
<Name>SPEED</Name>
<ElementPath>SPEED</ElementPath>
<Type>Integer</Type>
</PropertyDefn>
</GMLFeatureClass>
</GMLFeatureClassList>

0 comments on commit ab823c4

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