Questions tagged [virtual-field]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
90 views

Calculating age of overlaying points with virtual fields in QGIS: optimize compute-intensive approach

I am working on a project in QGIS, where I have two point layers, named "Infrastructures" and "Inspections". In my system, whenever an infrastructure is inspected, a new point ...
MartinMap's user avatar
  • 8,284
0 votes
0 answers
46 views

QGIS3 copying field values from virtual to static field in Python

I want to store values from a virtual field to a static field (the file will be used externally and I need those calculated values from the virtual field hard coded). My idea was to write a python ...
Kay's user avatar
  • 1,856
1 vote
1 answer
75 views

Virtual layer accessing virtual field

I have a layer my_layer containing a virtual field virtual_1. Next step I want to create a virtual layer, which list only unique values (as a bonus also dissolves the geometries by unique values). The ...
gissurfer's user avatar
2 votes
1 answer
70 views

QGIS - Let atlas iterate through distinct values of virtual field

I have a CSV-Layer with multiple columns (e.g. ID, owner_name) and well-known text data to contain information about polygons. One ID can be owned by to owners which would cause the feature to appear ...
gissurfer's user avatar
3 votes
1 answer
171 views

Summing line lengths inside each polygon in QGIS

In QGIS 3.26 I have polygon layers (districts) and line layers (roads) in my project. I need to sum the line lengths inside the polygons and write them in an attribute table of this polygon. The goal ...
MarinT's user avatar
  • 75
1 vote
1 answer
111 views

Convert virtual field to "physical" field?

I created a virtual field "attr" for a vector layer in QGIS using a expression for the values. These values will be updated as data changes. How can I convert/materialize this virtual field ...
bugmenot123's user avatar
  • 11.3k
0 votes
1 answer
361 views

Create field with sequential automatic alphanumeric name in QField

I've created a series of layers in QGIS to collect data in field with mobile app QField. Each layer have a rule to make its names. For example, one layer is modeled to collect corn fields. It has ...
Marcelo Franco Patané Júnior's user avatar
3 votes
1 answer
255 views

Creating Virtual Field from QGIS Python Console

I would like to create a new virtual field with a specific expression (like 2*"ID") on an existing layer. Is it possible to do so from the Python console? I've tried using addExpressionField ...
MiroD's user avatar
  • 67
1 vote
0 answers
135 views

QGIS - Link derived coordinates to an attribute table

How can I link a field of derived coordinates and attributes to an attribute table? It cannot be copied manually, many lines (100,000).
Miloslav Charvát's user avatar
2 votes
0 answers
68 views

How to speed up the rendering speed of layers with multiple virtual fields?

I am inputting data for power lines and tried using the normal field and imported it in PostGIS. But the some of the data inputs I needed must be refreshed constantly to obtain. So instead I used ...
jerjc0's user avatar
  • 85
6 votes
2 answers
256 views

Getting attribute information of multiple polygon intersected by line using QGIS

I have a map with 'Layer A' (polygons representing cities) and 'Layer B' (lines representing roads). I would like to add a virtual field on my 'Layer B' table with the name of every city crossed by ...
Arthur's user avatar
  • 883
8 votes
1 answer
242 views

Getting index of virtual field using PyQGIS

Im using QGIS 3.18.2 and I want to get the expression string of a virtual field in PyQGIS. QgsVectorLayer.expressionField() is supposed to return the expression string. It takes the index (index: int) ...
malbles's user avatar
  • 288
1 vote
1 answer
104 views

Why are the labels not displaying the correct (virtual) attribute values?

I have a polygon and I create a new field area_ha using this expression in the field calculator: round( $area /10000,1) When I use that field for my labels, everything is fine and works as it should ...
Enzo Baldini's user avatar
  • 2,297
1 vote
0 answers
100 views

Aggregating Virtual Fields in the QGIS Layout

I have an atlas creating maps of parks. These parks contain different areas with different types of surfaces, which need to be managed differently. In my map-layout I'd like to summarise the area of ...
Zev_Zide's user avatar
  • 187
2 votes
1 answer
369 views

Using Virtual Fields in Views in QGIS

I'm trying to summarize some information in a map layout in QGIS controlled by an atlas. I have parks, and connected to that I have objects within these park (points, lines and polygons). I want a ...
Zev_Zide's user avatar
  • 187
3 votes
2 answers
257 views

Counting items in another table in QGIS

