Skip to content
Permalink
Browse files

[processing] add tests for interpolation tools

  • Loading branch information
alexbruy committed Oct 19, 2016
1 parent ca66951 commit 58f31f1a82d8fe1f9649495fb28f7b59266f2b9a
@@ -11,6 +11,11 @@
<ExtentYMin>-5.00000</ExtentYMin>
<ExtentYMax>3.00000</ExtentYMax>
</DatasetSpecificInfo>
<PropertyDefn>
<Name>elev</Name>
<ElementPath>elev</ElementPath>
<Type>Integer</Type>
</PropertyDefn>
<PropertyDefn>
<Name>xcoord</Name>
<ElementPath>xcoord</ElementPath>
@@ -10,10 +10,11 @@
<gml:coord><gml:X>8</gml:X><gml:Y>3</gml:Y><gml:Z>7</gml:Z></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:add_geometry_pointz fid="points.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1,3</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>3</ogr:elev>
<ogr:xcoord>1</ogr:xcoord>
<ogr:ycoord>1</ogr:ycoord>
<ogr:zcoord>3</ogr:zcoord>
@@ -22,6 +23,7 @@
<gml:featureMember>
<ogr:add_geometry_pointz fid="points.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3,3,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>0</ogr:elev>
<ogr:xcoord>3</ogr:xcoord>
<ogr:ycoord>3</ogr:ycoord>
<ogr:zcoord>0</ogr:zcoord>
@@ -30,6 +32,7 @@
<gml:featureMember>
<ogr:add_geometry_pointz fid="points.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>2,2,2</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>2</ogr:elev>
<ogr:xcoord>2</ogr:xcoord>
<ogr:ycoord>2</ogr:ycoord>
<ogr:zcoord>2</ogr:zcoord>
@@ -38,6 +41,7 @@
<gml:featureMember>
<ogr:add_geometry_pointz fid="points.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5,2,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>0</ogr:elev>
<ogr:xcoord>5</ogr:xcoord>
<ogr:ycoord>2</ogr:ycoord>
<ogr:zcoord>0</ogr:zcoord>
@@ -46,6 +50,7 @@
<gml:featureMember>
<ogr:add_geometry_pointz fid="points.4">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,1,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>0</ogr:elev>
<ogr:xcoord>4</ogr:xcoord>
<ogr:ycoord>1</ogr:ycoord>
<ogr:zcoord>0</ogr:zcoord>
@@ -54,6 +59,7 @@
<gml:featureMember>
<ogr:add_geometry_pointz fid="points.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-5,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>5</ogr:elev>
<ogr:xcoord>0</ogr:xcoord>
<ogr:ycoord>-5</ogr:ycoord>
<ogr:zcoord>5</ogr:zcoord>
@@ -62,6 +68,7 @@
<gml:featureMember>
<ogr:add_geometry_pointz fid="points.6">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>8,-1,7</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>7</ogr:elev>
<ogr:xcoord>8</ogr:xcoord>
<ogr:ycoord>-1</ogr:ycoord>
<ogr:zcoord>7</ogr:zcoord>
@@ -70,6 +77,7 @@
<gml:featureMember>
<ogr:add_geometry_pointz fid="points.7">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7,-1,6</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>6</ogr:elev>
<ogr:xcoord>7</ogr:xcoord>
<ogr:ycoord>-1</ogr:ycoord>
<ogr:zcoord>6</ogr:zcoord>
@@ -78,6 +86,7 @@
<gml:featureMember>
<ogr:add_geometry_pointz fid="points.8">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-1,4</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>4</ogr:elev>
<ogr:xcoord>0</ogr:xcoord>
<ogr:ycoord>-1</ogr:ycoord>
<ogr:zcoord>4</ogr:zcoord>
@@ -0,0 +1,14 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>triangulation</Name>
<ElementPath>triangulation</ElementPath>
<GeometryType>2</GeometryType>
<DatasetSpecificInfo>
<FeatureCount>15</FeatureCount>
<ExtentXMin>0.00000</ExtentXMin>
<ExtentXMax>8.00000</ExtentXMax>
<ExtentYMin>-5.00000</ExtentYMin>
<ExtentYMax>3.00000</ExtentYMax>
</DatasetSpecificInfo>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -0,0 +1,89 @@
<?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</gml:X><gml:Y>-5</gml:Y></gml:coord>
<gml:coord><gml:X>8</gml:X><gml:Y>3</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:triangulation fid="triangulation.0">
<ogr:geometryProperty><gml:LineString><gml:coordinates>4,1 1,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.1">
<ogr:geometryProperty><gml:LineString><gml:coordinates>3,3 1,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.2">
<ogr:geometryProperty><gml:LineString><gml:coordinates>3,3 4,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.3">
<ogr:geometryProperty><gml:LineString><gml:coordinates>5,2 4,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.4">
<ogr:geometryProperty><gml:LineString><gml:coordinates>3,3 5,2</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.5">
<ogr:geometryProperty><gml:LineString><gml:coordinates>4,1 0,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.6">
<ogr:geometryProperty><gml:LineString><gml:coordinates>4,1 0,-5</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.7">
<ogr:geometryProperty><gml:LineString><gml:coordinates>7,-1 5,2</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.8">
<ogr:geometryProperty><gml:LineString><gml:coordinates>0,-1 1,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.9">
<ogr:geometryProperty><gml:LineString><gml:coordinates>0,-5 0,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.10">
<ogr:geometryProperty><gml:LineString><gml:coordinates>8,-1 0,-5</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.11">
<ogr:geometryProperty><gml:LineString><gml:coordinates>5,2 8,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.12">
<ogr:geometryProperty><gml:LineString><gml:coordinates>0,-5 7,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.13">
<ogr:geometryProperty><gml:LineString><gml:coordinates>8,-1 7,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
<gml:featureMember>
<ogr:triangulation fid="triangulation.14">
<ogr:geometryProperty><gml:LineString><gml:coordinates>4,1 7,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:triangulation>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -11,5 +11,10 @@
<ExtentYMin>-5.00000</ExtentYMin>
<ExtentYMax>3.00000</ExtentYMax>
</DatasetSpecificInfo>
<PropertyDefn>
<Name>elev</Name>
<ElementPath>elev</ElementPath>
<Type>Integer</Type>
</PropertyDefn>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -14,46 +14,55 @@
<gml:featureMember>
<ogr:pointsz fid="points.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1,3</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>3</ogr:elev>
</ogr:pointsz>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsz fid="points.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3,3,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>0</ogr:elev>
</ogr:pointsz>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsz fid="points.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>2,2,2</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>2</ogr:elev>
</ogr:pointsz>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsz fid="points.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5,2,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>0</ogr:elev>
</ogr:pointsz>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsz fid="points.4">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,1,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>0</ogr:elev>
</ogr:pointsz>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsz fid="points.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-5,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>5</ogr:elev>
</ogr:pointsz>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsz fid="points.6">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>8,-1,7</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>7</ogr:elev>
</ogr:pointsz>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsz fid="points.7">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7,-1,6</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>6</ogr:elev>
</ogr:pointsz>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsz fid="points.8">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-1,4</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:elev>4</ogr:elev>
</ogr:pointsz>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -871,7 +871,6 @@ tests:
name: expected/single_sided_buffer_multiline_bevel.gml
type: vector


