3

I have been trying to use a single table of a Spatialite db in a standalone Python application. I have run it through the QGIS interface to find how it used the input pathway, which was: 'dbname=\'C:/path/to/inputs.sqlite\' table=\"inputs_table\" (geom) sql=' (full code below). However, using this command as part of the code produces an error saying that it cannot be found. I've had a look, but I cannot find any links that state how to use a spatialite table in this way. The table is definitely in the database.

The error is:

_core.QgsProcessingException: Unable to execute algorithm
Could not load source layer for INPUT: dbname='C:/path/to/inputs.sqlite' table="input_table" (geom) sql= not found

Full code used:

processing.run("qgis:heatmapkerneldensityestimation",
        { 'DECAY' : 0, 'INPUT' : 'dbname=\'C:/path/to/inputs.sqlite\' table=\"inputs_table\" (geom) sql=',
                        'KERNEL' : 0,
                        'OUTPUT' : 'C:/output.tif', 'OUTPUT_VALUE' : 0, 'PIXEL_SIZE' : 50, 'RADIUS' : 100,
                        'RADIUS_FIELD' : None, 'WEIGHT_FIELD' : None })
  • perhaps - it could help to show the actual error you get? – JimT Jun 13 '19 at 12:25
  • @JimT I have added the error now – Perfalcon Jun 17 '19 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.