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! Bye Stefano ----- Messaggio originale ----- Da: "Ben Hur Pintor" <[email protected]> A: "Nyall Dawson" <[email protected]> Cc: "Stefano Masera" <[email protected]>, "qgis-developer" <[email protected]> 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? Regards, Ben Hur On Tue, Jun 13, 2017 at 5:33 AM, Nyall Dawson < [email protected] > wrote: On 13 June 2017 at 01:01, Stefano Masera < [email protected] > 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? Nyall _______________________________________________ QGIS-Developer mailing list [email protected] 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
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
