Browse Source

use getVectorWriter() instead of QgsVectorFileWriter

make processing choose the used output format automatically
tags/1.4.8
noerw 1 year ago
parent
commit
56dcd7f8ad
1 changed files with 3 additions and 5 deletions
  1. 3
    5
      quick_osm_processing/parser/osm_parser.py

+ 3
- 5
quick_osm_processing/parser/osm_parser.py View File

@@ -26,7 +26,7 @@ from os.path import isfile, join, basename, dirname, abspath
26 26
 
27 27
 from PyQt4.QtCore import QSettings, SLOT
28 28
 from PyQt4.QtGui import QIcon
29
-from qgis.core import QgsVectorLayer, QgsVectorFileWriter
29
+from qgis.core import QgsVectorLayer
30 30
 from processing.core.GeoAlgorithm import GeoAlgorithm
31 31
 
32 32
 from QuickOSM.quick_osm_processing import *
@@ -133,10 +133,8 @@ class OsmParserGeoAlgorithm(GeoAlgorithm):
133 133
         for key, values in layers.iteritems():
134 134
             layer = QgsVectorLayer(values['geojsonFile'], "test", "ogr")
135 135
 
136
-            output_parameter = self.getOutputValue(self.OUTPUT_LAYERS[key])
137
-            layers_outputs[key] = QgsVectorFileWriter(
138
-                output_parameter,
139
-                'UTF-8',
136
+            output_parameter = self.getOutputFromName(self.OUTPUT_LAYERS[key])
137
+            layers_outputs[key] = output_parameter.getVectorWriter(
140 138
                 layer.pendingFields(),
141 139
                 values['geomType'],
142 140
                 layer.crs())

Loading…
Cancel
Save