Skip to content
Permalink
Browse files

[processing] fixed split vector layer algorithm

  • Loading branch information
volaya committed Dec 22, 2014
1 parent 6c7d61f commit 247c3dd0e777e6f839d5f318378462a0100d36ca
Showing with 4 additions and 8 deletions.
  1. +4 −8 python/plugins/processing/algs/qgis/VectorSplit.py
@@ -25,14 +25,15 @@

__revision__ = '$Format:%H$'

import os
from PyQt4.QtCore import *
from qgis.core import *
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterTableField
from processing.core.outputs import OutputDirectory
from processing.tools import dataobjects, vector

from processing.tools.system import mkdir

class VectorSplit(GeoAlgorithm):

@@ -54,18 +55,13 @@ def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT))
fieldName = self.getParameterValue(self.FIELD)

directory = self.getOutputValue(self.OUTPUT)

if directory.find('\\') != -1:
directory.replace('\\', '/')

if not directory.endswith("/"):
directory += '/'
mkdir(directory)

fieldIndex = layer.fieldNameIndex(fieldName)
uniqueValues = vector.uniqueValues(layer, fieldIndex)
baseName = '{0}{1}_{2}'.format(directory, layer.name(), fieldName)
baseName = os.path.join(directory, '{0}_{1}'.format(layer.name(), fieldName))

fields = layer.pendingFields()
crs = layer.dataProvider().crs()

0 comments on commit 247c3dd

Please sign in to comment.
You can’t perform that action at this time.