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
4
votes
2answers
73 views

Connecting points with line in a specific sequence

I have 6 points in one layer as shown in the first image. I am trying to: connect points with lines in a required sequence. Save data of line connections (From_point and To_point) in the seperate ...
3
votes
0answers
26 views

QGIS 3.10 crashes constantly when performing join with virtual layer

I want to create a pie-chart map showing the amount of groundwater extracted from different aquifers within different administrative areas like in the picture below: I have a shapefile with ...
1
vote
2answers
33 views

Substracting attributes of different layers [closed]

Can I subtract two attributes belonging  to two different layers? In this case these would be two polygons holding DEPTH attribute (Depth1 - Depth2).   Is this possible and if so how?
8
votes
1answer
152 views

Listing all functions available in QGIS's Virtual Layer

How can I get automatically a list of all functions available for usage in QGIS's Virtual Layer? From my own understanding/experience and the QGIS Documentation, QGIS's Virtual Layer employes a ...
9
votes
2answers
205 views

Convert vertices of polygon features to points using Virtual Layer in QGIS

I have a polygon layer and want to use a Virtual Layer that creates points from the vertices of the polygon layer. The question is how to write a query that does this? I am aware of the tool "...
1
vote
2answers
58 views

QGIS: Comparing attribute values from different layers with Expression string builder

I want to compare attribute values from different attributes from multiple layers in the Expression string builder in QGIS (3.16.1) in of these layers, but I don't know how to do that. I've tried out ...
5
votes
1answer
80 views

Temporal nearest neighbour analysis in QGIS

How do I conduct a temporal nearest neighbour analysis in QGIS? Not sure if that's the right terminology, but basically, I have a dataset with ~100,000 house price transactions over a 5 year period. ...
3
votes
0answers
27 views

Adjusting buffer between arrows and both begin and end points separately [duplicate]

I'm currently making a map of the Netherlands in which the flow of student migrations upon or shortly after their graduation is depicted. Here's what I've made so far: I'm getting a bit more pleased ...
2
votes
1answer
17 views

Paste style to virtual layer from another layer

My virtual layer disappears when I paste a style from another layer. I've done this process before and it worked fine, so I'm not sure what the problem is now. Here are my steps: create virtual layer ...
2
votes
0answers
57 views

Manually adding centroids to arrows in Virtual Layers in QGIS

Currently, I'm making a map that depicts the migration flows of people who have finished their university degrees and decide to move to a different Dutch city after their studies. By following Anita ...
0
votes
0answers
32 views

Combine data and geometry from vector layers without merging

I have 3 line type vector layers representing municipal infrastructure; sanitary, storm, and water main pipes. Each of these layers should remain separate and all of these layers have different ...
2
votes
1answer
37 views

Creating Virtual Layer with only desired fields

My question is very similar to this one. The difference being I want multiple fields where they wanted only a single field. I'm trying to create a virtual copy of my layer with only the following ...
1
vote
1answer
52 views

Why is a (self) join so slow with Virtual Layer

I use QGIS 3.4 on Windows 10 I have a polygon layer and a point layer. The points have a streetname attribute. I want to check if there are polygons with more then 1 streetname. I took 2 steps, first ...
1
vote
0answers
41 views

Virtual Layer from SQL query is extremely slow

