Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [expression]

Expressions are SQL-like statements that are used to evaluate dynamic properties.

2
votes
4answers
179 views

Count touching and near points for every polygon (QGIS)

I have a polygon and a point layer. The polygons contains buildings, the points should be the edges of the buildings. A building is "good" as much as points are touching or in the near (buffer 0.2 ...
3
votes
1answer
81 views

QGIS: Select point(s) in other layer with similar datetime value from selection

For the interpretation of bird observations, I need to identify the position on a GPS-track (gpx-files), from which the position of a bird observation (other gpx-waypoint layer) was recorded. The ...
0
votes
0answers
32 views

QGIS Value Relation filter

Let's say I have 3 layers: point layer (columns: id, group), table layer named materials (columns: point_id, mat_id), table layer named mat_list (columns group, mat_id). There is relation between ...
3
votes
1answer
44 views

QGIS 2.18 label by expression concatenate field strings

For a building layer I have an attribute table with several fields for the building type where data was entered with a manually created form using checkboxes. Example: Production: 1 = (yes), 0 = (no) ...
3
votes
1answer
61 views

Buffer with unknown distance by adding numerical values of a column until a maximum

In my QGIS project, I have a vector of polygons representing slope zones around an archaeological site and I want to calculate the area which is necessary to supply the ancient population with a ...
1
vote
1answer
49 views

Showing some feature in text label in Print Composer from Print Layout itself in QGIS 3.4.5

I was wondering if there is some expression that I can insert in a text label QGIS print layout that will allow me to print for example coordinates of the map inserted in the print layout itself. ...
1
vote
2answers
36 views

Retrieving specific value from CSV layer to use in QGIS Expressions when conditions match current Atlas feature

I have configured an Atlas which is tied to a "ref_pln" column in a coverage layer. I also have a CSV layer with the columns "ref_pln", "attribute" and "value". I'd like to pull the value of "value" ...
3
votes
1answer
35 views

Getting value set in binding input widget in QGIS expression?

I would like to set dynamic line width and it should be scaled by the value "Stroke width". When I set the value to 0.15, it will be less than 0.15 if $length is too small. I need a function to get ...
1
vote
1answer
46 views

Default expression won't write to database

Made this expression and put it in the defaults value box.: CASE ---cardinal WHEN ("CATCAM" = '1')THEN'2,6' WHEN ("CATCAM" = '2')THEN'2,6,2' WHEN ("CATCAM" = '3')THEN'6,2' WHEN ("CATCAM" = '4')THEN'...
1
vote
0answers
43 views

QGIS 3, Expression to address ranges in the symbology [closed]

I noticed many new entries in the list of expressions in the QGIS3-Version. Is there an expression that I can use to address the symbology of a Layer? It would be of particular interest to get the ...
2
votes
0answers
20 views

Can I symbolize based on the syntax in a description attribute colum?

I got a kmz-file from an organization and the attribute table has a colum 'description' with a synthax that holds import information (such as date built, water source, village etc.) instead of a ...
0
votes
1answer
32 views

Style a feature in one layer based on an attribute in another layer in Print Composer Atlas

I have two layers; one is the foreground and the other a background. Both layers have fields containing similar values (field values in the foreground layer (mun_code) is also present in the ...
1
vote
1answer
52 views

How to use attribute table field name as the Output filename expression in Print composer?

I have several features I want exported as individual images. I am using Print composer and the export process was successful, but the output shows generic filenames like output_1.png: It obviously ...
3
votes
0answers
51 views

Updating shared custom functions / expression code in QGIS

All the QGIS documentation I've seen on custom functions (used in expressions) says that the code is saved in the user's local expressions directory, e.g. ~/.local/share/QGIS/QGIS3/profiles/default/...
1
vote
1answer
38 views

Use expression to only keep 1 layer in the legend

When I print my project, that includes different layers, I always end up with all the layers in the legend. What I want when printing is to only show 1 layer, that always has the same name "Werken". ...
1
vote
0answers
48 views

QGIS Duplicate Labels still appearing despite suggested changes. Do i need to do an expression?

I have one field called Streets. In Streets there are road beds with suffix as Pkwy, Street, Avenue, Expressway and so on. I also want to label some of these road beds. In Layer styling under ...
1
vote
1answer
43 views

Using Click locations to determine azimuth in QGIS 3

I am using QGIS 3 64bit. While adding points to a shapefile (layer), what expression captures the insertion point coordinates of a point feature to use as a start point for an azimuth determination ...
1
vote
1answer
33 views

Need an Expression for rule based styling in Qgis using attribute(get_feautre()) and ILIKE combined

I Have 2 Layers: I want to Filter Layer 2 by an Attribute from Layer1 for some rule based styles. I Currently using following expression to realize that: "C1" = attribute(get_feature(‘Layer 1', '...
1
vote
2answers
49 views

Error when using vector field parameter in field calculator with graphical modeler in QGIS 3

When trying to divide a vector field parameter with an output calculated during the model process I get a No root node, parsing failed! error at the point in which the field calculator in the model ...
2
votes
0answers
45 views

Create multipoint layer from array by expression

I have two layers. One shapefile point layer, called "point1" and one csv no geometry layer, called "Meta". "point1" looks like: id bd 1 a 2 b 3 c 4 d 5 e 6 f and so on... "...
2
votes
0answers
41 views

Calculate length of selected features in PyQGIS

I create a selection with getFeatures(QgsFeatureRequest()) and I want to calculate the length of the result which is a QgsFeatureIterator : select = QgsExpression(" myexpression ") selectedfeats = ...
4
votes
1answer
108 views

Geometry by expression in QGIS Modeller

I want to use 'Geometry by expression' in a model I'm working on but I couldn't figure out how to pass the layer name parameter. Basically I have two polygon layers (A and B) and I want to do a ...
2
votes
0answers
49 views

Sum of values grouped by owner [duplicate]

When I try to use the following expression, the preview shows me the correct sum, but when I click ok I get this notification. This tells me it can't calculate column "Subsidie J" It seems that it ...
1
vote
1answer
35 views

QGIS 2.18: Filter line-layer by QgsExpression

I have a line layer on which I want to run a filter within a python script. I am trying to achieve this via QgsExpression and QgsFeatureRequest. Below you see the same filter that I want to apply in ...
1
vote
1answer
52 views

Search plot by total area of two adjacent plots

I've got some QGIS data where each plot is described with some attributes e.g. Shape_Area which is the field describing the area of plot in m2. Normally I search for plot using the expression e.g. ...
2
votes
1answer
46 views

In QGIS for Type Case in Labels, Rule Based Rule, the Capitalize first letter option does not work

Here are my labels untouched Now when i change to all lowercase You see that it changes However for type case i want to capitalize first letter It shows that it made it everything capitalized ...
3
votes
1answer
76 views

QGIS 2.18: Speed up QgsFeatureRequest in Python Script

I have two input layers. The first one is a line-layer named "graph" and the second one is a point-layer named "nodes". The "graph"-layer: The graph layer holds 177350 line features which are ...
1
vote
1answer
112 views

Labeling expressions on AGOL with Arcade for certain features

I am working on a web map in AGOL for the indoor office map. I have some issues writing custom expressions with Arcade in order to label the types of rooms (office rooms) based on another attribute ...
1
vote
0answers
34 views

Create label from different fields in ArcGIS Desktop?

I want to create label like this one in ArcGIS Desktop 10.3.1. Is there anyway to create label like this? Each data come from different field. I can create a label with box or a number with degree....
4
votes
2answers
149 views

QGIS - How to differently colorize labels from two separate fields using color expression script?

I have 2 fields, I concatenate them [concat(to_string(field1), ' ', to_string(field2))] to show their labels side-by-side. Is it possible to colorize from "text color expression" (using some scripts) ...
1
vote
2answers
93 views

How to add a rownumber in QGIS 3 using Python

I want to add a row number in QGIS 3 using Python. First of all I add a new field with the code below and it works. Then I want to fill the table with the row number. In QGIS Field Calculator ...
1
vote
0answers
28 views

Using formatting option 'aligned' in 'to_dms' function in QGIS 3.4.2

Using formatting option 'aligned' in the expression: to_dms(x(transform($geometry,'EPSG:32632','EPSG:4230')), 'x', 2, 'aligned') not only is the alignment of degrees, minutes, seconds as expected, ...
3
votes
1answer
103 views

How to apply a default datum transformation in an expression in QGIS

I'm using the expression: x(transform($geometry, 'EPSG:32632', 'EPSG:3003')) to add coordinates fields according to different CRS in a point layer. To obtain better accuracy i need to apply a Datum ...
5
votes
1answer
185 views

Using round function in QGIS expression?

I created a grid of rectangular polygons with the Create Grid function, from the Vector Creation group of the Processing Toolbox in QGIS 3.4.2. The rectangles measure half a degree of longitude by ...
1
vote
1answer
80 views

How to use the 'to_dms' function in a CRS conversion expression in QGIS?

I need to create in a point layer attribute table new fields with the points coordinates converted in different geographic CRS through an expression like: x(transform($geometry, 'EPSG:xxxxx', 'EPSG:...
3
votes
1answer
92 views

Styles with parameters

I'm using QGIS 3.4 , and without going into python scripting, is there a way I can create some kind of rule based styles where I can add a parameter? I have a number of layers, each with between 1 ...
4
votes
3answers
138 views

Automating citation of data source in QGIS print composer?

I have 20 thematic maps with different sources like CITY PLANNING OFFICE, ENVIRONMENT OFFICE, AGRICULTURE OFFICE etc. Since I have many maps, I want to automate the data source citation of my ...
0
votes
1answer
169 views

Creating index contours using QGIS?

I'm testing out QGIS for the first time, and I'm trying to find a way to highlight index contours. I'd like to be able to do so via the layer Symbology, or if necessary by separating out the index ...
1
vote
1answer
142 views

Add a character every nth character in QGIS Field Calculator

I can't find an expression to add a character every nth character from the right of a string, in field calculator. As an example, I have a list of UK postcodes which I need to add a space to 3 ...
1
vote
1answer
65 views

Filtering the atlas coverage layer by a different layer in QGIS

I need to create one map atlas for each municipal administration filtering the coverage layer (red rectangles = map sheets) by municipal administrations boundaries layer (green polygons). How is it ...
2
votes
1answer
60 views

Layout Composer Text Box Expression - isolating names from project file path

In QGIS 3.X, I'm attempting to use an expression in layout composer to automatically input the client and project name into a text box. The details are always present in the file path to the project ...
7
votes
3answers
897 views

Difference between quotation marks ('single' vs “double”) in QGIS

I am not a new QGIS user, however, I am still confused concerning the quotation marks syntax ('single' vs "double"). I know something about the quotation marks and the way they are applied in Python ...
2
votes
0answers
62 views

How to add Projection name, Ellipsoid, and Datum in QGIS 3 layouts

I am trying to add the map CRS information to text boxes in a layout in QGIS 3 automatically so if the project crs changes the text in the map will also change. I can add the EPSG code to a text ...
1
vote
1answer
103 views

Rule-based symbols and Expression String Builder

I am working on a data set which is looking at total number of fish landings in accordance with vessel length within the North Sea. After plotting the data I want to be able to categorize total number ...
2
votes
2answers
94 views

Use a field from atlas layer in aggregate function

I cant find a solution to use the value of the current atlas entity in the aggregate function in the filter expression part. Example: aggregate('layer_to_aggregate','count',"...
2
votes
2answers
200 views

How to scale features declining using map units in QGIS

I have layer in QGIS that I want to style using SVG symbols. I want the SVGs to increase in size when zooming in the map. I can solve this by using map units instead of millimeters. Though, I don't ...
0
votes
1answer
90 views

How to create sequential numbers in a field by defining automatically the start, end and interval numbers?

I would like to create sequential numbers in a field called "virtual _Li". I have used the field calculator using def autoincrement() function and manually calculate the interval number. https://...
2
votes
1answer
79 views

Filling a field with automatic numbering specific by unique value of another field with QGIS expression

I have a table with 2 fields: NUMBER (integer) and TOWN (text). I would like to find an expression that fills the NUMBER field with an automatic number specific for each value of TOWN. Example: NUMBER ...
0
votes
1answer
63 views

Setting new value into field created by PyQGIS?

I'd like to create a new field named "vctcn93", loop the features of active layer, if string "metro" in feature name, I'd like to add a value string "get" into the field "vctcn93". But when I check ...
0
votes
2answers
117 views

NULL value not equal to empty value for attribute

I have a feature layer in a gdb. It has an attribute named uniqueid. Some of rows have a value for uniqueid and some do not. I am trying to select only the features that have a value (are not blank). ...