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 ...
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
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 ...
9
votes
2answers
203 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
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?
5
votes
2answers
341 views

Calculating point layer values within polygon features in QGIS 2

There are two layers polygon 'BereichBerechnung' with a field "Are_Number" points 'EW2017' with a field "EWjeAdr" In QGIS with a Virtual Layer, I want to calculate the sum of the ...
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 ...
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 ...
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
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 ...
5
votes
1answer
789 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. ...
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 ...
14
votes
2answers
3k views

Creating 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 the SQL query SELECT * FROM road WHERE type = 'Expressway' ...
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 ...
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 ...
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 "...
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-...
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 ...
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 ...
6
votes
1answer
576 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, ...
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
314 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 ...
1
vote
2answers
186 views

Is it possible to add an atlas variable to the SQL query when creating a virtual layer?

I'm trying to do something like this: select * from table_a inner join table_b on table_b.fid = table_a.id and table_b.code = @atlas_featureid I have tried this using QGIS 2.18.16 and QGIS 3.0 ...
4
votes
2answers
122 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 ...
5
votes
2answers
746 views

Keeping virtual layer up to date

I have a virtual layer in QGIS 2 with a query on a CSV. The CSV gets updated regulary. I need the max/min attributes in the virtual layer to be updated as well. The virtual layer is used as a title in ...
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 ...
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 ...
5
votes
1answer
478 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
187 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 ...
3
votes
1answer
127 views

Add virtual layer to aggregate feature

newbie here of QGIS here, I was trying to aggregate a feature from a CSV with no geometries. The query is very basic: SELECT "PROV", SUM("POP_2012") AS POP_2012 FROM "municipalities-tuscany" ...
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 ...