Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[sextnate] minor algorithm improvements and renaming
  • Loading branch information
volaya committed Jul 18, 2013
1 parent 87e3387 commit 765ac75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions python/plugins/sextante/algs/PointsLayerFromTable.py
Expand Up @@ -18,6 +18,7 @@
"""
from sextante.parameters.ParameterTable import ParameterTable
from sextante.parameters.ParameterTableField import ParameterTableField
from sextante.parameters.ParameterCrs import ParameterCrs

__author__ = 'Victor Olaya'
__date__ = 'August 2013'
Expand All @@ -38,6 +39,7 @@ class PointsLayerFromTable(GeoAlgorithm):
XFIELD = "XFIELD"
YFIELD = "YFIELD"
OUTPUT = "OUTPUT"
TARGET_CRS = "TARGET_CRS"

def processAlgorithm(self, progress):
source = self.getParameterValue(self.INPUT)
Expand All @@ -48,6 +50,10 @@ def processAlgorithm(self, progress):
writer = output.getVectorWriter(fields, QGis.WKBPoint, self.crs)
xfieldindex = vlayer.fieldNameIndex(self.getParameterValue(self.XFIELD))
yfieldindex = vlayer.fieldNameIndex(self.getParameterValue(self.YFIELD))

crsId = self.getParameterValue(self.TARGET_CRS)
targetCrs = QgsCoordinateReferenceSystem(crsId)
self.crs = targetCrs

outFeat = QgsFeature()
nElement = 0
Expand Down Expand Up @@ -76,5 +82,6 @@ def defineCharacteristics(self):
self.addParameter(ParameterTable(self.INPUT, "Input layer"))
self.addParameter(ParameterTableField(self.XFIELD, "X field", self.INPUT, ParameterTableField.DATA_TYPE_ANY))
self.addParameter(ParameterTableField(self.YFIELD, "Y field", self.INPUT, ParameterTableField.DATA_TYPE_ANY))
self.addParameter(ParameterCrs(self.TARGET_CRS, "Target CRS", "EPSG:4326"))
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))

2 changes: 1 addition & 1 deletion python/plugins/sextante/gui/help/algclasssification.txt
Expand Up @@ -127,6 +127,7 @@ qgis:nearestneighbouranalysis,USE_ORIGINAL_NAME,Vector/Points
qgis:pointslayerfromtable,USE_ORIGINAL_NAME,Vector/Creation
qgis:polygonfromlayerextent,USE_ORIGINAL_NAME,Vector/Creation
qgis:polygonstolines,USE_ORIGINAL_NAME,Vector/Polygons
qgis:polygoncentroids,USE_ORIGINAL_NAME,Vector/Polygons
qgis:randomselection,USE_ORIGINAL_NAME,Vector/Selection
qgis:randomselectionwithinsubsets,USE_ORIGINAL_NAME,Vector/Selection
qgis:rasterlayerhistogram,USE_ORIGINAL_NAME,Raster/Statistics
Expand Down Expand Up @@ -306,7 +307,6 @@ saga:pointstatisticsforpolygons,USE_ORIGINAL_NAME,Raster - vector/Raster - vecto
saga:pointsthinning,USE_ORIGINAL_NAME,Vector/Points
saga:polartocartesiancoordinates,USE_ORIGINAL_NAME,Domain specific/Cost analysis
saga:polygon-lineintersection,USE_ORIGINAL_NAME,Vector/Geometry operations
saga:polygoncentroids,USE_ORIGINAL_NAME,Vector/Polygons
saga:polygondissolve,USE_ORIGINAL_NAME,Vector/Polygons
saga:polygondissolvebyattribute,Polygon dissolve (by attribute),Vector/Polygons
saga:polygondissolveallpolygons,Polygon dissolve (all polygons),Vector/Polygons
Expand Down

0 comments on commit 765ac75

Please sign in to comment.