Skip to main content

Questions tagged [qgis-expression]

refers to a kind of dialect QGIS uses to expand its features, primarily used to calculate fields, manipulate geometry or manage symbology.

Filter by
Sorted by
Tagged with
1 vote
1 answer
22 views

Filter/selecting features in layer in qgis by grouping after one column and only taking the max value of each group

Lets say there is a layer like this in qgis which can be copy pasted from this geojson: { "type": "FeatureCollection", "name": "test", "crs": { "...
Lenn's user avatar
  • 1,287
0 votes
0 answers
22 views

Get associated roadway from sidewalk geometries in QGIS using OpenStreetMap data

I work with pedestrian network data from OpenStreetMap for cities where sidewalks have already been mapped as separate lines for all corresponding streets at least for parts of the city area (examples:...
winnewoerp's user avatar
  • 1,504
2 votes
2 answers
75 views

Retrieving label boundaries within QGIS Layout maps

Some time ago, I created a custom Python expression function to retrieve the boundaries of manually placed labels in QGIS: from qgis.core import * from qgis.gui import * from qgis.utils import iface @...
christoph's user avatar
  • 5,747
5 votes
1 answer
145 views

Accessing layer properties for expression syntax in QGIS Modeler

Overview: In QGIS I want to create a conditional branch in the model designer so that I can pass images with 20m resolution through the 'Warp (reproject)' tool. Images that are already at 10m ...
tds's user avatar
  • 99
3 votes
1 answer
45 views

Mid_point label placement using Geometry Generator in QGIS

I've tried to place a label at the start, end, and middle of my lines in QGIS using the Geometry Generator. This post, place-label-along-line-near-start-and-end-of-line-in-qgis, got me the start and ...
Nick_Jo's user avatar
  • 158
1 vote
1 answer
30 views

QGIS: Modeler: conditional branch & case dependent input fail

I have this model attached here wich has the left side (osm1) where the points input are beeing buffered - bounding box and the osm_highway is beeing downloaded. The left side (osm2) should be an ...
Denis Crîlov's user avatar
2 votes
1 answer
56 views

Sort overlay intersections by area of overlap

I am able to get list of attributes of overlapping geometries in QGIS . I want to sort by descending area of overlaps in the geometric . Original Expression array_to_string(overlay_intersects( layer:='...
B Alexander's user avatar
1 vote
1 answer
38 views

Expression to count related number of owners in parcel layer in QGIS

Scenario: In a polygon layer with construction details (f.e. road, construction site) and one table layer with parcel owner information. Both layers have a column with the parcel_id, because the ...
Marek's user avatar
  • 537
0 votes
0 answers
52 views

Autoincrementing new features in text field for QGIS and QFIELD

I am trying to build a project/template for QFIELD for our data collection in the field. I got most of it working but one feature seems to challenge me beyond my comprehension. My layer file has ...
Johannes314's user avatar
3 votes
1 answer
131 views

Why doesn't with_variable work in this QGIS expression?

I'm trying to make a filter inside an overlay_nearest function where I must relate an attribute from the current layer to the overlay layer. I'm trying to use with_variable to store the outer layer ...
Daniel Möller's user avatar
2 votes
2 answers
130 views

Using filter expressions in QGIS calculator with overlay_nearest

I have a layer 'Points' and a layer 'Lines'. Both layers contain an 'ID' attribute, which relate (but it's an m x n relation) I'm trying to get the point position "along" a line, and I can ...
Daniel Möller's user avatar
4 votes
2 answers
116 views

Why QGIS expression display double at concave sections?

I am trying to display the vertices of a polygon with vertex number. In symbology, I have used the Marker line and font marker. . When the Line offset is -5 positive the text 'P7' is displayed far ...
neogeomat's user avatar
  • 8,380
4 votes
2 answers
322 views

QGIS: expression in attribute table between greater than and less than with different categories in one field

I am trying to create a field that shows the following different categories in the same field: Variable = verschil bouwhoogte "Verschil bouwhoogte" <3 "Verschil bouwhoogte" =>...
Mees's user avatar
  • 43
7 votes
2 answers
177 views

QGIS functions: aggregate and array_foreach not working for vertices

I have two layers as the whole project in EPSG:4326: polygon layer of countries linestring layer of routes I want to concatenate the country names (those are stored in "name" attribute) ...
Kluuboo's user avatar
  • 71
0 votes
1 answer
51 views

QGIS expression, format number to number of decimals [duplicate]

I am using QGIS to plan a cable layout. Knowing the resitance per metre in the cables, lenght of cables and the current draw of each site, I can calculate the voltage available at each site. The ...
MortenSickel's user avatar
  • 3,824
0 votes
0 answers
78 views

QGIS relation reference widget filter between child (point layer) and parent table (no geometry)

I have two PostGIS layers in QGIS 3.28, they are in a 1-N relation (association): layer A (parent) without geometry (table) layer B (child) with point geometry Both A and B layers have the codsede ...
Alessandro Viprati's user avatar
-1 votes
1 answer
163 views

Geometry by expression does not work after intersection [closed]

I would like to split a linelayer with points in QGIS. For that, i found this answer: Splitting line with point layer in QGIS I have one point layer: QBW_Strukturgütekartierung and one line layer: ...
IchmagNuss's user avatar
4 votes
2 answers
236 views

How to count points in percentage that are within an extension defined by two pairs of coordinates

Starting from a points geometry layer, my goal is to count points in percentage that are within an extension defined by two pairs of coordinates corresponding to the corners: The initial situation is ...
Ingrid Ingravida's user avatar
0 votes
1 answer
68 views

Excel CEILING function equivalent in QGIS

In Ms Excel the CEILING function allows you to round up in steps as below. I need to round up in quarters in a QGIS expression and I would like to avoid something messy involving dividing my number by ...
Sethinacan's user avatar
  • 1,724
1 vote
0 answers
49 views

How to reference tables in a GeoPackage after changing layer name in QGIS?

While developing a Geodatabase with a lot of tables, reports etc. I decided to rename some layers in QGIS to help my client use the database. Now all my expressions like get_feature() won't work ...
Stefan's user avatar
  • 74
0 votes
0 answers
35 views

How to get crs_description from EPSG-Code?

I'm searching for an expression in QGIS to get the description of a CRS Assume I have following table: Area EPSG desc A1 EPSG:31258 A2 EPSG:31255 Now I want to fill in the "CRS-Description&...
Stefan's user avatar
  • 74
1 vote
0 answers
42 views

Linking Point input data with SAGA Upslope input in QGIS Modeler

I have a model set up with a point input. I need the point's x and y coordinate data to populate the x-value and y-value fields required as input for the SAGA upslope function. I have tried various ...
Louw's user avatar
  • 11
3 votes
4 answers
237 views

Extracting 'hour' from 'time_stamp' with QGIS

I am trying to extract the hour from my time_stamp which is in the format dd/mm/yyyy 00:00:00 as a textstring. I am using the expression hour("time_stamp") in the field calculator, but the ...
Eleanor Baker's user avatar
2 votes
1 answer
60 views

Create parrallel lines in symbology according to attributes

I have a vector layer as lineString geometry type. This layer has 2 attributes: true_side is the line spacing. true_witdh is the total width to distribute lines The number of parrallel lines is ...
Vincent Bénet's user avatar
3 votes
1 answer
70 views

Grouping sum by user provided field name in graphical modeler

I want to sum and group some percentages as a part of a model in order to check whether the percentages are exactly 100, or if there is a small rounding error. When using the field calculator outside ...
Erik's user avatar
  • 16.4k
6 votes
2 answers
558 views

Converting azimuth to bearing with QGIS expression

For example, an azimuth of "225°" to read "S 45° W." I think there's a plugin that can do this, but I want to use this as a label in QField while digitizing.
GISKon's user avatar
  • 121
6 votes
1 answer
115 views

Drawing 10 nearest lines from each point connecting to the centroid of the 5 points nearest to each point with QGIS expression

Starting from a layer with point geometry, my goal is to do two calculations in one Geometry Generator expression. First, for each point, I would like to calculate the centroid for the 5 points ...
Ingrid Ingravida's user avatar
1 vote
1 answer
78 views

Writing degrees Celsius in short hand ('c) in QGIS expression

There is a way to add something before the ' to indicate to QGIS that it is a string and not a column. In expression builder I simply want "temperature" || ''C'
Gregory C's user avatar
  • 353
7 votes
1 answer
113 views

Use algorithm output as expression in QGIS modeler

I want to use the algorithm output within the input expression of another algorithm in the Graphical Modeler of QGIS 3.30.3. Specifically, I want to create clusters of areas previously identified as ...
lesles93's user avatar
1 vote
1 answer
82 views

Connect touching lines by condition using expressions in QGIS

I have a polyline layer (Layer_A) in QGIS that represents entities (street crossings) that either consist of a single feature or are split into two or more features. The entities may also touch at ...
winnewoerp's user avatar
  • 1,504
3 votes
1 answer
116 views

Extracting two closest points with matching ID and create line between both points in QGIS

In QGIS, a have point vector Layer_A with a unique ID field and point vector Layer_B with multiple points for each Layer_A ID. For each point on Layer_A I want I need to create a line that connects ...
winnewoerp's user avatar
  • 1,504
1 vote
0 answers
71 views

Extract central part of automatically created perpendicular lines in QGIS

I have a set of lines (roadways) on layer A and a set of (mainly) parallel lines (sidewalks) on layer B. I want to create perpendicular lines at a given distance that extend from the layer A center ...
winnewoerp's user avatar
  • 1,504
3 votes
1 answer
88 views

Counting points from layer at map extent with QGIS expression

I want to create an expression in the QGIS 3.28 dashboard layer that counts points on a specific point_layer and with a specific value that is displayed in the current map_extent view aggregate( ...
Rii Pii's user avatar
  • 464
4 votes
1 answer
192 views

Creating horizontal lines connecting points using QGIS Geometry generator

I am using the geometry generator to learn how to generate vectors using expressions. Currently, I have a point vector, and I would like to create horizontal lines (shown in red: manually drawn) ...
unknown123's user avatar
7 votes
1 answer
182 views

Auto incremental field filled with filtered by other field value in QGIS Attribute Form

From a point geometry layer with two categories "A" and "B", when I enter new points, I first choose the category of the "CATEG" field with a listbox, and then I use the ...
Ingrid Ingravida's user avatar
5 votes
1 answer
135 views

Distribute a function for QGIS

I have written an expression to use in the field calculator that is to be used by a number of other users. In Providing QGIS expression within a plugin I was told how to distribute an expression (or a ...
MortenSickel's user avatar
  • 3,824
3 votes
2 answers
190 views

Classifying in QGIS into arbitrary number of percentiles instead of quantiles, based on attribute field value

Extending this question and this one: In QGIS, there are special expression functions for the first and third quartile (q1 and q3) and as well as median (median). So it's easily possible to categorise ...
Babel's user avatar
  • 71.6k
4 votes
2 answers
182 views

Calculate network length covered by service area in QGIS

The resulting MultiLineString features of Service area (from point) and Service area (from layer) in QGIS usually contain several overlapping lines. How can the length of the network covered by the ...
winnewoerp's user avatar
  • 1,504
4 votes
2 answers
175 views

QGIS expression function for intersecting points with underlying MapBox vector tile layer to capture attributes

How can I use the QGIS 3.34.0 field calculator to intersect points with an underlying MapBox vector layer and add certain attributes of the intersected features as virtual point layer fields? If this ...
christoph's user avatar
  • 5,747
5 votes
2 answers
270 views

QGIS Aggregate expression Function with GroupBy argument

I have a Layer "SplitNEW" which is grouped by the "group"-Column as follow: 0-RED , 1-GREEN , 3-BLUE. The 3 Lines where previous split. Each Row in attribute table stands for an ...
Denis Crîlov's user avatar
1 vote
0 answers
29 views

HTML/Expression Builder for Dynamic Labels

Working in QGIS 3.28.2 My goal is to make a GIF that shows the routes of protests/marches that either begin/end in Malcolm X Park according to date. I have a layer ("Protests") that has two ...
Rami Stucky's user avatar
1 vote
2 answers
136 views

Selecting multiple points from an attribute table in QGIS, based on uncategorized field value

I have a point shapefile in QGIS (3.30.2) containing more than 2000 points. I selected about 150 of these points based on a special criteria. I need to create a separate shapefile with only these 200 ...
Paris's user avatar
  • 591
4 votes
2 answers
353 views

Capturing all matches (occurences) with QGIS regular expressions

Problem I use QGIS with the expression function regexp_matches() that returns an array of all strings captured by capturing groups. Regular expressions normally capture only the first match (occurence)...
Babel's user avatar
  • 71.6k
1 vote
1 answer
140 views

Error with array_foreach when using together with aggregate in QGIS expression [closed]

I want to use array_foreach functionality. But it does not seems to work when used in an aggregate function. This intermediate test ( array predefined, instead of array generated by another aggregate),...
ClaudeVer's user avatar
  • 630
2 votes
3 answers
217 views

Formatting string with QGIS Expression builder: separate groups of fours digits with hyphens

I'm trying to make a label ruled based. I have a numerical value: 123412341234 and try to write an expression to make it look like this: 1234-1234-1234 I tried using substr but I get an error when ...
Lutu's user avatar
  • 31
3 votes
2 answers
196 views

QGIS expressions: creating an array based on integer fields returns 0 for field value NULL

Problem I use QGIS expressions (tested in QGIS 3.32.3 Lima and 3.34.0 Prizren on Win 10) to create an array based on attribute fields like array("field1,"field2"). I have fields of type ...
Babel's user avatar
  • 71.6k
2 votes
1 answer
244 views

Setting a layer's Raster Image Marker X/Y location based on the X/Y coordinates of the feature's label in QGIS

Using QGIS, I'm trying to make a map with Label Callouts that show both the name of the feature, as well as display an image of the feature. I'd like the position of the image to be based on the ...
Lost Mapper's user avatar
  • 1,941
3 votes
2 answers
167 views

Graphical model for random points inside polygon moved to closest point on line

I want to place a regular random distribution points inside a polygon and move these points to the respective closest point on a line layer afterwards. I use regular points algorithm with random ...
winnewoerp's user avatar
  • 1,504
1 vote
1 answer
60 views

Dynamic point shifting based on bearing and elevation surface

I'm currently working on a graphical model (for planning centre pivot irrigation locations) that moves points iteratively based on a given span length, bearing and span number. All spans are initially ...
Beets's user avatar
  • 13
4 votes
1 answer
165 views

Creating series of multiple Concave hulls at certain distance in QGIS

Starting from a layer with point geometry, I apply the following function that creates the concaves polygon for each group of points of an attribute field ("class"): concave_hull( ...
Ingrid Ingravida's user avatar