Skip to content
Permalink
Browse files

[processing] split v.surf.rst algorithm into two (fix #19472)

This algorithm cannot output cross-validation results and topographic
parameters simultaneously, hence two tools needed. Thanks to Pedro Venâncio
for finding this and proposing a fix.

(cherry picked from commit 34ec183)
  • Loading branch information
alexbruy authored and nyalldawson committed Jan 24, 2019
1 parent 8ce8ee0 commit c2465fc4a66425c296ffedb491d220a3db8ba453
Showing with 113 additions and 2 deletions.
  1. +20 −0 python/plugins/processing/algs/grass7/description/v.surf.rst.cvdev.txt
  2. +0 −2 python/plugins/processing/algs/grass7/description/v.surf.rst.txt
  3. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_cvdev.dbf
  4. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/v_surf_cvdev.prj
  5. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_cvdev.shp
  6. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_cvdev.shx
  7. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_deviations.dbf
  8. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_deviations.prj
  9. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_deviations.shp
  10. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_deviations.shx
  11. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_overlap.dbf
  12. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_overlap.prj
  13. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_overlap.shp
  14. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_overlap.shx
  15. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_quadtree.dbf
  16. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_quadtree.prj
  17. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_quadtree.shp
  18. BIN python/plugins/processing/tests/testdata/expected/grass7/v_surf_rst_quadtree.shx
  19. +89 −0 python/plugins/processing/tests/testdata/grass7_algorithms_vector_tests.yaml
@@ -0,0 +1,20 @@
v.surf.rst
v.surf.rst.cvdev - Performs surface interpolation from vector points map by splines.
Vector (v.*)
QgsProcessingParameterFeatureSource|input|Input points layer|0|None|False
QgsProcessingParameterField|zcolumn|Name of the attribute column with values to be used for approximation|None|input|-1|False|True
QgsProcessingParameterString|where|WHERE conditions of SQL statement without 'where' keyword|None|True|True
QgsProcessingParameterRasterLayer|mask|Name of the raster map used as mask|None|True
QgsProcessingParameterNumber|tension|Tension parameter|QgsProcessingParameterNumber.Double|40.0|True|None|None
QgsProcessingParameterNumber|smooth|Smoothing parameter|QgsProcessingParameterNumber.Double|None|True|None|None
QgsProcessingParameterField|smooth_column|Name of the attribute column with smoothing parameters|None|input|-1|False|True
QgsProcessingParameterNumber|segmax|Maximum number of points in a segment|QgsProcessingParameterNumber.Integer|40|True|0|None
QgsProcessingParameterNumber|npmin|Minimum number of points for approximation in a segment (>segmax)|QgsProcessingParameterNumber.Integer|300|True|0|None
QgsProcessingParameterNumber|dmin|Minimum distance between points (to remove almost identical points)|QgsProcessingParameterNumber.Double|None|True|0.0|None
QgsProcessingParameterNumber|dmax|Maximum distance between points on isoline (to insert additional points)|QgsProcessingParameterNumber.Double|None|True|None|None
QgsProcessingParameterNumber|zscale|Conversion factor for values used for approximation|QgsProcessingParameterNumber.Double|1.0|True|None|None
QgsProcessingParameterNumber|theta|Anisotropy angle (in degrees counterclockwise from East)|QgsProcessingParameterNumber.Double|None|True|0.0|360.0
QgsProcessingParameterNumber|scalex|Anisotropy scaling factor|QgsProcessingParameterNumber.Double|None|True|None|None
QgsProcessingParameterBoolean|-t|Use scale dependent tension|False
QgsProcessingParameterBoolean|-c|Perform cross-validation procedure without raster approximation [leave this option as True]|True
QgsProcessingParameterVectorDestination|cvdev|Cross Validation Errors|QgsProcessing.TypeVectorAnyGeometry|None|True
@@ -15,7 +15,6 @@ QgsProcessingParameterNumber|dmax|Maximum distance between points on isoline (to
QgsProcessingParameterNumber|zscale|Conversion factor for values used for approximation|QgsProcessingParameterNumber.Double|1.0|True|None|None
QgsProcessingParameterNumber|theta|Anisotropy angle (in degrees counterclockwise from East)|QgsProcessingParameterNumber.Double|None|True|0.0|360.0
QgsProcessingParameterNumber|scalex|Anisotropy scaling factor|QgsProcessingParameterNumber.Double|None|True|None|None
QgsProcessingParameterBoolean|-c|Perform cross-validation procedure without raster approximation|False
QgsProcessingParameterBoolean|-t|Use scale dependent tension|False
QgsProcessingParameterBoolean|-d|Output partial derivatives instead of topographic parameters|False
QgsProcessingParameterRasterDestination|elevation|Interpolated RST|None|True
@@ -25,6 +24,5 @@ QgsProcessingParameterRasterDestination|pcurvature|Profile curvature|None|True
QgsProcessingParameterRasterDestination|tcurvature|Tangential curvature|None|True
QgsProcessingParameterRasterDestination|mcurvature|Mean curvature|None|True
QgsProcessingParameterVectorDestination|deviations|Deviations|QgsProcessing.TypeVectorAnyGeometry|None|True
QgsProcessingParameterVectorDestination|cvdev|Cross Validation Errors|QgsProcessing.TypeVectorAnyGeometry|None|True
QgsProcessingParameterVectorDestination|treeseg|Quadtree Segmentation|QgsProcessing.TypeVectorAnyGeometry|None|True
QgsProcessingParameterVectorDestination|overwin|Overlapping Windows|QgsProcessing.TypeVectorAnyGeometry|None|True
Binary file not shown.
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file not shown.
Binary file not shown.
@@ -331,3 +331,92 @@ tests:
name: expected/grass7/buffer_polys_layer2.shp
type: vector

- algorithm: grass7:v.surf.rst.cvdev
name: v.surf.rst - cross-validation errors
params:
-c: true
-t: false
GRASS_MIN_AREA_PARAMETER: 0.0001
GRASS_OUTPUT_TYPE_PARAMETER: 0
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
GRASS_SNAP_TOLERANCE_PARAMETER: -1.0
GRASS_VECTOR_DSCO: ''
GRASS_VECTOR_LCO: ''
input:
name: pointsz.gml|layername=pointsz
type: vector
npmin: 300
segmax: 40
tension: 40.0
where: ''
zscale: 1.0
results:
cvdev:
name: expected/grass7/v_surf_cvdev.shp
type: vector
compare:
fields:
fid: skip
pk:
- cat

- algorithm: grass7:v.surf.rst
name: v.surf.rst - topographic parameters
params:
-d: false
-t: false
GRASS_MIN_AREA_PARAMETER: 0.0001
GRASS_OUTPUT_TYPE_PARAMETER: 0
GRASS_RASTER_FORMAT_META: ''
GRASS_RASTER_FORMAT_OPT: ''
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
GRASS_SNAP_TOLERANCE_PARAMETER: -1.0
GRASS_VECTOR_DSCO: ''
GRASS_VECTOR_LCO: ''
input:
name: pointsz.gml|layername=pointsz
type: vector
npmin: 300
segmax: 40
tension: 40.0
where: ''
zscale: 1.0
results:
aspect:
hash: 98016f6edabbb205fc75f48b3c48528ced79ec95cffd769398db46b7
type: rasterhash
deviations:
name: expected/grass7/v_surf_rst_deviations.shp
type: vector
compare:
fields:
fid: skip
pk:
- cat
elevation:
hash: d87fc419a0b9cd73a5c9ac7df4148eca3b5bee5094d7e19035bf8b72
type: rasterhash
mcurvature:
hash: 3f6836ee9fcf5523380be97b1753f49ede33058583979cad5c47c316
type: rasterhash
overwin:
name: expected/grass7/v_surf_rst_overlap.shp
type: vector
compare:
fields:
fid: skip
pcurvature:
hash: b654f95d858bc3e2f49ef34dc9ef1918b3f2dc41212d60a7bfc28972
type: rasterhash
slope:
hash: e3eb66180533f3ac9b44d825f173d1a477849ec3f4fb745d912bd4e8
type: rasterhash
tcurvature:
hash: b9201776ec61df5c197f335ab60f878cc394394cfa40272728283459
type: rasterhash
treeseg:
name: expected/grass7/v_surf_rst_quadtree.shp
type: vector
compare:
fields:
fid: skip

0 comments on commit c2465fc

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