Questions tagged [field-calculator]
allows you to perform calculations on the basis of existing attribute values or defined functions in QGIS, ArcGIS, etc.
2,494
questions
0
votes
0
answers
18
views
Filtering Date Ranges in QGIS
I mapping species spread from 1960-2020 and I want to map three intervals, 1960-1979, 1980-1999 and 2000-2020. How would I create 3 sperate layers for each of the years?
2
votes
1
answer
95
views
Using IF statement in Field Calculator to write values into new field based on another field
For some QGIS-OSM import tasks, I'm trying to create a new attribute field for objects based on existing attributes in the Field Calculator.
In short, for all the objects with the existing field CLASS ...
1
vote
1
answer
40
views
Find the longest unbroken and identical chain of a value in field
I'm working with large datasets regarding the concentration of pollutants in rivers. When the field "time" = 1 then the concentration has exceeded a certain limit for 10 mins.
I need to know ...
0
votes
0
answers
22
views
Calculating percent of class pixel using ArcGIS Pro field calculator [closed]
I want to calculate percent class pixel (pixels present in class). formula is
% class pixel= class pixel/total class pixel*100.
How can I calculate this using ArcGIS Pro field calculator?
0
votes
0
answers
22
views
copy field from another layer [closed]
I have two layers, let's say L1 and L2, whose features have the same id. In the attribute table of the layer C2, there is a field names L. I would like to have the same field for the layer C1, for the ...
0
votes
0
answers
38
views
"OK" button is grayed out in QGIS field calculator, despite troubleshooting
I am trying to add a new field to a shapefile layer (created in R) using the Field Calculator in the attribute table in QGIS. However, the "OK" button is grayed out and nothing I do will ...
2
votes
1
answer
57
views
QGIS Field Calculator Expression: get field name for value at specific index
I am looking for a way to search the field name ( green circle ) of a value at a specific index.
In the example shown above I would like to find the field name "25 x 2,3" for the value of ...
0
votes
1
answer
39
views
Field Calculator populating a new field with strings based on old field with integers
I have two fields, one is old, Ftype, one is new, Ftype_name. I would like to have python read the numbers in Ftype and populate Ftype_name with the string. I used to know how to do this before they ...
-1
votes
2
answers
34
views
Insert or replace value in one field based on value of another field using ArcGIS Pro
I have sample data I am trying to visualize in ArcGIS Pro. I have one field that shows if the sample was detected or not (DetectedResult), which is either a 'Y' or 'N'. Then I have another field with ...
0
votes
1
answer
20
views
How to create a field with a list of neighboring residential lots in QGIS?
I need to create a field with a list containing the 'name' information of the geometries that intersect each of the existing geometries. They are residential lots, and I need to list the adjacent ones....
2
votes
2
answers
110
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 ...
0
votes
1
answer
46
views
QGIS rank by category
I have a dataset with two attributes:
Attribute 1: A , B, C
Attribute 2: 1, 2, 3, 4
I want to rank Attribute 2 but with a separate rank for each value in Attribute 1.
I already did the ranking by ...
4
votes
2
answers
268
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" =>...
1
vote
0
answers
36
views
Field value populated ether by another field value or by user input based on a Boolean field in QGIS form
I'm creating a winter bird survey form in QGIS for use in Qfield.
There is a field called "mixed" which records whether a flock is mixed(1) or not(0).
Another field called "sp_count&...
4
votes
1
answer
244
views
Dissolve consecutive touching lines segments where common value in QGIS
I am trying to dissolve the grey line layer where the field "dis" ( "anzahl" || '-' || "heizlast") has the same value and the segments are touching ( end_point touches ...
0
votes
1
answer
60
views
Inaccuracy using field calculator to get coordinates of a point layer
When using the $x and $y commands in the field calculator to get coordinates of features in a point layer, the coordinates I get are different than if I point the feature with my cursor. The deviation ...
2
votes
1
answer
75
views
Field Calculator Aggregate returns NULL
I'm facing an issue while trying to calculate the maximum value within polygons from another vector layer in QGIS. I've tried using the aggregate function with the 'max' statistic, but the result is ...
3
votes
0
answers
50
views
Colorizing polygon layer with average within raster colour pixel
Further to the question Assigning raster layer colors to polygons in QGIS, I have used the expression proposed by @Babel solution with a positive result.
Is it possible to use a similar expression for ...
3
votes
2
answers
122
views
QGIS Field Calculator Expression to retrieve index of specific value
I have two tables:
[see image beloW]
HAK where the Column "Volumenstrom_h" has the input value ( x ) needed for the linear interpolation formula displayed which can be seen surrounded by ...
0
votes
1
answer
94
views
Calculate date difference between current date and previous date using Arcade with ArcGIS Pro
I can't find the error in my code. I am trying to calculate the difference between the current date and a previous inspection date. I want the difference to be calculated in days. I am using ArcGIS ...
0
votes
0
answers
37
views
Display information from a different layer in an attribute table in QGIS
I have two different polygon layers we'll call them A and B. I would like to create an attribute table with fields that list areas of A and B (calculated using the $area function in field calculator). ...
1
vote
1
answer
41
views
Calculate percentages of intersected layers
I have two shape layers in QGIS. Layer A shows the geometry of districts in Berlin. Layer B shows water protection areas in Berlin. The different areas/ geometries of layer B can cross multiple ...
4
votes
2
answers
288
views
Automatically add latitude and longitude field upon creating a point feature in QGIS
I need to create two fields in the attribute table that automatically takes the latitude and longitude of the point features that i digitize, without running any other command or update. When i create ...
1
vote
1
answer
29
views
Using CalculateField within a script tool to edit the shape of a polygon
I am working in ArcGIS Pro 3.2 and with Python 3.9.18
I am trying to replace the geometry of a polygon with the polygon from another layer. I have used this small calculate field expression to replace ...
0
votes
1
answer
35
views
Using field calculator to associate lines with countries
I have a shapefile of power transmission lines and a shapefile of countries.
Ideally I want to use the field calculator to identify and add two new columns: of the country where the transmission line ...
1
vote
1
answer
52
views
Calculating attibute for a layer objects based on objects of another layer
I have a point layer. The points have float attribute "cost".
I also have a line layer with a simple line between every two points from the point layer.
I want to calculate a new attribute ...
3
votes
1
answer
113
views
QGIS : Sequential number assigning of points from geometry of nearby line layer with same attribute
I have created an example project in QGIS to help illustrate what I am having difficulty with. Using the field calculator, I would like to automate assigning sequential numbers to my points layer ...
0
votes
0
answers
56
views
Calculate Field calculates once
Why did Calc Field work the first time I wrote the following code, but not when I re-ran it with an additional criteria? I figured out the code I needed to classify all fields in a new attribute ...
1
vote
1
answer
75
views
Using ModelBuilder in ArcGIS Pro
I am trying to create a ModelBuilder model to calculate factor of safety for shapefiles. However, whenever I try to run the python my 'Slope' comes up as undefined and I have no clue what to do.
Here ...
1
vote
1
answer
43
views
Computing ratio based on diferent columns on QGIS calculator
I need help regarding QGIS calculator: I have a dataset, a polygon, with several columns:
Rowid
Pond1
Pond2
Pond2
Lake1
Lake2
Lake3
Stream1
Stream2
Stream3
1
JA
JA
BA
BA
WC
WC
WC
2
WC
FA
JA
FA
WC
...
3
votes
1
answer
58
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 ...
1
vote
1
answer
61
views
Automatically create a polygon when inserting a new point feature in QGIS/QField
I am working with a point layer which has a set of field where are stored some information about a rectangular geometry. This information is width, length and rotation of the shortest side of the ...
3
votes
2
answers
198
views
Loop through fields in QGIS calculator with condition: count fields with values >0
I have a dataset, a polygon, with several columns, let's say:
Site
Species1
Species2
Species3
1
85
23
90
2
73
20
0
3
0
0
0
4
0
0
70
5
0
75
60
I have different sites and data about several ...
4
votes
1
answer
86
views
Conditional value output in QGIS field calculator for array aggregation
I have a three point across x with five repeating rows with this attributes:
[ 2, 1, 1 ]
[ 1, 2, 2 ]
[ 1, 1, 1 ]
[ 2, 2, 2 ]
[ 4, 4, 4 ]
I want to calculate a new field which aggregates the rows, ...
2
votes
1
answer
92
views
QGIS: Select by expression on the same layer with condition
What I am trying to achieve is selecting the lines that have the value of the field "Heizlast in kW" = 0 + the lines that touch it (like the selection in the picture above).
Using the ...
1
vote
0
answers
46
views
Model Builder: Calculate field from Parameter defined Joined table returns 'u"String"' instead of 'String'
Using Pro 3.2.0. The goal of this Model is to use a .xlsx spreadsheet to update values in a feature class which will be shown in a webmap. The .xlsx in question was generated from the Master Tracker (...
2
votes
1
answer
119
views
QGIS: Geometry By Expression - collect geometries from self selecting line excluding $currentfeature and change geometry [closed]
I am looking for a solution in QGIS in form of an expression that is collecting the geometries that intersect the $currentfeature ( excluding this one - the orange line ) and than iterate over the ...
1
vote
1
answer
131
views
Rank and edit a field with the ranking number in QGIS attribute table
I want to fullfill the field HZ (using field calculator) with a rank number in wich several objects will have the same HZ number. Each time the previous fields are all equal, those objects should be ...
0
votes
1
answer
55
views
ArcGIS Pro 3.1.2 change only blank selected cells in attribute table
I am using ArcGIS Pro 3.1.2. Is it possible to change only the null values cell in a selected dataset? I could have export the selected features as a new shapefile. Select the null values and replace ...
0
votes
0
answers
22
views
Update summary statistics columns using field calculator
I want to update 2 columns, which were made by summarizing field values in the first column (WEQ) based on spatial location. The summarized field (WEQ) has been updated using the field calculator, but ...
2
votes
1
answer
100
views
QGIS Field Calculator - Aggregating and Calculating Ratios Based on Y-coordinate
I am trying to use the QGIS Field Calculator to calculate the sum of a specific attribute ('demo_field') for features in a layer to the sum of the same attribute for features that share the same y-...
1
vote
1
answer
92
views
Concatenate string variable and field in ArcPy "CalculateField" expression
I am trying to add a file path field to a feature layer in an ArcPy notebook in ArcGIS Pro. I have a variable with the beginning of the path (the path to the folder) and an existing field with the ...
0
votes
0
answers
69
views
Calculate Field Tool in ArcMap to add objectid to a string
The table is in an Oracle Enterprise Geodatabase. As for the language processor I am unsure.
In an ArcMap table I am trying to use the Field Calculator to place the objectid with a string of text.
Ex. ...
1
vote
0
answers
94
views
Using "Field Type" Variable (Derived from Field Iterator) as inline-variable (with a prefix string) in field calculator
I am trying to calculate the per person load discharge by multiplying "Service Population" of various years to a constant Double type variable fed as a parameter called "Loading".
...
0
votes
0
answers
23
views
QGIS - field calculator of to calculate the closest point on an arbitrary line
Trying to use the field calculator to calculate the closest point on an arbitrary line for each point in an object and append the column to the attribute table. I've had success doing the calculation ...
0
votes
3
answers
249
views
Calculate Field Date
So I created a Date field in a dataset with 5 rows and so I then right clicked on Calculate Field to enter the date (all 5 rows have the same date). The date I entered was 1/1/2022 but Pro did not ...
0
votes
1
answer
58
views
How to use 'to_dm' function in model designer?
When using the field calculator in an attribute table, it is easy to plug in the various fields you might need from the side bar option 'Fields and Variables'. However, in Model Designer this feature ...
2
votes
1
answer
78
views
Multiple operations within Field Calculator using the same IF statement
I have 2 layers (Point_Orien_Vert - red points and Point_Centroides - green points), both are Point Geometry.
I need first to check if the distance between one feature in Point_Orien_Vert and one ...
2
votes
1
answer
115
views
Extracting or selecting only 4 digit numbers from attribute field
I have a field, this field has integer numbers, what I need is to find only the 4 digit numbers and select/extract them. I do know a few solutions but they didn’t work out. What exactly I want to do ...
1
vote
1
answer
35
views
Using Modeler to change attribute names to (self) set standard
I'm trying to use the Modeler to format a vector layer input with an attribute table to a new vector layer with the same attribute table, but where the column names are standardised. The point of this ...