Skip to main content
corrected spelling
Source Link
mgri
  • 16.4k
  • 6
  • 49
  • 80

Your output will have the same crs of your input layer. You will be obviously able to change the crs of the output layer, but only in a further step.

Probably I don't completely understand your question, however I think you essentially want to manage the output of the 'qgis:singlepartstomultipart' algorithm for an intersection. If so, you need to choose a name for the current operation and to set your output to None. Then, you will able to handle your result for the next step:

from qgis.core import * # You can use any name instead of 'result' result = processing.runalg('qgis:singlepartstomultipart', my_PA_vl, "my_field_of_country_ISO3", None) # You can use any name inteadinstead of my_res'my_res' my_res = processing.getObject(result['OUTPUT']) # And then, for example: intersection = processing.runalg("qgis:intersection", my_res, country_polygons ,False,None): # where 'country_polygons' is the name of the layer you wish to intersect with my_res'my_res' 

If you want to add your layer to the Layers panel, you may insert this in your preferred position:

QgsMapLayerRegistry.instance().addMapLayer(my_res) 

I hope this will help you, otherwise I can edit my answer.

Your output will have the same crs of your input layer. You will be obviously able to change the crs of the output layer, but only in a further step.

Probably I don't completely understand your question, however I think you essentially want to manage the output of the 'qgis:singlepartstomultipart' algorithm for an intersection. If so, you need to choose a name for the current operation and to set your output to None. Then, you will able to handle your result for the next step:

from qgis.core import * # You can use any name instead of 'result' result = processing.runalg('qgis:singlepartstomultipart', my_PA_vl, "my_field_of_country_ISO3", None) # You can use any name intead of my_res my_res = processing.getObject(result['OUTPUT']) # And then, for example: intersection = processing.runalg("qgis:intersection", my_res, country_polygons ,False,None): # where 'country_polygons' is the name of the layer you wish to intersect with my_res 

If you want to add your layer to the Layers panel, you may insert this in your preferred position:

QgsMapLayerRegistry.instance().addMapLayer(my_res) 

I hope this will help you, otherwise I can edit my answer.

Your output will have the same crs of your input layer. You will be obviously able to change the crs of the output layer, but only in a further step.

Probably I don't completely understand your question, however I think you essentially want to manage the output of the 'qgis:singlepartstomultipart' algorithm for an intersection. If so, you need to choose a name for the current operation and to set your output to None. Then, you will able to handle your result for the next step:

from qgis.core import * # You can use any name instead of 'result' result = processing.runalg('qgis:singlepartstomultipart', my_PA_vl, "my_field_of_country_ISO3", None) # You can use any name instead of 'my_res' my_res = processing.getObject(result['OUTPUT']) # And then, for example: intersection = processing.runalg("qgis:intersection", my_res, country_polygons ,False,None): # where 'country_polygons' is the name of the layer you wish to intersect with 'my_res' 

If you want to add your layer to the Layers panel, you may insert this in your preferred position:

QgsMapLayerRegistry.instance().addMapLayer(my_res) 

I hope this will help you, otherwise I can edit my answer.

Source Link
mgri
  • 16.4k
  • 6
  • 49
  • 80

Your output will have the same crs of your input layer. You will be obviously able to change the crs of the output layer, but only in a further step.

Probably I don't completely understand your question, however I think you essentially want to manage the output of the 'qgis:singlepartstomultipart' algorithm for an intersection. If so, you need to choose a name for the current operation and to set your output to None. Then, you will able to handle your result for the next step:

from qgis.core import * # You can use any name instead of 'result' result = processing.runalg('qgis:singlepartstomultipart', my_PA_vl, "my_field_of_country_ISO3", None) # You can use any name intead of my_res my_res = processing.getObject(result['OUTPUT']) # And then, for example: intersection = processing.runalg("qgis:intersection", my_res, country_polygons ,False,None): # where 'country_polygons' is the name of the layer you wish to intersect with my_res 

If you want to add your layer to the Layers panel, you may insert this in your preferred position:

QgsMapLayerRegistry.instance().addMapLayer(my_res) 

I hope this will help you, otherwise I can edit my answer.