This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##input_polygons=vector | |
##ref_x=number 5 | |
##ref_y=number 4 | |
##out_pnt_file=output vector | |
##out_ln_file=output vector | |
# Extract polygon nodes from polygons in a vector layer | |
# creates a point layer for the nodes, and a lien layer with | |
# with lies to the reference point from the closest node and the following node. | |
# Both out puts have four attributes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##input_polygons=vector | |
##node_field_name=string | |
from PyQt4.QtCore import * | |
from qgis.core import * | |
# get layer | |
layer = processing.getObjectFromUri(input_polygons) | |
progress.setInfo(node_field_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# paralell RF with foreach | |
# careful: no confusion, err.rate, mse and rsq components | |
# (as well as the corresponding components in the test compnent, if exist) | |
rf_parallel <- function(x, y, ntree=500, ncore=4, ...){ | |
require(foreach) | |
require(randomForest) | |
# optional parallel backend | |
if (ncore > 1) { | |
require(doParallel) | |
registerDoParallel(ncore) |