[QGIS-Developer] How to Add Custom QGIS Model Programmatically

Ismail Sunni imajimatika at gmail.com
Tue May 28 06:57:17 PDT 2019


Dear QGIS developers,

Currently, I am trying to create a Docker image based on QGIS official
docker image to run a custom processing model. I am able to run the
existing processing model by using a python script.

Unfortunately, for a custom model, I need to register the model first
(similar to adding a new model in QGIS toolbox) before I can use it. I try
some ways to do it:

   1. Trying to find Python API to do it. I couldn't find it (perhaps I
   missed it)
   2. Trying to add/copy manually the model file to the model directory.
   Unfortunately, in the container doesn't even have any profile directory.
   3. I tried to find the model directory path, but I can't find it from
   QSettings (it returns empty setting with *QSettings.allKeys()*)
   4. I tried to manually create the directories based on my machine model
   directory location, but it's not working also.

Any suggestions for this problem? A Python API to add/register the model
would be a perfect solution.

Thanks

-- 
Ismail Sunni
ismailsunni.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190528/0c42c04c/attachment.html>


More information about the QGIS-Developer mailing list