qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.29k stars 2.96k forks source link

Ability to filter input layers by provider #19870

Open qgib opened 9 years ago

qgib commented 9 years ago

Author Name: Alexander Bruy (@alexbruy) Original Redmine Issue: 11616

Redmine category:processing/core Assignee: Victor Olaya


It would be nice to be able to filter input layers not only by geometry, but also by provider type. This will be useful for algorithms that works only with specific provider (e.g. PostGIS, pgRouting etc).


qgib commented 9 years ago

Author Name: Giovanni Manghi (@gioman)


This, together with other (small?) improvements would allow to do very neat things.

Take the (working) example I attached to this ticket:

it is a gdal/ogr tool, that using ogr2ogr runs a spatial query inside a PostGIS database (local or remote), using as input two PostGIS layers and where the output is added directly to the very same DB where the inputs come from.

this opens a very interesting opportunity: create a bunch of tools for postgis layers, each one doing a certain spatial operation, and have the results directly in PostGIS.

The attached example works, but it would be needed to implement a few things in processing:

Please notice that the very same spatial queries (well most of them) can be run using ogr2ogr and the "-dialect sqlite" option, in order to use "any" (see below) kind of layers as input and process them with the Spatialite functions, and return a shapefile as output.

In fact this really works and I already implemented a few example: buffer, single side buffer, dissolve, and they all outperform native QGIS tools, especially for large input vectors.

But also using this approach the ability to filter layers by provider would make things better this because inside queries the geometry column name of input layers must be added ("geometry" for shapefiles, at least using ogr) and maybe there are formats (gpx, csv, kml) where this is not possible.

Another thing that would be necessary for the Spatialite approach is the ability to create temporary .vrt files where to put the input layers (if more than one), this because ogr2ogr accepts only 1 input layer, but this can be a .vrt file that can contain >1.



qgib commented 8 years ago

Author Name: Giovanni Manghi (@gioman)


see also #22409

qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)