With the help of Stack Exchange I have been able to set up a PyCharm environment in which I am able to run QGIS geo-processing queries, so away from the Python console in QGIS itself. If I point to the directories in which my shapefiles or geopackages are located I can fairly easily access those and generate outputs to an output directory of my choice.
However, I would like to be able to access geospatial tables directly from a PostgreSQL/PostGIS database and use the QGIS based processing libraries to run analyses involving these datasets. I have been trying to find a way to achieve this using
- the psycopg2 python library ..and/or
- a PostGisDBConnector function that some posts suggest used to work prior to QGIS 3.10 and now seems not to work
In fairness, I am experimenting and haven't found any solution yet. Effectively I want to find a way of essentially pointing to, for example, a line feature layer in the PostgreSQL DB and to a polygon layer such that I get a URI for both that I can then use in the parameters of a processing function such as qgis:intersection.
At the moment I cannot find a method or appropriate syntax to achieve this. Has anyone out there tried to do similar with QGIS 3.14 and Python 3?