Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] add Points from vector algorithm
  • Loading branch information
alexbruy committed Sep 13, 2013
1 parent 91ea88f commit 0bda3b6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions python/plugins/processing/script/scripts/Points_from_vector.py
@@ -0,0 +1,17 @@
##[Example scripts]=group
##Input_raster=raster
##Input_vector=vector
##Output_layer=output vector

from qgis.core import *

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)
elif geometryType == QGis.Polygon:
processing.runalg("qgis:pointsfrompolygons", raster, vector, Output_layer)

0 comments on commit 0bda3b6

Please sign in to comment.