Skip to content

Commit 5fead9f

Browse files
committedFeb 17, 2013
[sextante]minor fixes and added new R script examples
1 parent 329062b commit 5fead9f

11 files changed

+114
-4
lines changed
 

‎python/plugins/sextante/core/GeoAlgorithm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,11 @@ def __str__(self):
346346

347347

348348
def commandLineName(self):
349-
return self.provider.getName().lower().replace(" ", "") + ":" + self.name.lower().replace(" ", "").replace(",","")
349+
name = self.provider.getName().lower() + ":" + self.name.lower()
350+
validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:"
351+
name = ''.join(c for c in name if c in validChars)
352+
return name
353+
350354

351355
def removeOutputFromName(self, name):
352356
for out in self.outputs:

‎python/plugins/sextante/gui/ParametersPanel.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def initGUI(self):
106106
if param.isAdvanced:
107107
self.advancedButton = QtGui.QPushButton()
108108
self.advancedButton.setText("Show advanced parameters")
109-
self.advancedButton.setMaximumWidth(150)
109+
self.advancedButton.setMaximumWidth(250)
110110
QtCore.QObject.connect(self.advancedButton, QtCore.SIGNAL("clicked()"), self.showAdvancedParametersClicked)
111111
self.verticalLayout.addWidget(self.advancedButton)
112112
break
@@ -193,8 +193,9 @@ def buttonToggled(self, value):
193193
button.setChecked(False)
194194

195195
def getExtendedLayerName(self, layer):
196-
if SextanteConfig.getSetting(SextanteConfig.SHOW_CRS_DEF):
197-
return layer.name() + " [" + layer.crs().description() +"]"
196+
authid = layer.crs().authid()
197+
if SextanteConfig.getSetting(SextanteConfig.SHOW_CRS_DEF) and authid is not None:
198+
return layer.name() + " [" + str(authid) +"]"
198199
else:
199200
return layer.name()
200201

‎python/plugins/sextante/parameters/ParameterRaster.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
import os
1920

2021
__author__ = 'Victor Olaya'
2122
__date__ = 'August 2012'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
##[Example scripts]=group
2+
##showplots
3+
##layer=vector
4+
##field=field layer
5+
dotchart(layer[[field]],main=paste("Dotplot of",field),xlab=paste(field),ylab="Observation number")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(dp0
2+
S'ALG_CREATOR'
3+
p1
4+
VFilipe S. Dias
5+
p2
6+
sS'field'
7+
p3
8+
VVector's field
9+
p4
10+
sS'ALG_DESC'
11+
p5
12+
VThis tools uses the "dotchart()" function to create a Cleveland dotplot of a given field.
13+
p6
14+
sS'layer'
15+
p7
16+
VVector layer
17+
p8
18+
s.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
##[Example scripts]=group
2+
##showplots
3+
##layer=vector
4+
##field=field layer
5+
hist(layer[[field]],main=paste("Histogram of",field),xlab=paste(field))
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(dp0
2+
S'ALG_CREATOR'
3+
p1
4+
VFilipe S. Dias
5+
p2
6+
sS'field'
7+
p3
8+
VVector's field
9+
p4
10+
sS'ALG_DESC'
11+
p5
12+
VThis tool uses the "hist()" function to create a histogram, using Sturges rule.
13+
p6
14+
sS'ALG_HELP_CREATOR'
15+
p7
16+
VFilipe S. Dias
17+
p8
18+
sS'layer'
19+
p9
20+
VVector layer
21+
p10
22+
s.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
##[Example scripts]=group
2+
##layer=vector
3+
##field=field layer
4+
Summary_statistics<-data.frame(name.i=rbind(length(layer[[field]]),
5+
length(unique(layer[[field]])),
6+
min(layer[[field]]),
7+
max(layer[[field]]),
8+
max(layer[[field]])-min(layer[[field]]),
9+
mean(layer[[field]]),
10+
median(layer[[field]]),
11+
sd(layer[[field]])),row.names=c("Count:","Unique values:","Minimum value:","Maximum value:","Range:","Mean value:","Median value:","Standard deviation:"))
12+
colnames(Summary_statistics)<-c(field)
13+
>Summary_statistics
14+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(dp0
2+
S'ALG_CREATOR'
3+
p1
4+
VFilipe S. Dias
5+
p2
6+
sS'field'
7+
p3
8+
VVector's field
9+
p4
10+
sS'ALG_DESC'
11+
p5
12+
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
13+
p6
14+
sS'layer'
15+
p7
16+
VVector layer
17+
p8
18+
s.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
##[Example scripts]=group
2+
##layer=vector
3+
##field=field layer
4+
>table(layer[[field]])
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(dp0
2+
S'ALG_CREATOR'
3+
p1
4+
VFilipe S. Dias
5+
p2
6+
sS'field'
7+
p3
8+
VVector's field
9+
p4
10+
sS'ALG_DESC'
11+
p5
12+
VThis tool created a table of counts for a given field, using the function "table()".
13+
p6
14+
sS'layer'
15+
p7
16+
VVector layer
17+
p8
18+
s.

0 commit comments

Comments
 (0)
Please sign in to comment.