Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [expression]

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

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

New filter expression QGIS 2.8

I try the new filter expression with QGIS 2.8. I want to filter only the selected objects on a layer in my map. My expression is: import processing from qgis.core import * vlayer = processing....
2
votes
1answer
141 views

QGIS 2.2 expression string builder removes brackets

in QGIS 2.0.1 is used to calculate minimum building distances (Abstandsflächen in German) with an ellipse marker with data definded properties. the expression for this is quite complex: (([Value 1] +...
2
votes
1answer
51 views

Why is my default value stil NULL even when i have made an expression for the Default Value?

I seem to have a problem with the default value in one of my colums by the calculator expression. I have two specific columns that have widget input one being tekst value and the other being numbers ...
2
votes
1answer
1k views

Auto-increment ID in shapefile table when adding new feature

In QGIS I have a shapefile containing about 2000 features where I added a unique ID using the $id expression . I want to continue adding features to the same table, using the attribute feature pop-up ...
2
votes
1answer
318 views

Splitting text attribute using conditional function QGIS 2.18.13

i want to split a text column with city names by selecting only the names like 'world (planet)' and not like 'world planet'. Tried before with left( "Name", strpos( "Name" ,' ')) update existing field ...
2
votes
1answer
421 views

Getting information from one layer in attribute table of another layer

In the picture you can see polygon number 39a in the center. This polygon is drawn on one layer. The layer underneath holds information with soil conditions (green and red). You can see that polygon ...
2
votes
2answers
735 views

How to find overlapping points and add their name value to each other?

I'm working on a point-layer where points represent the start and end point of lines (streets). Since some streets are joined to each other at the startpoints/endpoints (because they're next to each ...
2
votes
1answer
183 views

Labelling expression - How to combine two different functions?

I'm not an expert of scripting and programming, I need to use these two functions in the labelling expression in ArcGIS. How can I combine this: Function FindLabel ( [toponimo] , [testo] ) ...
2
votes
2answers
2k views

How can QGIS Field Calculator sum values from a spatially joined table?

Can the Field Calculater be used to sum values from a related table via a Spatial Join? I have two vector polygon layers A and B, each with a numerical column VALUES. I want to update VALUES in ...
2
votes
0answers
57 views

Converting lat/long to EPSG:27700 in geometry generator expression

I have incorporated a geometry generator into a style in QGIS 3.4 which creates a callout line from a feature to its relevant spatial position. For reasons out of my control our projects use CRS: ...
2
votes
0answers
35 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 ...
2
votes
0answers
104 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 = ...
2
votes
0answers
52 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 ...
2
votes
1answer
86 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 ...
2
votes
0answers
100 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 ...
2
votes
2answers
138 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
0answers
50 views

QGIS Conditional statements in field calculator [duplicate]

I have attempted to write an expression for hours now by looking through these forums. I want to write if this column equals Blank, than this column equals blank. Ex) If defect_typ = A_FC ...
2
votes
0answers
73 views

How to set diagram color based on conditional expression?

I'm trying to create a map with pizza diagram, and I'm using the following expression: CASE WHEN pH >= 6 AND pH <= 9 THEN Color_rgb (0,166,226) WHEN pH <= 6 AND pH >=9 THEN ...
2
votes
1answer
186 views

How to create a 'dummy' DATETIME field for QGIS timemanager?

We have several 'time-aware' datasets, but the dates are stored as YEAR (2017), SCHOOLYEAR (20172018), etc. rather than a true DATETIME value. In order to animate these datasets, is it possible to ...
2
votes
2answers
72 views

Getting selected column/field for graduated color via expression or other routine in QGIS?

I have choropleth map with graduated colors. The column - the field name - that I choose to define the classes and the colors is important for my work on the maps. Is there a method to make it visible ...
2
votes
0answers
286 views

Label only one polygon in canvas/map view per category/value in attribute table

Question: In QGIS (2.18), how do you show only one label per field of view in the map canvas for each visible category (that is displayed in the map view/canvas at any given scale/focus) of a multi-...
2
votes
0answers
174 views

How to get the name of the layer on a map composer with a single layer?

I tried layer_property( 'layer', 'title') I would like to return the current layer from the map instead of 'layer'. (or list of the layers on the map?) Doesn't seems to works with layer_id or ...
2
votes
0answers
84 views

CalcInterior expression help in QGIS

In QGIS on a new layer I'm trying to calculate the area of certain landtypes individually from a Grounds Maintenance layer. Previously I have used the following expression in Cadcorp SIS: ...
2
votes
0answers
263 views

QGIS 2.8.2 - Using spatial expressions in labelling

I'm creating some hard copy map output from QGIS. I want to use an expression to suppress labels for some features on a layer when another feature from another layer intersects with those features. ...
1
vote
2answers
290 views

Using Asterisks in Python parser of ArcGIS Label Expression Builder?

I am trying to create a label expression that labels features that contain hike in their name (versus those that don't). I have tried something like this: def FindLabel ([Name]): if [Name] is "...
1
vote
1answer
751 views

Custom Python Expression Functions (QGIS Tutorial)

I'm having trouble finishing the QGIS tutorial for Using Custom Python Expression Functions: http://www.qgistutorials.com/de/docs/custom_python_functions.html I get to the point where I write the ...
1
vote
1answer
685 views

Only displaying polygons over certain size in ArcMap using Definition Query?

I have a polygon containing lots of bodies of water and only want to display the bodies of water over a certain size. Can I do this using a definition query?
1
vote
2answers
2k views

Displaying unit as 'text' within label in QGIS?

When labelling areas in QGIS I can't figure out how to display the unit after the number value from a field. For example the area of my polygon might be 1.23 hectares, which has been calculated ...
1
vote
1answer
66 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 ...
1
vote
1answer
191 views

Expression to define label font in QGIS 3.2?

I am trying to define the font for features based on values in the attribute table. This is what I have tried in the Expression String Builder next to the Font dropdown in Layer Properties/Labels/Text:...
1
vote
3answers
1k views

Writing label expression in QGIS to remove end of string?

I am using QGIS 2.18. I have a point shapefile showing ranger stations in a park. The attached image is the field I want to use to label my points. I want to omit "Ranger Station" from showing in ...
1
vote
1answer
215 views

Correct expression syntax for filling field with string in calculate field in ArcPy?

I am attempting to populate fields on two different feature classes with different strings that I have stored in a list. I would like to just put the strings and feature classes into a for loop, but ...
1
vote
1answer
726 views

Calculate Field and Python Expression

i know to you my question sounds ridicoulus ... but i ask anyway ;-) i want to populate a field with a new value. If the field has a value of 1 it should get the new value of 15. If the field is 0 ...
1
vote
2answers
68 views

Creating array of z-values from line vertices in QGIS field calculator?

I would like to create an array of a line's z-values to use as part of another expression. The z-values should be in the same order as the vertices, I would like to be able to use it as an input for ...
1
vote
1answer
76 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
1answer
107 views

How to query 1 feature of each category using QGIS (SQL like) expression language?

I use QGIS 3.2 to select features in a shapefile. Lets say I have shapefile which contain 100 features and have such fields: Class with possible values A,B,C. ID with possible integer values 0, 1, 2, ...
1
vote
2answers
153 views

Labelling using Python Parser in ArcGIS Desktop?

I have limited expertise with Python. I need to create labels based on groups of attributes. I've figured out a clumsy way to accomplish this but it involves 20 different annotation classes / SQL ...
1
vote
1answer
227 views

Select features in statement CASE ELSE or CASE in QGIS 2.10.2

I need to label only US states and canadian provincies Here is my attribute table and my expression Program show that is no error here, but it still don't work. What I'm doing wrong?
1
vote
1answer
74 views

Label expression problem?

I am mapping the municipalities 911 numbers on our road network and built a simple python expression to find the lowest value between 2 fields. Then it shows that value on the line followed by an ...
1
vote
2answers
149 views

Building expression that involves fields in Layer Properties (size, rotation) using QGIS?

I need to build an expression in QGIS that involves fields like Size, Rotation or Offset. Is there any method how I could involve these fields when I am building the expression? So I have a Point ...
1
vote
1answer
85 views

Using label properties/expression in ArcMap to label several ranges of numbers within feature class red?

I have about a thousand labels, some of which need to be labeled red. For example, 511-533 and 659-671 need to be labeled red, and the rest can be labeled in black. They are all part of the same field ...
1
vote
1answer
157 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
174 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
506 views

Label a layer by excluding specific features in QGIS

I would need to label a layer excluding specific features based on the value of an attribute, ie I would not want to appear the labels like 'xxxxxx_FIUME_xxxxx' or 'FIUME_xxxxx' etc. I tried using ...
1
vote
1answer
266 views

Comparing values across attributes of one feature in QGIS

I am using QGIS 2.18 I have a shapefile that contains data of each state of India, and the number of people per state following a particular religion. Each feature has the following attributes: ...
1
vote
1answer
79 views

How to use, at one-time, an expression to replace encoding errors in QGIS 2.18.14?

I need to replace several encoding errors in just one task. I have this: If I change the encoding to UTF8, the "Label" field is correct, but the error passes to the other field, "name". Instead of ...
1
vote
1answer
76 views

Return all IDs of point features within a polygon to one field

On QGIS 2.14.14 I am trying to compile Old Land Parcel ID codes on to New Land Parcel geometries. The Old Land Parcel IDs are recorded as point data and the New Land Parcel geometries are polygons. ...
1
vote
1answer
69 views

PostGIS error with working expression

I'm using OSM-Data via PostGIS (osm2pgsql). To draw a highway with and without bridges or tunnels, I use the following expressions: The highway: "highway" = 'motorway' AND "bridge" IS NOT 'yes' AND ...
1
vote
2answers
323 views

QGIS Retrieve field used in data-defined override

I have a point layer in QGIS with an SVG marker. I set the rotation via a data-defined override to the value of one field in the layer. How do I retrieve that field in Python? Not the numeric value ...
1
vote
1answer
1k views

Creating multiple lines label in QGIS?

I try to create a multiple lines label for this this polygon: I red How to create multiline labels in QGIS? QGIS, Multiple lines and wrap on character? and tried to use the "wordwrap" function ...