Skip to content
Permalink
Browse files

[processing][saga] Fix error in merge vector layers

Fixes #18545
  • Loading branch information
nyalldawson committed Jun 4, 2018
1 parent 1bc1790 commit b8ff44e63dec569d8f3967095dad6caa1d82a1f3
@@ -28,7 +28,6 @@

import os
import importlib
from copy import deepcopy
from qgis.core import (Qgis,
QgsApplication,
QgsProcessingUtils,
@@ -226,8 +225,8 @@ def processAlgorithm(self, parameters, context, feedback):

self.exportedLayers[param.name()] = files
else:
temp_params = deepcopy(parameters)
for layer in layers:
temp_params = {}
temp_params[param.name()] = layer

if not crs:
@@ -237,7 +236,7 @@ def processAlgorithm(self, parameters, context, feedback):

crs = source.sourceCrs()

layer_path = self.parameterAsCompatibleSourceLayerPath(temp_params, param.name(), context, 'shp',
layer_path = self.parameterAsCompatibleSourceLayerPath(temp_params, param.name(), context, ['shp'], 'shp',
feedback=feedback)
if layer_path:
if param.name() in self.exportedLayers:
Binary file not shown.
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<SAGA_METADATA>
<HISTORY saga-version="2.3.1">
<MODULE library="shapes_tools" id="2" name="Merge Layers">
<OPTION type="boolean" id="SRCINFO" name="Add Source Information">TRUE</OPTION>
<OPTION type="boolean" id="MATCH" name="Match Fields by Name">TRUE</OPTION>
<INPUT_LIST type="shapes_list" id="INPUT" name="Layers">
<INPUT type="shapes_list" id="INPUT" name="Layers">
<FILE>/tmp/processing_b5cdddb281d444b789783dec9f1cb820/cb98869080f34caa92a02f614f97d98b/INPUT.shp</FILE>
</INPUT>
<INPUT type="shapes_list" id="INPUT" name="Layers">
<FILE>/tmp/processing_b5cdddb281d444b789783dec9f1cb820/0b3e8560d4b34ec09028f93b778ed98c/INPUT.shp</FILE>
</INPUT>
</INPUT_LIST>
<OUTPUT type="shapes" id="MERGED" name="Merged Layer">Merged Layers</OUTPUT>
</MODULE>
</HISTORY>
<SOURCE>
<FILE></FILE>
<DATABASE>
<FIELDS>
<FIELD TYPE="STRING">Source</FIELD>
<FIELD TYPE="STRING">fid</FIELD>
<FIELD TYPE="LONGINT">id</FIELD>
<FIELD TYPE="LONGINT">id2</FIELD>
</FIELDS>
</DATABASE>
<PROJECTION>
<OGC_WKT>GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]</OGC_WKT>
<PROJ4>+proj=longlat +a=6378137.000000 +b=6356752.314245 +no_defs</PROJ4>
<EPSG>-1</EPSG>
</PROJECTION>
</SOURCE>
<DESCRIPTION></DESCRIPTION>
</SAGA_METADATA>
@@ -0,0 +1 @@
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
Binary file not shown.
Binary file not shown.
@@ -46,6 +46,23 @@ tests:
name: expected/saga/add_grid_to_points.shp
type: vector

- algorithm: saga:mergevectorlayers
name: Merge vector layers
params:
INPUT:
params:
- name: points.gml
type: vector
- name: points_in_polys.gml
type: vector
type: multi
MATCH: true
SRCINFO: true
results:
MERGED:
name: expected/saga/merge_vector_layers.shp
type: vector

- algorithm: saga:reclassifyvaluessimple
name: Reclassify values (simple)
params:

0 comments on commit b8ff44e

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