Skip to content

Commit

Permalink
[processing] fix wrong tools description (fix #9852)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Mar 24, 2014
1 parent 7c2038d commit 3797ffa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/PointsFromLines.py
Expand Up @@ -43,7 +43,7 @@ class PointsFromLines(GeoAlgorithm):
OUTPUT_LAYER = 'OUTPUT_LAYER'

def defineCharacteristics(self):
self.name = 'Get raster values at line nodes'
self.name = 'Generate points (pixel centroids) along line'
self.group = 'Vector analysis tools'

self.addParameter(ParameterRaster(self.INPUT_RASTER, 'Raster layer'))
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/algs/PointsFromPolygons.py
Expand Up @@ -32,7 +32,7 @@
from processing.parameters.ParameterRaster import ParameterRaster
from processing.parameters.ParameterVector import ParameterVector
from processing.outputs.OutputVector import OutputVector
from processing.tools import dataobjects, vector
from processing.tools import dataobjects, vector, raster
from processing.tools.general import *


Expand All @@ -44,7 +44,7 @@ class PointsFromPolygons(GeoAlgorithm):
OUTPUT_LAYER = 'OUTPUT_LAYER'

def defineCharacteristics(self):
self.name = 'Get raster values at polygon nodes'
self.name = 'Generate points (pixel centroids) inside polygons'
self.group = 'Vector analysis tools'

self.addParameter(ParameterRaster(self.INPUT_RASTER, 'Raster layer'))
Expand Down Expand Up @@ -92,12 +92,12 @@ def processAlgorithm(self, progress):
yMin = bbox.yMinimum()
yMax = bbox.yMaximum()

(startRow, startColumn) = mapToPixel(xMin, yMax, geoTransform)
(endRow, endColumn) = mapToPixel(xMax, yMin, geoTransform)
(startRow, startColumn) = raster.mapToPixel(xMin, yMax, geoTransform)
(endRow, endColumn) = raster.mapToPixel(xMax, yMin, geoTransform)

for row in xrange(startRow, endRow + 1):
for col in xrange(startColumn, endColumn + 1):
(x, y) = pixelToMap(row, col, geoTransform)
(x, y) = raster.pixelToMap(row, col, geoTransform)
point.setX(x)
point.setY(y)

Expand Down
Expand Up @@ -5,13 +5,13 @@

from qgis.core import *

vector = processing.getobject(Input_vector)
raster = processing.getobject(Input_raster)
vector = processing.getObject(Input_vector)
raster = processing.getObject(Input_raster)

geometryType = vector.geometryType()
if geometryType == QGis.Point:
processing.runalg('qgis:saveselectedfeatures', vector, Output_layer)
elif geometryType == QGis.Line:
processing.runalg('qgis:pointsfromlines', raster, vector, Output_layer)
processing.runalg('qgis:generatepointspixelcentroidsalongline', raster, vector, Output_layer)
elif geometryType == QGis.Polygon:
processing.runalg('qgis:pointsfrompolygons', raster, vector, Output_layer)
processing.runalg('qgis:generatepointspixelcentroidsinsidepolygons', raster, vector, Output_layer)

0 comments on commit 3797ffa

Please sign in to comment.