handle QGIS Temporary Scratch Vector Layer inside processing algorithms
No description provided.
Comments (12)
-
-
reporter @Benjamin Jakimow this is with regard to Temporary Scratch Vector Layers.
As I’m aware, there is no temporary raster layer type in QGIS, right?
-
But there might be 3 different types of in-memory vector layers: QgsVectorLayer “memory”, ogr “Memory” and ogr “/vsimem/”
-
reporter @Benjamin Jakimow the main problem is, that I in general do all the processing in GDAL/OGR and I’m not using the QGIS API.
Regarding the 3 types you mentioned:
-
is QgsVectorLayer “memory” what you get, when you create a Temporary Scratch Layer in QGIS? If not, how would a user create such a “memory” layer in the QGIS GUI?
-
I guess you can not open OGR “Memory” DataSources in QGIS!? What would be the URI that you have to pass to the QgsVectorLayer constructor?
- OGR “/vsimem/” is no problem, because “/vsimem/…” is a valid URI for QgsVectorLayer and for ogr.Open
-
-
reporter - changed status to wontfix
GDAL/OGR can’t handle Temporary Scratch Layers as well. So in each case we fall back to GDAL, we won’t support temp layer. In other cases were we use QGIS API only, we do support temp layer.
-
- changed status to open
Not being able to handle QGIS memory layers would be a too serious constraint for the EnMAP-Box, in particular because the new Speclibs are based on. There needs to be support using it, e.g. by creating an /vsimem/ copy or similar.
-
reporter I could handle this at algorithm level in a single spot here:
EnMAPProcessingAlgorithm.parameterAsVectorLayer
Every time the requested vector layer is a Temporary Scratch Layers, I could save it on-the-fly as a QGR layer.
Location could be: ‘/vsimem/<layer.source()>.gpkg’
-
reporter - changed version to 3.9
- marked as enhancement
-
reporter -
Sounds good! This way it should be possible to handle the other QgsVectorDataProviders as well (spatialite, wfs, prostgress, ….).
https://qgis.org/api/classQgsVectorLayer.html#detailsMeanwhile I prefer using the QgsVectorLayer API instead of OGR.
-
reporter - changed status to resolved
resolves
#457→ <<cset bec42b54acc6>>
-
reporter Sounds good! This way it should be possible to handle the other QgsVectorDataProviders as well (spatialite, wfs, prostgress, ….).
Benjamin, please test with your usecases (spatialite, wfs, prostgress, …) and come back to me, if something is not handled correctly
- Log in to comment
Which types of QGIS Templayer does this mean?