We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [expression]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
63 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
1answer
205 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 ...
1
vote
1answer
69 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
278 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:...
1
vote
1answer
80 views

Evaluate if at least one column contains the value “Yes”

In QGIS, I'm trying to input either 'Yes' or 'No' for a new field based upon the input of values of another 9 fields. I've attached a screenshot of what I'm trying to accomplish. Essentially if there ...
1
vote
1answer
85 views

MultiValue-String to SQL Expressions

I am aware that problems like mine exist (example) but I think, this is slightly different. I want to use MultiValue to let the user choose various inputs at the same time. The problem is, that it's ...
1
vote
2answers
171 views

Label expression help with loop field and multiple fields

I have 13 fields I need to Label all in one Label. But I dont want to label values with zero. Need to have Label before each field example (Field is (C_B) and need to read C&B, 2). Here is what ...
1
vote
2answers
333 views

Populating label fields in print composer

Is it possible to fill text fields in a print composer template using data saved in a csv file? For example, every template I create has the same fields which I always have to manually enter: Client ...
1
vote
1answer
186 views

ArcGIS Issue with Python wildcard in Label Expression?

Here is my current expression: def FindLabel ( [FULL_NAME] ): fn = [FULL_NAME] if "COUNTY ROAD" in fn: return "CR " + fn[11:] elif "% COUNTY ROAD" in fn: return fn[:1] + "CR" + fn[13:] else: ...
1
vote
1answer
81 views

Calculate date difference (days) with expressions (QGIS)

I would like to calculate the number of days between two dates. The first date is written in attribute table [YYYY-MM-DD] (creation date) and the second is today [now()]. The goal is, to get the age ...
1
vote
2answers
55 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" ...
1
vote
2answers
102 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 ...
1
vote
1answer
76 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 ...
1
vote
1answer
176 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 ...
1
vote
1answer
73 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
100 views

Using VBScript for advanced labeling in ArcMap?

I am trying to do some advanced labeling with VBScript and need some help getting to the finish line. I have never scripted anything prior to last week so I am definitely a newbie when it comes to ...
1
vote
1answer
38 views

Widget codes works intermittently

I have a QGIS program that is hosted on a SharePoint server that is used by multiple users. I have entered a rule for a point layer that when new features are created default values are added under ...
1
vote
1answer
161 views

Change True/False boolean value to “Occupied” label

Change the label for a boolean: Instead of "True" and "False" I want the label to display "Occupied." I have tried many iterations of this expression. Nothing has worked. Case when "Field Name" = ...
1
vote
1answer
90 views

How to mount an expression for “contain” in QGIS 2.18.14 Atlas/Print Composer?

EDITED: I did a refinement of the question. Can I ask for your help? Can you download and try to help find the solution? In the link is a simplified project zip file. It has only two layers; one for ...
1
vote
1answer
353 views

Calculating the inner angle

I have some polygons and I want to calculate the inner angle of each polygon. Now, I have the geometry of every line of polygons in the same attribute table as shown in the following image. I want to ...
1
vote
1answer
249 views

Name Active Layer in expression

I would like to produce an atlas of 5 blocks for 16 variables. So for each atlas I display a layer who represent a variable. For each map in atlas I'm able de set a title with display block name with ...
1
vote
1answer
344 views

Displaying a symbol label using an expression in MapServer 7

I want to label the numbered roads at all scales with a symbol instead of text. Also, I would like to label the roads using an expression so I could use the symbol corresponding to the road number. ...
1
vote
1answer
52 views

Is it possible to detect the “composer mode” from witin layer expression

I was wondering if I could create an expression for a layer style that can "detect" the "composer mode" so that it can behave differently when the map is printed (like label priority handling).
1
vote
1answer
242 views

If-then expression and font color in Mapinfo label expressions

How might I obtain the following, other than having two identical tables open to achieve: I would like to label an object using data from two columns from one table? The first half of the label (from ...
1
vote
1answer
371 views

Label only selected features with PAL PyQgis using an expression

I'm trying to label only selected features with an expression using PyQgis and the PAL functions, but I don't find any example and the API don't help me a lot (or I don't found it). My Qgis version is ...
1
vote
1answer
48 views

