Skip to content
Permalink
Browse files
[sextante]minor fixes and added new R script examples
  • Loading branch information
volaya committed Feb 17, 2013
1 parent 329062b commit 5fead9fb64c7c15d07f6fe5570bf1978e4b81e2b
@@ -346,7 +346,11 @@ def __str__(self):


def commandLineName(self):
return self.provider.getName().lower().replace(" ", "") + ":" + self.name.lower().replace(" ", "").replace(",","")
name = self.provider.getName().lower() + ":" + self.name.lower()
validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:"
name = ''.join(c for c in name if c in validChars)
return name


def removeOutputFromName(self, name):
for out in self.outputs:
@@ -106,7 +106,7 @@ def initGUI(self):
if param.isAdvanced:
self.advancedButton = QtGui.QPushButton()
self.advancedButton.setText("Show advanced parameters")
self.advancedButton.setMaximumWidth(150)
self.advancedButton.setMaximumWidth(250)
QtCore.QObject.connect(self.advancedButton, QtCore.SIGNAL("clicked()"), self.showAdvancedParametersClicked)
self.verticalLayout.addWidget(self.advancedButton)
break
@@ -193,8 +193,9 @@ def buttonToggled(self, value):
button.setChecked(False)

def getExtendedLayerName(self, layer):
if SextanteConfig.getSetting(SextanteConfig.SHOW_CRS_DEF):
return layer.name() + " [" + layer.crs().description() +"]"
authid = layer.crs().authid()
if SextanteConfig.getSetting(SextanteConfig.SHOW_CRS_DEF) and authid is not None:
return layer.name() + " [" + str(authid) +"]"
else:
return layer.name()

@@ -16,6 +16,7 @@
* *
***************************************************************************
"""
import os

__author__ = 'Victor Olaya'
__date__ = 'August 2012'
@@ -0,0 +1,5 @@
##[Example scripts]=group
##showplots
##layer=vector
##field=field layer
dotchart(layer[[field]],main=paste("Dotplot of",field),xlab=paste(field),ylab="Observation number")
@@ -0,0 +1,18 @@
(dp0
S'ALG_CREATOR'
p1
VFilipe S. Dias
p2
sS'field'
p3
VVector's field
p4
sS'ALG_DESC'
p5
VThis tools uses the "dotchart()" function to create a Cleveland dotplot of a given field.
p6
sS'layer'
p7
VVector layer
p8
s.
@@ -0,0 +1,5 @@
##[Example scripts]=group
##showplots
##layer=vector
##field=field layer
hist(layer[[field]],main=paste("Histogram of",field),xlab=paste(field))
@@ -0,0 +1,22 @@
(dp0
S'ALG_CREATOR'
p1
VFilipe S. Dias
p2
sS'field'
p3
VVector's field
p4
sS'ALG_DESC'
p5
VThis tool uses the "hist()" function to create a histogram, using Sturges rule.
p6
sS'ALG_HELP_CREATOR'
p7
VFilipe S. Dias
p8
sS'layer'
p9
VVector layer
p10
s.
@@ -0,0 +1,14 @@
##[Example scripts]=group
##layer=vector
##field=field layer
Summary_statistics<-data.frame(name.i=rbind(length(layer[[field]]),
length(unique(layer[[field]])),
min(layer[[field]]),
max(layer[[field]]),
max(layer[[field]])-min(layer[[field]]),
mean(layer[[field]]),
median(layer[[field]]),
sd(layer[[field]])),row.names=c("Count:","Unique values:","Minimum value:","Maximum value:","Range:","Mean value:","Median value:","Standard deviation:"))
colnames(Summary_statistics)<-c(field)
>Summary_statistics

@@ -0,0 +1,18 @@
(dp0
S'ALG_CREATOR'
p1
VFilipe S. Dias
p2
sS'field'
p3
VVector's field
p4
sS'ALG_DESC'
p5
VThis tool computes the following summary statistics for the input field:\u000a\u000a- Minimum value, using "min()"\u000a\u000a- Maximum value, using "max()"\u000a\u000a- Range, which the difference between the maximum and the minimum value\u000a\u000a- Mean value, using "mean()"\u000a\u000a- Median value, using "median()"\u000a\u000a- Standard deviation, using "sd"\u000a\u000a\u000a
p6
sS'layer'
p7
VVector layer
p8
s.
@@ -0,0 +1,4 @@
##[Example scripts]=group
##layer=vector
##field=field layer
>table(layer[[field]])
@@ -0,0 +1,18 @@
(dp0
S'ALG_CREATOR'
p1
VFilipe S. Dias
p2
sS'field'
p3
VVector's field
p4
sS'ALG_DESC'
p5
VThis tool created a table of counts for a given field, using the function "table()".
p6
sS'layer'
p7
VVector layer
p8
s.

0 comments on commit 5fead9f

Please sign in to comment.