[QGIS-Developer] multipartToSingleParts via code

Stefano Masera stefano.masera at arpa.piemonte.it
Wed Jun 14 02:13:04 PDT 2017

Hi Ben and Nyall, 
thanks for your answers. 
I resolve the question with the Nyall's processing link and using a part of the code in that link. 
It's a little bit difficult for me explain better what's happened because my plugin it's articulated (for my experience), and the multiparttosinglepart is a little part of the code. 
You can see the actual version installing it from the official repository, the name is "opeNoise", but in the actual there isn't this problem because I didn't need to use multiparttosinglepart. 
Now I'm workinkg to a develop of the plugin. 
In any case now it's all ok, even if I didn't use processing algorithm in the code. 

Thank you very much! 


----- Messaggio originale -----

Da: "Ben Hur Pintor" <bnhr.dev at gmail.com> 
A: "Nyall Dawson" <nyall.dawson at gmail.com> 
Cc: "Stefano Masera" <stefano.masera at arpa.piemonte.it>, "qgis-developer" <qgis-developer at lists.osgeo.org> 
Inviato: Martedì, 13 giugno 2017 5:24:38 
Oggetto: Re: [QGIS-Developer] multipartToSingleParts via code 

Hi Stefano. 

Correct me if I'm wrong but my understanding is that you want to be able to call "multiparttosingleparts" in his code the same way you call dissolve. 

Something like: 

from qgis.xxx import * 
xxx = YYY 
xxx.multiparttosingleparts(input, output) 

Have you tried looking at the API? 

I haven't used the qgis processing algorithims in my Python code that way since they already work fine the way they do now. May I know why you'd like such a use case? 


Ben Hur 

On Tue, Jun 13, 2017 at 5:33 AM, Nyall Dawson < nyall.dawson at gmail.com > wrote: 

On 13 June 2017 at 01:01, Stefano Masera 
< stefano.masera at arpa.piemonte.it > wrote: 
> Hi list, 
> I want to use the 'multiPartToSinglePart' script via code for my plugin. 
> I can use it importing processing like this: 
> import processing 
> processing.runalg("qgis:multiparttosingleparts", input, output) 
> but I wan't to use it in a different way, like I already do with the 
> 'dissolve' script: 
> from qgis.analysis import * 
> analyzer = QgsGeometryAnalyzer() 
> analyzer.dissolve(input, output) 
> (even if I could write: 
> import processing 
> processing.runalg("qgis:dissolve",input,output) 
> ) 
> Is it possible? 

Sorry, I don't understand exactly what it is you're wanting to do. Can 
you clarify? 

QGIS-Developer mailing list 
QGIS-Developer at lists.osgeo.org 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer 
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer 


Engr. Ben Hur S. Pintor 
Research Associate 
Phil-LiDAR 2 Project 5: REMap 
UP Training Center for Applied Geodesy and Photogrammetry 

Juris Doctor 
College of Law 
University of the Philippines Diliman 
Quezon City 1101, PHL 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170614/2e1973ec/attachment-0001.html>

More information about the QGIS-Developer mailing list