1

In QGIS desktop I can merge a template spatial file that has no data but all the attributes I need with another spatial file that has the spatial data where some of the attributes aren't in the correct order and some aren't needed.

So for ex.enter image description here

Processing algorithm…
Algorithm 'Merge vector layers' starting…
Input parameters:
{ 'CRS' : QgsCoordinateReferenceSystem('EPSG:28355'), 'LAYERS' : ['//xxx/Property_Template.tab','xxx/xxx_i_bpoly.tab'], 'OUTPUT' : 'TEMPORARY_OUTPUT' }

Using specified destination CRS EPSG:28355
Setting output type to NoGeometry
Setting output type to Polygon
Packaging layer 1/2: Property_Template
Packaging layer 2/2: xxxx_bpoly
Execution completed in 2.04 seconds
Results:
{'OUTPUT': 'Merged_077b3dcf_1fbf_4164_96cf_978eb72c68d8'}

BUT when I do the same thing in modeler I get the following result and error

Prepare algorithm: native:mergevectorlayers_1
Running Merge vector layers [1/1]
Input Parameters:
{ CRS: None, LAYERS: ['xxx/x_i_bpoly.tab','//xxx/Property_Template.tab'], OUTPUT: 'memory:Merged' }
Taking destination CRS EPSG:28355 from layer
Setting output type to Polygon
All layers must have same geometry type! Encountered a No geometry layer when expecting a Polygon layer.
Error encountered while running Merge vector layers
Error encountered while running Merge vector layers
Execution failed after 0.15 seconds

You can see that the tool has the smarts to set an appropriate output type but the tool in the model doesn't seem to be able to able to do this - can I change this?

 Setting output type to NoGeometry
    Setting output type to Polygon

The processing run code looks like this and works...

processing.run("native:mergevectorlayers", {'LAYERS':['//xxx/Property_Template.tab','xxx/xx_bpoly.tab'],'CRS':QgsCoordinateReferenceSystem('EPSG:28355'),'OUTPUT':'//Working/Property_Working.tab'})

I also tried this in SAGA Merge Vector Layers and get the same basic issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.