I have two tables, the table 'fruit' contains a list of fruits (see figure 01). The 'municipality' table shows in the column "execucao01" which fruits exist in each municipality (see figure ...
Denilson's user avatar
  • 695
1 vote
2 answers
189 views

Follow-up query on "QGIS expression for label text to display vertex coordinates of polygons"

Just a follow-up query about the existing thread QGIS expression for label text to display vertex coordinates of polygons. Is there an expression in QGIS to collect all the coordinates from the ...
ROEL SANTIAGO's user avatar
3 votes
2 answers
164 views

Adding incremental id value to features with certain attribute value

I am using QGIS 3.12. I have a layer of trees and a virtual field 'tree number' that counts all trees that I add to the layer ($id). I want to set that if a height of a tree is more than 3 (in field '...
YuvalM's user avatar
  • 401
2 votes
2 answers
221 views

How to add virtual (e.g. $area) fields to multiple layers

I wondered if I could add virtual fields to the feature tables of a number of polygon layers in a QGIS 3 project (or a geopackage). As an example, I would like to add the virtual field area (km²) as ...
aae's user avatar
  • 377
6 votes
3 answers
500 views

Update virtual field on demand (not permanently) (QGIS)

I quite often use virtual fields. Some of them are relatively complex aggregates. Since virtual fields updates on every input, by moving the map, open the attribute table and so on, it can cost a lot ...
MartinMap's user avatar
  • 8,284
1 vote
0 answers
97 views

Organizing columms in QGIS 3.14

I am using QGIS 3.14. I want to organize my columns in the attribute table but I cant change the virtual fields columns place. It is always last. Can I put it between two non-virtual fields columns?
YuvalM's user avatar
  • 401
0 votes
0 answers
420 views

Fid on QGIS 3.12

I am using QGIS 3.12. I created a new geopackage and in the fid field I want to see the feature number, according to the number of features I have created but it only say "autogenerate". What can I do?...
YuvalM's user avatar
  • 401
1 vote
1 answer
716 views

Access Google Cloud Data using VSIGS

I want to access landsat data from gcp-public-data-landsat bucket using vsigs . My code looks like , import os, sys from osgeo import gdal print(gdal.VersionInfo('–version')) print(sys.version) ...
Souvik Sankar Mitra's user avatar
5 votes
1 answer
1k views

Forcing virtual field recalc in attribute table in QGIS

I have a layer with a virtual field, "LongLabel", an expression concatenating several of its data fields. When I edit a feature's data fields in the layer's attribute table/form, how can I force the ...
Houska's user avatar
  • 7,948
1 vote
2 answers
155 views

Importing Virtual field in a geopackage

I have defined a virtual field to generate additional information in dependence of another attribute. Now I want to import the shape in a geopackage. I want to have the virtual field in the geopackage ...
Dieter Riedel's user avatar
6 votes
4 answers
2k views

Placing data-defined labels both by expression and manually

In my project layers (QGIS 3.6.2) I use data-defined label placement. I am trying to set up the placement as follows: By default, the placement chosen in Label Settings is used (in my case, "around ...
Nathan's user avatar
  • 1,284
1 vote
0 answers
149 views

QGIS automation field from Excel

I present the following situation. 1 - Draw polygon shape in QGIS 3.4 / geopackage, only with two columns ID and NUM_SETOR, using the google maps image as reference. 2 - Excel table where I combine ...
Denilson's user avatar
  • 695
2 votes
0 answers
308 views

Changing Virtual field properties in QGis 3.0

I have some existing virtual field with set Length and Precision An example: The formula was first set to rounding it by 2 digits With the current settings it displays 10.00 instead of 10 because of ...
Rubedo's user avatar
  • 329
2 votes
1 answer
479 views

Deleting virtual field in QGIS?

I'm trying to delete a virtual field from a layer attribute table. The layer source is a Spatialite database so I know that it's not straightforward to remove permanent fields, but as I understand it ...
Libarch's user avatar
  • 83
4 votes
1 answer
1k views

QGIS 2.16 Creating virtual field with aggregate expressions

With QGIS >=2.16, it is possible to use aggregates in expressions, such as sum, average... etc. But when I use it to create a new virtual field using the field calculator, the newly created field ...
tumasgiu's user avatar
  • 361
4 votes
1 answer
372 views

Using virtual fields as join fields in QGIS fails (NULL values in joined fields)

I have a point shapefile and a CSV file containing various attributes and three columns (here: street,num,addnum) based on which I would like to join both tables like attribute1;...;attributen;street;...
Jochen Schwarze's user avatar
1 vote
1 answer
419 views

Is there a way to copy virtual fields from one project to another?

I have a project with several layers, each of which has several quite complex virtual fields in order to analyse a particular site. I'd like to perform a similar analysis of a new site in a new ...
user avatar
3 votes
3 answers
670 views

QGIS add virtual field to csv layer

In QGIS 2.14.3 added a csv file as a layer. Attempt to add a virtual field like shown in the screenshot below (same result with "field_14" || ' ' || "field_10" || "field_11"): The field is created ...
Jochen Schwarze's user avatar
1 vote
2 answers
1k views

Deleting virtual fields in QGIS

I can't find the option to delete a Virtual field on a layer, not even in the Table Manager plugin. Where is that option?
Egidi's user avatar
  • 3,728
7 votes
1 answer
2k views

Creating Virtual Field in QGIS Python Console

Is there any example about how to create a virtual field and subsequently change the attribute of a non-virtual field without wiping out the virtual field? Both are required to be done in the Python ...
Ken T's user avatar
  • 438