[QGIS-Developer] How to call a custom algorithm provider in stand alone application with pyqgis

nagyrobi_r at yahoo.com nagyrobi_r at yahoo.com
Mon Nov 2 09:15:04 PST 2020


 Did you set up the environmental variables to run it as a standalone script in python?
Like in section 1.4.3?
https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/intro.html#using-pyqgis-in-standalone-scripts
     On Monday, November 2, 2020, 06:02:11 PM GMT+1, Etienne Trimaille <etienne.trimaille at gmail.com> wrote:  
 
 As you are using QGIS 3.14, I would suggest you to use qgis_process if you can.Do you really want to use PyQGIS?

But if you really need PyQGIS, maybe the path where your script is located is not known to your standalone script ?

Le lun. 2 nov. 2020 à 17:33, PALMIER Patrick (Responsable de groupe) - CEREMA/DTerNP/DATHa/MT <Patrick.Palmier at cerema.fr> a écrit :

  Hello,
 
 I work with Qgis 3.14 in Windows 10
 
 I try to call a processing algorithm from a python stand alone app, 
 I want to run the following script from the custom Networks algorithm provider but I have the message that the algorithm is not known
 
 How to register the provider in the processing registry to be able to call it?
 
 
     QgsApplication.setPrefixPath("C:/Program Files/QGIS 3.14/apps/qgis", True)
     qgs = QgsApplication([], False)
 
     qgs.initQgis()
     import processing
     from processing.core.Processing import Processing
     Processing.initialize()
 
 
 
     processing.run("Networks:musliw_simple_matrix", {'NODES':'G:/BD_DREAL/2020/script_modele_resmultimodal_light   /noeuds_light_hdf_be.gpkg','NUM':'num','START_POINT':'708675.425564,7063676.157556 [EPSG:2154]','END_POINT':'708675.425564,7063676.157556[EPSG:2154]','DEMAND':1,'DAY':1,'TIME':'09:00:00','DEPARTURE':1,'OUTPUT':'G:/BD_DREAL/2020/script_modele_resmultimodal_light/matrice.txt','WRITE_MODE':0})
 
 Thanks
 
 Best regards
 
 
 -- 
 
 
|  
  Patrick Palmier 
  Responsable du groupe Mobilités et Territoires 
 DATHa / MT 
  Tél.: +33(0)3 20 49 60 70- Port : +33(0)7 77 34 25 07   
  |
|   
  Cerema Nord-Picardie / 44 ter rue Jean-Bart - CS20275 - 59019 LILLE cedex 
  
   |

  _______________________________________________
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
_______________________________________________
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  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20201102/0656a27d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bloc
Type: image/png
Size: 22950 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20201102/0656a27d/attachment-0001.png>


More information about the QGIS-Developer mailing list