I am trying to call the QuickOSM QGIS plugin from a standalone Python application and I´m not quite sure how to or if this is even possible.
My QGIS version is 3.10 (using OSGeo4W64) with the QuickOSM plugin installed. Running on Windows.
I tried to achieve this by using QGIS Processing, but I failed.
import sys
import os
import qgis
from qgis.gui import *
from qgis.core import *
from PyQt5.QtCore import *
QgsApplication.setPrefixPath("C:\\OSGeo4W64\\apps\\qgis\\", True)
qgs = QgsApplication([], False)
qgs.initQgis()
qg_project = QgsProject.instance()
from qgis.analysis import QgsNativeAlgorithms
import processing
from processing.core.Processing import Processing
Processing.initialize()
qgs.processingRegistry().addProvider(QgsNativeAlgorithms())
# The extent is calculated somewhere else
alg_params = {'EXTENT': my_extent,
'KEY': '',
'SERVER': 'http://www.overpass-api.de/api/interpreter',
'TIMEOUT': 25,
'VALUE': ''
}
feedback = QgsProcessingFeedback()
outputs['BuildQueryInsideAnExtent'] = processing.run('quickosm:buildqueryextent', alg_params, feedback)
qgs.exitQgis()
This fails, stating algorithm quickosm:buildqueryextent not found
.
When I try to call QGIS native, GDAL or GRASS algorithms, processing works.
I haven't found a solution to this. Maybe I can tell the script somehow where to find the plugin scripts? Is such a call even possible? Or do I have to do it another way all together?