Questions tagged [virtual-layer]

A QGIS vector layer that is a database view built using SQL over other QGIS layers.

Filter by
Sorted by
Tagged with
3
votes
0answers
149 views

Identify Results form for virtual layers in QGIS keeps displaying wrong feature

When I load up a virtual layer and I use the Identify Results tool, it will display the correct information in the Identify Results panel, but in the feature form popup it will always display only the ...
7
votes
2answers
646 views

In QGIS is it possible to apply an expression to a join

I am trying to join by 2 text fields and there is a lot of mismatch due to CaSe and space issues... can it be run so that it's lower("field1")=lower("field2") I otherwise have to create a new field ...
2
votes
0answers
222 views

Using WFS layers in Virtual Layer crashing/too slow QGIS

I am trying to create a virtual layer with the following code, where the layers are provided by a WFS: select geometry from ( select geometry from "Ancient Woodlands (England)" union all select ...
5
votes
1answer
606 views

Can't export geometry generator styling to DXF - alternatives?

I've been using QGIS' wonderful geometry generator to dynamically generate root protection zones and crown areas for some tree inventories I've been working on. It's been a massive time saver. ...
1
vote
0answers
90 views

QGIS virtual layer: Linear referencing result with gaps

I have a layer with some roads, and a table, with information of whether the road is paved or unpaved. The table contains linear referencing measurements from (vanpos) - to (totpos). I'm using a ...
5
votes
0answers
104 views

Selecting minimum number of neighbouring polygons required to give a fixed total area

I have a polygon layer. I would like to select the minimum number of neighbouring polygons to give a total area greater than a fixed value. In reality the polygons are land parcels and I would like to ...
4
votes
1answer
709 views

Creating virtual layers using the processing toolbox

A few days ago Cy T posted an interesting question about creating virtual layers using the Python console: Creating new Virtual Layer programmatically in QGIS? Is it also possible to create virtual ...
1
vote
0answers
57 views

QGIS Virtual Layers based on WFS fail to load on re-opening project

I have created virtual layers that use WFS layers as one of their sources. Usually, it is an intersection between the WFS layer and a local polygon layer. I embed all the sources. However, when I ...
2
votes
1answer
535 views

How to save a virtual layer (from a filtered join) with features from original layer in QGIS?

To be specific, I have a shapefile on census block groups (CBGs) in Georgia, but I only want to use those in Atlanta's commuting zone (CZ). However, commuting zone is not a field in the census ...
10
votes
2answers
2k views

Creating new Virtual Layer programmatically in QGIS?

Is it possible to create a Virtual Layer through a python script. For example, I have a layer "road", and I would like to perform sql " SELECT * FROM road WHERE type = 'Expressway' " Will this be ...
1
vote
1answer
166 views

How to get QgsFeatureRequest in a virtual Layer?

I am wondering if/how PyQGIS can intercept the QgsVirtualLayerProvider::getFeatures() requests of a VirtualLayer, and pull out just the spatial extent from the QgsFeatureRequest to dynamically ...
3
votes
1answer
278 views

How to include layer names when union'ing in virtual layers?

I am creating a virtual layer in QGIS using the following statement: SELECT * FROM ( SELECT * FROM a UNION ALL SELECT * FROM b UNION ALL SELECT * FROM c ) AS merged_tables What is the best way to ...
5
votes
1answer
538 views

What spatial functions are available to shapefiles as “virtual layers” in QGIS DB Manager?

Can anyone provide a list of the spatial functions available in the QGIS DB Manager plugin when using shapefiles as Virtual Layers? I've been trying to use things like ST_DWithin and even ST_Buffer ...
3
votes
1answer
1k views

How to update SQL query for a virtual layer?

I created a virtual layer which contains all the geometries and attributes from a shapefile using the following code: vlayer = QgsVectorLayer( "?layer=ogr:path/to/shapefile", "layerName", "virtual" ) ...
5
votes
1answer
600 views

QGIS “Execute SQL” don't accept more than 1 input table

I have some problems using the "Execute SQL" algorithm (in General Vector Tool) in the Processing Toolbox. No problem when I've got only 1 input table, but when I try to select 2 tables as input data ...
4
votes
2answers
587 views

Getting concatenated attribute values from Spatial Join

How can I query polygon features that intersect other polygon features in QGIS? I have ZIP code areas and city areas, and I would like to list all the ZIP codes that intersect the city areas. Example:...
8
votes
1answer
818 views

How to create dissolved buffers using QGIS virtual layers?

To create dissolved buffers (single geometries) in PostGIS I use ST_Dump and ST_Union: SELECT row_number() over() AS gid, sbqry.* FROM ( SELECT (ST_Dump(ST_Union(ST_Buffer(...
2
votes
1answer
214 views

QGIS virtual layer path never saved as relative

When I try to use virtual layers in QGIS, I'm unable to use relative paths. I've already set in the "Project Properties", in the tab "General", the "Save paths" as relative. You can see a ...
10
votes
2answers
1k views

Polygon intersection using QGIS virtual layers

I'm trying to intersect polygon geometries in QGIS by using a virtual layer: SELECT sbqry.rowid AS gid, sbqry.geom FROM (SELECT ST_Intersection(land_parcels.geometry, flood_zone....
6
votes
3answers
1k views

Is there a way of labeling the number of points with the same coordinates?

After reading through the following question (which is kinda related but not quite what I need): How can I show points on the same coordinate as e.g. a bigger symbol in QGIS? I found out that there ...

1
2