Hello !
I don't know if I came to the right place but I thought that maybe I can get an answer here...
I'm currently developing a QGIS plugin where I mapped a PostGIS database via GeoAlchemy2.
I wrote a function that returns results from a GeoAlchemy query but have no idea how to create a vector layer from this (by using, for example, a function from QGIS API, like QgsVectorLayer(...)) and display it.
Is there any way to do this ?
Thanks a lot,
Marc
uri = QgsDataSourceURI()
uri.setConnection("localhost", "5432", "geo", "geo", "")
uri.setDataSource("public", "table", "shape_utm", "filter=12")
blocks_layer = QgsVectorLayer(uri.uri(False), "table", "postgres")