I have two layers, one is a grid of circles and the other is all Census Block Groups (CBG) in the state of Florida. I created a Virtual Layer out of this code SELECT CirclesFlorida.name, group_concat(...
2
votes
1answer
57 views

Left join resulting in weird output in QGIS's Virtual Layer

I want to join two layers, a polygon layer "plan" and a point layer "education point". My goal is to join the data from "education point" layer to the "plan" ...
1
vote
0answers
46 views

Why do I get missing data rows when I run this virtual layer area query?

I have a shapefile of circles called circlesdixie. I have a polygon layer called FCC (the shp download link at https://www.fcc.gov/reports-research/maps/auction-904-updated-jun20-eligible-areas/. I'm ...
3
votes
0answers
34 views

Dropping duplicate strings when using group_concat in Virtual Layer

When using Virtual Layer to group_concat() a string field, the result would contain duplicates string. For example, here's a polygon layer "city_lot" with "land_use" and "...
1
vote
2answers
62 views

Stop Virtual layer from automatically recalculation

QGIS virtual layer has big performance impact. Even when panning or zooming in the canvas, a virtual layer could take seconds to minutes to refresh. From my speculation, the reason might be the query ...
5
votes
1answer
60 views

Merging some polygons when creating Virtual Layer

I have a polygon layer 'lot' containing an attribute "lot_number". Then, I want to create a Virtual Layer that merges some of the lots while keeping others separated, as the diagram shows ...
4
votes
2answers
93 views

Creating Virtual layer that is the centroid of another polygon layer

There's a polygon layer building and I want to create a point layer centroid containing centroids of building layer. I have 2 more requests: to keep all attributes in the building layer in the newly-...
1
vote
0answers
29 views

DB Manager returns NULL for GeoPackage layers

When I try to do some spatial query in the DB Manager (as Virtual Layer Provider) or in the Virtual Layer Window (Layer > Add new Layer > Create Virtual Layer...) it returns a NULL array, as it ...
2
votes
0answers
36 views

Improving display speed of a virtual layer in QGIS

Following on this question. I have a set of reference lines and a non geometrical table of events. This table contains the mileage of the event along the reference lines, amongst other attributes. I ...
3
votes
2answers
149 views

Selecting lines intersecting lines on two points in QGIS 3.14

I have two shapes of lines: one A with exploded red lines, the other B with closed black lines. In a virtual layer I want to select the yellow ones (A) i.e. those having only 2 points in common with B....
0
votes
0answers
24 views

PyQgis: Extracting data using extractbyattribute or executesql: impact on memory usage and gui

I have written a QGIS (3.12) plugin that uses a loop to extract subsets from an input layer and create a series of new layers in memory (it is preparing species distribution maps). If I extract the ...
1
vote
0answers
35 views

Data type gets converted from “qlonglong” to “int” when creating Virtual Layer

I have a source layer with ID column as qlonglong. When I execute a query in DB Manager the types seems correctly preserved. The problem is that if I "Load as New Layer" the resulting ...
0
votes
0answers
48 views

Virtual layer with st_buffer from geopackage layer

I'm trying to make a virtual layer that has a buffer over a layer of lines. If I run the following query on a layer in shapefile it works correctly create view river as select st_buffer(geometry,50) ...
3
votes
1answer
168 views

QGIS: no geometry in virtual layer

In QGIS 3.12.2. I created a virtual layer to use for the sort-order in a print layout as described here: Sort attribute table by hidden column in Print Composer That works, but I have a problem with ...
5
votes
2answers
315 views

How to toggle editing on a virtual layer?

When I'm adding a virtual layer to a project using QGIS 3.12.2, it cannot be toggled to edit mode. That is: the pencil icon is greyed colored. This can be said for layers created either by the Create ...
4
votes
2answers
123 views

Saving Virtual Layer to temporary layer

I like the idea of Virtual Layers, but when they are too big and constructed from complex queries, QGIS takes a lot of time to redraw it (it seems like it recalculates the entire layer at every zoom/...
2
votes
0answers
49 views

Extract Geometry information from NMEA GGA sentence in SQLite database for display in QGIS via a Virtual Layer

I have a SQLite database containing a GGA sentence in one of its fields. I'd like to display this information as a POINT layer. I've looked at OGR Virtual Format solution as suggested here but I ...
0
votes
0answers
26 views

Removing lines that don't follow another

I have two line layers, the blue and the pink. I've already modified the pink one by snapping to the blue (i.e. there are pink lines that match the blue underneath), however now I want to get rid of ...
1
vote
2answers
196 views

Saving Virtual Raster Layer with Project using QGIS

I have a project that uses multiple DEM tiles to create a Virtual Raster Layer. The Virtual Raster is then used to calculate a Slope and an Aspect layer. I've attempted to save the Project, but when ...
2
votes
0answers
49 views

Grouping points by attributes from field with possibly many values

I have a shapefile "cities" with one unique city_id for each city (geometry polygon, although not relevant here) : city_name ; city_id New-York ; 0001 Paris ; 0002 London ; 0003 And a ...
2
votes
0answers
46 views

QGIS 3: QgsAuxiliaryLayer with virtual layers

I'm using QGIS 3.10.1. I've created virtual layers from an ODBC data source and using the (relatively) new feature "label editing". I was able to show/hide/move labels of a layer. But just after ...
2
votes
1answer
101 views

ST_Distance in Virtual Layer query not working on QGIS on Mac but on Windows

I tried to use solution posted here, but ST_Distance in the Virtual Layer query doesn't work properly in Qgis (v3.2) on Mac, the result is showing blank while the same script is working properly in ...
5
votes
1answer
479 views

QGIS and 1-to-many relationship

I am using QGIS 3.10.0 I am attempting to join a spatial vector layer to a non-spatial layer (CSV). Each polygon on the spatial layer has a unique id attribute. The CSV also has this id attribute ...
2
votes
1answer
46 views

Writing txt file from Virtual Layer

I have a Virtual Table which is a result set for a particular process. select "RECORD_IDENTIFIER", CAST ("UPRN" AS textstring) AS UPRN, "KEY", "WARNING_CODE", "EXCEPTION" from Exceptions ...
3
votes
1answer
91 views

Virtual Layer Symbology in Legend

I am new to QGIS and I'm using QGIS 3.8 on a Windows machine. I'm creating a commuter flow map using a virtual layer similar to the one Anita Graser has created here. When I try to add in a legend all ...
1
vote
1answer
188 views

Extract part of multipolygon that does not intersect with another geometry in Spatialite / QGIS DB manager

I have a point layer (with a buffer value), and a polygon layer (footprint) that intersects the point buffer. Using only SQL in QGIS Virtual Layers (i.e. based on Spatialite), how can I get the ...
10
votes
2answers
328 views

Using RECURSIVE in Virtual Layer

Preface For a while, I was wondering about applying the looping/iterable functions in QGIS's Virtual Layer. There were several cases when the application of a loop would be beneficial and ...
0
votes
0answers
28 views

Using Virtual Raster File Viewer of QGIS?

I have created a virtual file using Build Virtual File functionality of QGIS. Is the file linked strictly to where the raster files are stored or can it be viewed on another computer?
3
votes
2answers
350 views

Creating a virtual layer based on a virtual field for dynamic selection in QGIS 3.4?

Working on a PostGIS database, I would like to send to the print composer the selected features only. I'v tried several methods including working with is_selected() expression but the only way that ...
6
votes
1answer
577 views

Getting the line middle point with SQL in QGIS

Using SQL in a Virtual Layer is it possible to get the midpoint of a line on the line? I have tried Finding middle point (midpoint) of line in QGIS? but got an error I also tried SELECT road, ...
4
votes
1answer
97 views

Using a virtual layer, display polygons based on location of another polygon layer

QGIS 3.4 I have a .gml file of every freehold title in a city outlined red below. I want to create a virtual layer of the freeholds which are contained within the blue-green isochrones. Even if a ...
1
vote
1answer
132 views

Changing SQL syntax in QGIS Virtual Layers

I am experiencing difficulties with SQL syntax in a Virtual Layer. I can do the simplest query form such as: SELECT * FROM mytable and this displays on my canvas. However, if I try to name fields ...
1
vote
2answers
118 views

Wrong result using virtual layer sum with join and group by

I am trying to join the grouped sum of two layers using virutal layers in QGIS 3.2. My query looks like: select nvewi.zone as "Zone-Type", sum(nvewi.bev) as "Inhabitants Isochrones", sum(nvewp.bev) ...
2
votes
1answer
86 views

Merging a legend and a table

I'm using QGIS 3.4 for this, and am creating a map that will see quite a lot of use. It will show plant species, and the area of the plants in question. For this, we have a main "plant" table. This ...
3
votes
2answers
179 views

Selecting lines where start and end points within polygon using Virtual Layer

In QGIS 2.18 project there are several layers, lines and polygons respectively My task is to select all lines when their start and end points are laying within polygons using Virtual Layer, see image ...
1
vote
0answers
96 views

Creating virtual layer or view table from original table using pivot table on QGIS?

I have a table and I need to produce a virtual layer with pivot or crosstable command. Is it possible on QGIS 3.6 or 3.8? My original sql is: select cd_setor, Name, Path_relativo from Fotos order ...
2
votes
1answer
125 views

Merging shapefiles as Virtual Layer in QGIS

In QGIS 3.6.3 I'm trying to create a Virtual Layer obtained by merging 12 shapefiles (with the columns named and ordered in the same way) using the expression SELECT * FROM _January, _February, ...