- algorithm: qgis:extractnodes
name: Test (qgis:extractnodes)
params:
@@ -1006,7 +1005,6 @@ tests:
name: expected/add_geometry_pointz.gml
type: vector


- algorithm: qgis:countpointsinpolygon
name: Count points in polygon
params:
@@ -1124,3 +1122,83 @@ tests:
OUTPUT:
name: expected/multipoint_delaunay.gml
type: vector

- algorithm: qgis:idwinterpolationusingattribute
name: IDW interpolation using attribute
params:
ATTRIBUTE: elev
CELLSIZE_X: 0.02667
CELLSIZE_Y: 0.02667
COLUMNS: 300
DISTANCE_COEFFICIENT: 2.0
EXTENT: 0, 8, -5, 3
INPUT_LAYER:
name: pointsz.gml
type: vector
LAYER_TYPE: '0'
ROWS: 300
results:
OUTPUT_LAYER:
hash: 56d2671d50444f8571affba3f9e585830b82af5e380394178f521065
type: rasterhash

- algorithm: qgis:idwinterpolationusingzvalues
name: IDW interpolation using Z value
params:
CELLSIZE_X: 0.02667
CELLSIZE_Y: 0.02667
COLUMNS: 300
DISTANCE_COEFFICIENT: 2.0
EXTENT: 0, 8, -5, 3
INPUT_LAYER:
name: pointsz.gml
type: vector
LAYER_TYPE: '0'
ROWS: 300
results:
OUTPUT_LAYER:
hash: 56d2671d50444f8571affba3f9e585830b82af5e380394178f521065
type: rasterhash

- algorithm: qgis:tininterpolationusingattribute
name: TIN interpolation using attribute
params:
ATTRIBUTE: elev
CELLSIZE_X: 0.02667
CELLSIZE_Y: 0.02667
COLUMNS: 300
EXTENT: 0, 8, -5, 3
INPUT_LAYER:
name: pointsz.gml
type: vector
LAYER_TYPE: '0'
METHOD: '0'
ROWS: 300
results:
OUTPUT_LAYER:
hash: 87f40be6ec08f3fcbb5707762de71f6be35bb265c61f594335562a26
type: rasterhash
#TRIANULATION_FILE:
# name: expected/triangulation.gml
# type: vector

- algorithm: qgis:tininterpolationusingzvalues
name: TIN interpolation using Z value
params:
CELLSIZE_X: 0.02667
CELLSIZE_Y: 0.02667
COLUMNS: 300
EXTENT: 0, 8, -5, 3
INPUT_LAYER:
name: pointsz.gml
type: vector
LAYER_TYPE: '0'
METHOD: '1'
ROWS: 300
results:
OUTPUT_LAYER:
hash: 5e14dd0b879884b8b8da56c082947dad681feb4e9f1137f5cda126f8
type: rasterhash
#TRIANULATION_FILE:
# name: expected/triangulation.gml
# type: vector

0 comments on commit 58f31f1

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