8 changes: 3 additions & 5 deletions python/plugins/sextante/grass/description/r.aspect.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
r.slope.aspect
r.aspect - Generates raster maps of aspect from a elevation raster map.
Raster (r.*)
ParameterRaster|elevation|Name of elevation raster map|False
ParameterSelection|format|Format for reporting the slope|percent;degrees
ParameterSelection|prec|Type of output aspect and slope maps|float;double;int
ParameterRaster|elevation|Elevation|False
ParameterSelection|prec|Data type|float;double;int
ParameterNumber|zfactor|Multiplicative factor to convert elevation units to meters|None|None|1.0
ParameterNumber|min_slp_allowed|Minimum slope val. (in percent) for which aspect is computed|None|None|0.0
ParameterBoolean|-a|Do not align the current region to the elevation layer|True
OutputRaster|aspect|Name for output aspect raster map
OutputRaster|aspect|Output aspect layer
9 changes: 3 additions & 6 deletions python/plugins/sextante/gui/OutputSelectionPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,18 @@
* *
***************************************************************************
"""

__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

import os.path

from PyQt4.QtCore import *
from PyQt4.QtGui import *

from qgis.gui import *

from sextante.core.SextanteConfig import SextanteConfig
from sextante.outputs.OutputVector import OutputVector

class OutputSelectionPanel(QWidget):

Expand Down Expand Up @@ -60,8 +57,8 @@ def buttonPushed(self):
saveToTemporaryFileAction = QAction("Save to a temporary file", self.pushButton)
saveToTemporaryFileAction.triggered.connect(self.saveToTemporaryFile)
popupmenu.addAction(saveToTemporaryFileAction )
if (self.alg.provider.supportsNonFileBasedOutput()):
saveToMemoryAction= QAction("Save to a memory layer...", self.pushButton)
if (isinstance(self.output, OutputVector) and self.alg.provider.supportsNonFileBasedOutput()):
saveToMemoryAction= QAction("Save to a memory layer", self.pushButton)
saveToMemoryAction.triggered.connect(self.saveToMemory)
popupmenu.addAction(saveToMemoryAction)
saveToFileAction = QAction("Save to file...", self.pushButton)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
##[Example scripts]=group
##input=vector
##numpolygons=number 10
##polygons=output vector

input = sextante.getObjectFromUri(input)
centerx = (input.extent().xMinimum() + input.extent().xMaximum()) / 2
centery = (input.extent().yMinimum() + input.extent().yMaximum()) / 2
width = (input.extent().xMaximum() - input.extent().xMinimum())
cellsize = width / numpolygons
height = (input.extent().yMaximum() - input.extent().yMinimum())
sextante.runalg("qgis:creategrid", cellsize, height, width, height, centerx, centery, 1, polygons)
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
Hex_grid_from_layer_bounds.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Victor Olaya'
__date__ = 'November 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

##[Example scripts]=group
##input=vector
##cellsize=number 1000.0
Expand All @@ -34,4 +9,4 @@
centery = (input.extent().yMinimum() + input.extent().yMaximum()) / 2
width = (input.extent().xMaximum() - input.extent().xMinimum())
height = (input.extent().yMaximum() - input.extent().yMinimum())
sextante.runalg("mmqgisx:creategrid", cellsize, cellsize, width, height, centerx, centery, 3, grid)
sextante.runalg("qgis:creategrid", cellsize, cellsize, width, height, centerx, centery, 3, grid)
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
Number_of_unique_values_in_classes.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Victor Olaya'
__date__ = 'November 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

#Definition of inputs and outputs
#==================================
##[Example scripts]=group
Expand Down
19 changes: 0 additions & 19 deletions python/plugins/sextante/script/scripts/Save_selected_features.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
Save_selected_features.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Victor Olaya'
__date__ = 'November 2012'
__copyright__ = '(C) 2012, Victor Olaya'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
Split_vector_layer_by_attribute.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Victor Olaya'
__date__ = 'November 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

#Definition of inputs and outputs
#==================================
##[Example scripts]=group
Expand Down Expand Up @@ -57,18 +32,17 @@
writers = {}

while provider.nextFeature(inFeat):
progress.setPercentage(int((100 * nElement)/nFeat))
nElement += 1
atMap = inFeat.attributeMap()
clazz = atMap[class_field_index].toString()
if clazz not in writers:
outputFile = output + "_" + str(len(writers)) + ".shp"
writers[clazz] = SextanteVectorWriter(outputFile, None, fields, provider.geometryType(), provider.crs() )
inGeom = inFeat.geometry()
outFeat.setGeometry(inGeom)
outFeat.setAttributeMap(atMap)
writers[clazz].addFeature(outFeat)

progress.setPercentage(int((100 * nElement)/nFeat))
nElement += 1
atMap = inFeat.attributeMap()
clazz = atMap[class_field_index].toString()
if clazz not in writers:
outputFile = output + "_" + str(len(writers)) + ".shp"
writers[clazz] = SextanteVectorWriter(outputFile, None, fields, provider.geometryType(), provider.crs() )
inGeom = inFeat.geometry()
outFeat.setGeometry(inGeom)
outFeat.setAttributeMap(atMap)
writers[clazz].addFeature(outFeat)


for writer in writers.values():
Expand Down