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.

1
vote
0answers
14 views

QGIS: 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
18 views

QGIS 3, Set Labels from expression in “Legend”-Property [on hold]

Since version 3 there is a section called "Legend" in the layer properties. The displayed fields indicate a promising further development. Namely, is it possible to transform legend entries ...
2
votes
0answers
12 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
24 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
31 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
40 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
22 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
39 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
31 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
26 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
31 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
30 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
27 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
74 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
47 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
25 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
49 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
32 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
63 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
67 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
33 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
138 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
61 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
25 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
84 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 ...
3
votes
1answer
105 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
62 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
115 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
116 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
132 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 ...
0
votes
0answers
44 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
48 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
847 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
48 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
78 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
81 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
169 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
69 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
77 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
48 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
79 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). ...
4
votes
2answers
674 views

How to extract a part of string from fields in QGIS field calculator?

I want to create a new field in my attribute table. My goal: returning all digits between the / and _ characters of the field named "location" by applying the next expression: regexp_substr( "Text", ...
0
votes
1answer
86 views

QGIS3 Atlas: expression to pull values from a non-coverage layer at current location?

I have an atlas composition where I would like to, in addition to attributes from my coverage layer which consists of polygons that are scattered throughout the world, place other values from another ...
1
vote
1answer
99 views

Expression to select features by comparing attribute values

I'm working in QGIS and I have a point layer with two fields and I'm trying to compare the accuracy of the distances in feet. One field highlights the old calculated distances and another field ...
1
vote
1answer
57 views

Delete duplicate text in Atribute table, qgis

I'm trying to label correctly a set of points in my map. They refer to localities and water analyses for those places in Spain. But the information in one of the fields is duplicated, it's written two ...
1
vote
1answer
43 views

QGIS Label Rule

I want to create rule based labeling for a layer where I want to label any features that have "private" anywhere in the value under "ROAD_NAME" So if I had Values: Highway 1 Highway 2 Road 1 Road 2 ...
2
votes
1answer
212 views

Using expression to number unique string values consecutively in QGIS?

I have a set of string values in a shapefile's attribute column and want to assign a number to them in a way that each unique string gets an integer number, like this: strings numbers ------- ...
1
vote
0answers
21 views

setFilterExpression not giving results because of space?

I am trying to select data based on QgsVectorLayer() getting it's features from layer.getFeatures().next() method. When I pass expression in that using QgsFeatureRequest().setFilterExpression(...
2
votes
1answer
813 views

Adding text to end of existing value in QGIS

I have a column in a large attribute table. The values in this column are numeric value. Example entries in this case would be: 1, 2.0512, 8.5744, 8.944 How can I add the word 'm' to the end of ...