Skip to content

Commit

Permalink
[processing] split v.surf.rst algorithm into two (fix #19472)
Browse files Browse the repository at this point in the history
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 c2465fc
Show file tree
Hide file tree
Showing 19 changed files with 113 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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.