Questions tagged [virtual-layer]
A QGIS vector layer that is a database view built using SQL over other QGIS layers.
105
questions
4
votes
1answer
93 views
Creating ids of middle point of line
I have line layer as shown in image 1. I created middle point of line by using the below query in virtual layer.
SELECT ST_StartPoint(ST_Line_Substring(geometry,0.5,1))
FROM "TR_ROAD copy"
...
5
votes
3answers
69 views
Generating start and end points for individual road segments
I have shape file with road network (line layer) as shown in Image 1. The road network contains multiple line segments as shown with blue line in image.
I am trying to generate start and end point of ...
4
votes
1answer
86 views
Connect points with line using virtual layer
I have 10 points in QGIS layer as shown in Image 1.
I am trying to connect points with lines in required sequence as shown in Image 2. However, when I tried to connect all points with virtual layer, ...
0
votes
0answers
20 views
Wrong vector selected mouse-clicking on computed layer
[qGIS 3.10.14]
Only on computed layer such as virtual or spatialite view:
When simply clicking in canvas (or using any other gui/spatial selection method) to select particular feature(s), what gets ...
2
votes
0answers
16 views
Splitting multigeometries in a Virtual Layer (SQL query)
I have a virtual layer already set up and working, the only thing that could make it better is getting rid of multipart geometries. The query is:
SELECT ejido, circ, radio, mzna, cc, ten, registrado, ...
1
vote
0answers
21 views
QGIS Virtual Layers from DB query load as 'missing' when opening project file
I'm using QGIS 3.16 and I have a layer from a database query that loads as a table, 'Data_vFoodLocations'. I then created a bunch of Virtual Layers with queries like the one below:
select FieldX, ...
3
votes
1answer
48 views
QGIS: virtual layer with spatial query crashes
Working with QGIS 3.10. Details:
This should be really simple, but I am unable to solve it:
I've got a point layer with two numeric fields "max" and "min", and a polygon layer. I ...
4
votes
2answers
100 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
34 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
35 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?
9
votes
1answer
178 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
250 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
71 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
98 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
18 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
59 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
33 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
41 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
70 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
44 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
61 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
66 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
66 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
124 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
40 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
156 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
25 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 ...
4
votes
3answers
507 views
Variable width buffer in QGIS
Is there any built-in tool in QGIS that I can use to buffer points to a variable size (I want to circles around the points, with widths dependent on an attribute in the point layer)?
The Vector/...
1
vote
0answers
47 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
51 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
210 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 ...
6
votes
2answers
335 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
143 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
54 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
226 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
49 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
106 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
615 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
47 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
94 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
218 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
339 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
29 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
3answers
403 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 ...