QGIS - Have spreadsheet with col from 0% to 100% plus null want 100 bin gradient plus one more for null

Newbie alert. Have a spreadsheet with no geo; has a col with values in there from 0% to 100%, plus several blanks/nulls. Ideally would like a 100 step (bin) gradient fill from 0 (100% black) to 100 (...
1
vote
1answer
292 views

QgsExpression to apply on feature

I am using QGIS 2.8. For the documentation of QgsExpression I see the evaluate method on feature as deprecated. What am i supposed to use instead of this methods ? I have some expression and need to ...
1
vote
1answer
567 views

Distance Measure using QGIS Field Calculator?

A QGIS newbie who can't for the life of them work out the expression needed to represent distance from a point. I want to show how a walkable a neighbourhood is. I need do to this by showing what ...
1
vote
1answer
98 views

QGIS Labeling OSM items depending on scale

I'm working with OSM data in QGIS 2.10 (Ubuntu). I'd like to label items depending on scale. What I mean to do is to have only labels of "primary" roads from a scale of 1:80.000 down to 1:50:000 all ...
1
vote
0answers
9 views

Sorting Relation_Aggregation Expression Results in QGIS3

I am using a relation aggregation expression to grab a list of inflows from other sewersheds. Some sewersheds take on flows from more sewersheds than others so I approached it through a relation so ...
1
vote
0answers
29 views

Decimal places in SQLite

I'm working with a locally stored SQLite database and have an area field that auto populates via a virtual field using $area. Works fine but there seems to be no way to set the precision in a decimal ...
1
vote
0answers
41 views

Define color for label-buffer with data-defined override/expression

In QGIS 3.8 (Win 10) I have a Point-Layer with labels in a certain distance and leader lines, created with geometry-generator. The leader lines in some cases cross below the label and are masked by a ...
1
vote
0answers
49 views

Multiple labels [closed]

I have followed tutorial for labelling from multiple columns, e.g. name and also grade. Looks correct in expression but nothing shows in output preview. Any idea where I am going wrong?
1
vote
0answers
32 views

ArcGIS Pro calculate field using arcade not working?

Im trying to calculate a field called "bark t/ha" using the following expression: if ($feature.Barkfuelhaz =="Low"){ return"0"} else if($feature.Barkfuelhaz =="Moderate"){ return"1"} else if($...
1
vote
0answers
52 views

Layer Styling by Geometry Generator in QGIS 3.6

I am trying to create custom styling by using Geometry Generator in QGIS 3.6 but I got an error expression. segments_to_lines ( $geometry) ramp_color('Viridis', scale_linear( length( ...
1
vote
0answers
75 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 ...
1
vote
1answer
86 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
83 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
82 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
56 views

Rule based styling in Qgis using a combination of attribute(get_feature()) and ILIKE

I Have 2 Layers: I want to Filter Layer 2 by an attribute from Layer1 for some rule based styles. I'm currently using following expression to realize that: "C1" = attribute(get_feature(‘Layer 1', '...
1
vote
1answer
58 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. ...
1
vote
1answer
367 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
38 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....
1
vote
2answers
219 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
41 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, ...
1
vote
0answers
30 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(...
1
vote
0answers
82 views

Creating in-line variable is possible in field calculator of QGIS 2?

I create new field based on other fields. For example; if "Field_A" is smaller than "Field_B", value of new field is 'A', otherwise it is 'B'. So I want to create new variable for this case within ...
1
vote
0answers
48 views

Features duplicated in multiple, different fields - label expression to avoid duplicate labels

Using ArcMap 10.4.1. I am trying to label a feature class of roads, there are 5 types: U.S. Highways, State Highways, County, Municipal, and Off Highway. Sometimes a road feature belongs to two ...
1
vote
0answers
92 views

Force expression-based map item position onto second page in Atlas setup?

I created an atlas with two pages for each atlas feature, the first being for a map and the second page being for a table. I need to separate pages as the map is using all the paper space and the ...
1
vote
0answers
63 views

Calculated sum of visible areas in print composer

I want to view the sum of area of each habitat displayed in the layout. Only the displayed habitats in the viewport. Which expression do I have to use in the textbox? Now I have calculated them manual....