Skip to main content

Questions tagged [field-calculator]

allows you to perform calculations on the basis of existing attribute values or defined functions in QGIS, ArcGIS, etc.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
14 views

ArcMap Python field calculator autoincrement in specific ranges [closed]

I'm attempting to write a Python expression for field calculator that will auto increment an integer ID field, but only using numbers that fall within certain ranges. I work in a versioned environment ...
Luc GIS Nerd's user avatar
1 vote
2 answers
50 views

QGIS - Extract with expression - one occurrence each - if ID IS NULL

I'm currently configuring the 'Extract by expression' algorithm to achieve the following: Keep all values where 'ID_IMPCT' IS NOT NULL. Keep only one occurrence of each unique feature in 'LIB_PHYSIO' ...
Giene's user avatar
  • 753
2 votes
1 answer
53 views

ArcGIS Pro Field Calculator is not working with double field [closed]

I am using ArcGIS Pro version 3.2.2. I am trying to use Field Calculator on a point feature class, which was generated from a Kriging raster dataset using the GA Layer To Points tool. When I multiply ...
Salit's user avatar
  • 170
3 votes
1 answer
71 views

In QGIS count points that are nearest to a line segment with the same name

I have a street layer which consists of many segments. I would like to count the number of points that have the same "name" attribute as my street layer and are nearest to the geometry of my ...
Gregory C's user avatar
  • 413
0 votes
1 answer
77 views

In QGIS field calculator copy everything from column after first - symbol

[Edit: Amended to show original mistake] How can I simply copy everything from a column that is after a -. ? ChatGPT gave me this (which doesn't work) substr("name", strpos("name", ...
Gregory C's user avatar
  • 413
2 votes
1 answer
202 views

Repeating linestring across farm field at 40 inch intervals to use r.report for pixel values

I am a new user of QGIS. I have found answers to most of my issues. This one has me stuck. I have included an image of the project I am attempting to create. My plan is to place a linestring on every ...
Jess Woeltje's user avatar
2 votes
0 answers
52 views

Calculating the end km with reference to the start km of road in QGIS

Note the labelling on the picture to be the lengths of the link segments and have been selected from Right to Left. Start KM = KM at the beginning of the link End KM = KM at the end of the link. (...
Kendel Mashuga's user avatar
0 votes
0 answers
33 views

How to give numbers by order to column in ArcGIS Pro through FieldCalculator and Python

How to give numbers by order to column in ArcGIS Pro through FieldCalculator and Python? Sequence doesn't work as I need. I sorted X_North and need to give a numbering (from 1 to 296) to new column. I ...
Sandi's user avatar
  • 17
3 votes
1 answer
64 views

Creating ranking from value of different attribute in QGIS Field calculator

I have a set of values (differ_per) which I would like to rank (ranking_top) in descending order. How can I do this using the field calculator in QGIS? ChatGPT gave me this: array_find(array_agg(&...
Gregory C's user avatar
  • 413
0 votes
0 answers
20 views

Group summing angle difference per street in QGIS

I have street line layer and I am interested in finding the angle that a street curves. I have extracted the vertices. Now I want to use the field calculator so be able to find the difference between ...
Gregory C's user avatar
  • 413
1 vote
1 answer
34 views

Expression to auto-fill field according to the order of polygon creation

I'm working on an urban cartography actualization project, looking for a way to auto-fill a field (let's call it "field_1") in the new polygons created in the buildings layer. I need to ...
Mig TabSher's user avatar
0 votes
1 answer
55 views

Field Calculating in ArcMap edit session

I'm trying to update the field in yellow using field calculator in ArcMap in an editing session. It is a numeric field and I'm updating with a number. I just type 1. However, I am getting the error ...
Sarah ally's user avatar
2 votes
1 answer
87 views

Calculating field using expression taken from DataFrame with PyQGIS

The sample data can be downloaded here: https://github.com/jude9apple/sampleData I am using PyQGIS in QGIS 3.36 (in PyCharm) to run a script which reads a table containing which processes apply to ...
Juliette Lapeyre's user avatar
1 vote
1 answer
55 views

QGIS field calculator: grouping incremental values per category2 [closed]

I have a table with some repeated values in a field. Is it possible to assign some order value to the repeated values by creating a new field with values starting at one and consecutive integers for ...
david's user avatar
  • 113
0 votes
0 answers
17 views

QGIS: Field Calculator number line segments grouped by street [duplicate]

In QGIS I have a line layer of Streets that are made up of about 1900 segments. Using the field calculator I would like to create a new column that contains a sequential number grouped by the street ...
Gregory C's user avatar
  • 413
1 vote
1 answer
39 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
1 answer
31 views

Field Calculating ArcGIS Online

I would like to add the same value to an entire column of an ArcGIS Online hosted feature layer. ArcGIS Pro will not allow me to field calculate a hosted feature layer. What are my alternatives?
Bear's user avatar
  • 23
2 votes
1 answer
131 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 ...
Nelg's user avatar
  • 175
1 vote
1 answer
56 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 ...
Simon Iversen's user avatar
0 votes
0 answers
51 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 ...
Setophaga's user avatar
2 votes
1 answer
75 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 ...
Denis Crîlov's user avatar
0 votes
1 answer
49 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 ...
R. Ian Cunningham's user avatar
-1 votes
3 answers
64 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 ...
Maggie Perry's user avatar
0 votes
0 answers
26 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....
Victor Diniz's user avatar
2 votes
2 answers
153 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
0 votes
1 answer
69 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 ...
Luma's user avatar
  • 3
4 votes
2 answers
384 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
1 vote
0 answers
38 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&...
P Dreyer's user avatar
  • 145
4 votes
1 answer
260 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 ...
Denis Crîlov's user avatar
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 ...
dmasana's user avatar
  • 63
2 votes
1 answer
86 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 ...
Zuchiatti's user avatar
3 votes
0 answers
56 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 ...
Nil Aspinall's user avatar
3 votes
2 answers
141 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 ...
Denis Crîlov's user avatar
0 votes
1 answer
140 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 ...
user237830's user avatar
0 votes
0 answers
40 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). ...
Justin Perry Illustrator's user avatar
1 vote
1 answer
46 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 ...
kibi25's user avatar
  • 11
4 votes
2 answers
320 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 ...
Redowan Sakib's user avatar
1 vote
1 answer
30 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 ...
jimbybob1's user avatar
0 votes
1 answer
37 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 ...
user237350's user avatar
1 vote
1 answer
57 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 ...
redhat's user avatar
  • 347
3 votes
1 answer
154 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 ...
Gregory C's user avatar
  • 413
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 ...
Ryan Stephenson's user avatar
1 vote
1 answer
79 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 ...
Matt's user avatar
  • 11
1 vote
1 answer
46 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 ...
Oriol Baena Crespo's user avatar
3 votes
1 answer
76 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.5k
1 vote
1 answer
69 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 ...
John Smith's user avatar
3 votes
2 answers
248 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 ...
Oriol Baena Crespo's user avatar
4 votes
1 answer
97 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, ...
ConfusedButterfly's user avatar
2 votes
1 answer
104 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 ...
Denis Crîlov's user avatar
1 vote
0 answers
48 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 (...
Pcoombs's user avatar
  • 11

1
2 3 4 5
51