Skip to content

Commit 765ac75

Browse files
committedJul 18, 2013
[sextnate] minor algorithm improvements and renaming
1 parent 87e3387 commit 765ac75

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
 

‎python/plugins/sextante/algs/PointsLayerFromTable.py

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"""
1919
from sextante.parameters.ParameterTable import ParameterTable
2020
from sextante.parameters.ParameterTableField import ParameterTableField
21+
from sextante.parameters.ParameterCrs import ParameterCrs
2122

2223
__author__ = 'Victor Olaya'
2324
__date__ = 'August 2013'
@@ -38,6 +39,7 @@ class PointsLayerFromTable(GeoAlgorithm):
3839
XFIELD = "XFIELD"
3940
YFIELD = "YFIELD"
4041
OUTPUT = "OUTPUT"
42+
TARGET_CRS = "TARGET_CRS"
4143

4244
def processAlgorithm(self, progress):
4345
source = self.getParameterValue(self.INPUT)
@@ -48,6 +50,10 @@ def processAlgorithm(self, progress):
4850
writer = output.getVectorWriter(fields, QGis.WKBPoint, self.crs)
4951
xfieldindex = vlayer.fieldNameIndex(self.getParameterValue(self.XFIELD))
5052
yfieldindex = vlayer.fieldNameIndex(self.getParameterValue(self.YFIELD))
53+
54+
crsId = self.getParameterValue(self.TARGET_CRS)
55+
targetCrs = QgsCoordinateReferenceSystem(crsId)
56+
self.crs = targetCrs
5157

5258
outFeat = QgsFeature()
5359
nElement = 0
@@ -76,5 +82,6 @@ def defineCharacteristics(self):
7682
self.addParameter(ParameterTable(self.INPUT, "Input layer"))
7783
self.addParameter(ParameterTableField(self.XFIELD, "X field", self.INPUT, ParameterTableField.DATA_TYPE_ANY))
7884
self.addParameter(ParameterTableField(self.YFIELD, "Y field", self.INPUT, ParameterTableField.DATA_TYPE_ANY))
85+
self.addParameter(ParameterCrs(self.TARGET_CRS, "Target CRS", "EPSG:4326"))
7986
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))
8087

‎python/plugins/sextante/gui/help/algclasssification.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ qgis:nearestneighbouranalysis,USE_ORIGINAL_NAME,Vector/Points
127127
qgis:pointslayerfromtable,USE_ORIGINAL_NAME,Vector/Creation
128128
qgis:polygonfromlayerextent,USE_ORIGINAL_NAME,Vector/Creation
129129
qgis:polygonstolines,USE_ORIGINAL_NAME,Vector/Polygons
130+
qgis:polygoncentroids,USE_ORIGINAL_NAME,Vector/Polygons
130131
qgis:randomselection,USE_ORIGINAL_NAME,Vector/Selection
131132
qgis:randomselectionwithinsubsets,USE_ORIGINAL_NAME,Vector/Selection
132133
qgis:rasterlayerhistogram,USE_ORIGINAL_NAME,Raster/Statistics
@@ -306,7 +307,6 @@ saga:pointstatisticsforpolygons,USE_ORIGINAL_NAME,Raster - vector/Raster - vecto
306307
saga:pointsthinning,USE_ORIGINAL_NAME,Vector/Points
307308
saga:polartocartesiancoordinates,USE_ORIGINAL_NAME,Domain specific/Cost analysis
308309
saga:polygon-lineintersection,USE_ORIGINAL_NAME,Vector/Geometry operations
309-
saga:polygoncentroids,USE_ORIGINAL_NAME,Vector/Polygons
310310
saga:polygondissolve,USE_ORIGINAL_NAME,Vector/Polygons
311311
saga:polygondissolvebyattribute,Polygon dissolve (by attribute),Vector/Polygons
312312
saga:polygondissolveallpolygons,Polygon dissolve (all polygons),Vector/Polygons

0 commit comments

Comments
 (0)
Please sign in to comment.