Field calculators (available in QGIS, ArcGIS Desktop, etc) can recalculate the values of a single field on all, or selected, records within a table using an expression.

learn more… | top users | synonyms (1)

-1
votes
0answers
17 views

how to use any tools in Calculator for GIS [on hold]

I want to learn how to use any tools in Calculator for GIS. I know use to +/*- but i cant use to such as ( Sin, Tan ) and alle tools.. Can you hellp me?
1
vote
3answers
75 views

Lists in field calculator in ArcMap?

Would anyone please indicate to me why this is not working. I am trying to convert all instances of '02ND' to '2ND' for example where some of the input fields (f1) are already converted and some are ...
1
vote
1answer
34 views

How to calculate azimuth in QGIS field calculator?

Is there any way to calculate the azimuth of two points in the QGIS field calculator? The coordinates are stored in an attribute table. x1 | y1 | x2 | y2
1
vote
1answer
30 views

How do I move the last two characters of a column within the attribute table to another column?

I have data in a column that looks like the below example: El Monte CA I need to move the last 2 characters to a separate column. Which function in the field calculator will deliver those results?
1
vote
1answer
13 views

How to add the values of a common field to a field during union

If I have say 3 overlay features; A,B,C each has a field called FIELD_ID If I do a union, I will get 3 new fields in the output: FIELD_ID_1, FIELD_ID_2, FIELD_ID_3 But how do I get just one ...
0
votes
2answers
67 views

Using Python to field calculate Lat/Long with decimal degrees rather than meters

The below is a snippet of a python script that I am writing that basically adds two fields - Latitude and Longitude, then calculates them. I could use the Add XY Tool which gets me to the same point. ...
1
vote
0answers
32 views

Using ModelBuilder or Python parser of Field Calculator to check values between two datasets?

I have a *.dbf that I need to check values against for a shapefile. I need to report whether the values match the dbf in the shapefile and, if not, what the value should have been (in two new ...
0
votes
1answer
30 views

Calculate field value based on lat long. Have longitude values which are negative?

Very new to python, fairly experienced with ArcMap. I am trying to create an alphanumeric index based on point locations My code string for the numeric part is here: def calc(!LONG_x!): if ...
1
vote
1answer
44 views

Calculating a z value in python

I have some contours where the z value is stored in the geometry and I want to display it as an attribute. I want to include this in a python script. I have an expression which does this in python ...
0
votes
0answers
29 views

How can I convert Decimal to DMS for QGIS reprojection?

I have the following Lat/Long which I converted to DMS using the following calculator: Decimal DMS -96.2 96 12 0 -95.13 95 7 47.9994 29.3 29 18 0 29.98 29 58 55.1994 ...
0
votes
1answer
24 views

different data types in ArcMap field calculator?

I would like to run the following pre logic code in the Arcmap field calculator: def calc(f, fn, f1, f1n) f= str(f) f1 = str(f1) f = f.replace(" ", "") fn = fn.replace(" ", "") f1 = f1.replace(" ...
0
votes
0answers
36 views

simple if statement in ArcMap field calculator

I have two fields containing string variables. The first one is f and the second one is f1. I would like to create a new field and populate it with the following: if f1 is equal to f, return f1 if ...
2
votes
0answers
33 views

Creating a weighted rating model/script for vector data

I'm using ArcMap and trying to create a model or script that can rate routes based on a weighted calculation of attributes. Right now the individual attributes don't have rating values which I could ...
1
vote
1answer
43 views

How to search for a specific field and then use it in Field Calculator

I have a piece of code where the goal is to search through the field names within a feature, select any field based on a specific character (in this case "z") and then use that selected field within a ...
5
votes
2answers
107 views

How to calculate with time values in QGIS?

I have two string fields in a vector layer, "From" and "To", with values in the format of 10:16:30 and 10:18:00 e.g. I would like to calculate the difference in minutes as a decimal value, in this ...
3
votes
2answers
69 views

Which python function should I use to populate a string field based on a numeric value from a numeric field in ArcGIS Field Calculator

I am new to Python and I'm trying to write a simple if then statement in Field Calculator in ArcGIS 10.2.2 that will take the values from a numeric field and add them to a string field. I can't ...
4
votes
1answer
89 views

Replacing multiples words using field calculator in attribute table python

I need to replace multiple words with one word in a field at one time in one script. Example in my LettersField I need to replace all the "Aa" and all the "Bb" and all the "Cc" with "Rr". I am ...
0
votes
2answers
44 views

Using python string wild cards within the field calculator ArcGIS 10.3.1

I have two fields. One field has an ID. The other field has a list of ID's. Using the Field Calculator I with to calculate 1 or 0 if either field contain the same ID number. I was successful at ...
1
vote
3answers
79 views

Autopopulating text field with string and number combination

I have an attribute table with a text field which indicates a unique identifier for each row. The identifier includes a combination of text and numbers, sequentially increasing, as follows: ...
2
votes
1answer
74 views

Why is arcpy.CalculateField_management() writing 1899-12-30 00:00:00 instead of expected date?

I'm using ArcGIS 10.3.1 for Desktop to test before writing an answer to How to enter date with arcpy.GetParameterAsText with arcpy? I have written the test code below that I am running against a test ...
0
votes
1answer
48 views

Using If Statements in ArcGIS Calculate Field?

I've never used Python scripting before and can't seem to figure out how to use an If statement in the Field Calculator tool. I have a field called 'MAX_GRIDCODE' which returns the highest force a ...
0
votes
1answer
58 views

Create a Loop for Arcpy

I am looking for help to write a loop a arcpy.CalculateField_maagement process where the User is asked with the 'raw_input', prior to the tool running "Do you need to change a field value(yes/no):", ...
0
votes
1answer
54 views

Unique ID script field calculator

I need to generate a unique id using field calculator in ArcMap. I am a student and I am having problems finding the script or getting auto increment to work or anything else.
2
votes
1answer
42 views

How can I copy non-blank values to a new column from different columns in the same layer in QGIS?

My data: n1 n2 n3 NEW_COLUMN 11 null null null 33 null null null 55 My desired result: n1 n2 n3 NEW_COLUMN 11 null null 11 null 33 null 33 null null 55 ...
0
votes
1answer
36 views

find all the null records for all fields in a shape file

I figured out that I can use field calculator on a single column in arcgis 10.3 attribute window as follows: def RemoveNULL(x): if x is None: return '' elif x == '': return ...
0
votes
0answers
17 views

How to create new field using the values of one attribute column multiplied by a constant number in Qgis or ArcGIS [duplicate]

I have point data that has a small length attribute - I want to times this length attribute by a constant number (I need to trial a few different constants) to find the diameter of a protection zone ...
1
vote
1answer
46 views

How do I Calculate Grouped Percentiles or Batch percentiles in ArcMap?

My question is similar to this one which was answered successfully: Calculating Percentiles in ArcMap? My addition is how do I batch this solution for multiple files or apply a group-by feature to ...
0
votes
2answers
68 views

Remove first seven characters from field string using Field Calculator

I wrote an expression/codeblock that removes the words "Nearby:" from the field value string if it has it. Codeblock: import string def splitme(s): if s[:7] == "Nearby:": aList = ...
1
vote
1answer
29 views

VB Script case statment syntax for the field calculator in ArcGIS 10.2?

Can anybody help me with this VB Script code for the field calculator in ArcGIS 10.2? Why in the final result are all the values 10? a= 10 Select Case UCase( [PRIORITY] ) Case "AUX 1": a = 22.5 ...
0
votes
2answers
51 views

Calculate field in modelbuilder

If vb code is also possible I could give that a try aswell.
8
votes
2answers
296 views

How to refer to another layer in the field calculator?

Is there a way to select an attribute from a polygon layer and insert the value into a virtual field of a point layer using "within" in the field calculator? CASE WHEN within($geometry, ...
2
votes
1answer
27 views

Alphabetical Sort within a Record

I am performing a union on a polygon feature class with multiple overlapping polygons. Each of the records in the resulting feature class can be thought of as "unique area" polygons made up of the ...
2
votes
3answers
140 views

Using .len() in IF THEN statement in ArcMap field calculator

I have a string field with values of varying lengths (1-4). I need each value to have a length of 5 characters by adding zeros to the value until the length equals 5. For example: 123 needs to ...
3
votes
1answer
47 views

add text value to attributes

this is a novice question I have an attribute field that's missing a piece of information, i'd like to amend the attribute field like below: This is the current attribute field: "V:\Building & ...
1
vote
0answers
42 views

If then statement in model builder

I have a model that adds several fields, two which are manual inputs (County Name and User). I am manipulating several parcel layers (approx 90 counties). In my model, one field takes the state and ...
1
vote
0answers
25 views

Forcing area calculation into miles in QGIS (without changing the PCS) [duplicate]

I'm working on an assignment that requires me to create an area column in miles without changing the projected coordinate system. ArcGIS has a tool that can do this ('Calculate Geometry')-- does QGIS ...
1
vote
1answer
54 views

If/then python for classifying existing field values to a new field

I'd like to have a tool or quick python script to classify an existing number field to a new text field. For example I have a roads layer that has a type identifier as a coded number and I would like ...
0
votes
0answers
22 views

x and y coordinates will only display [x],[y] when field calculator is used to make a url

The standard formula for a google maps url is: https://www.google.com/maps/@-15.623037,18.388672,8z https://www.google.com/maps/@(latitude),(longitude),(zoom level)z I am trying to make a new ...
0
votes
0answers
11 views

Problems with rasterization through QGIS Modeler

My goal is to rasterize a vector polygon-based shapefile. Whenever I run in the modeler or even from the Processing Toolbox the Rasterize tool of GDAL, I receive a raster layer that's not good for ...
1
vote
1answer
40 views

How to delete char in table attribute in QGIS 2.6.1

I need to label many items but in the table attribute field there are some char (#F) for every item that I have to delete. The length of the description are not always the same. I create a new field ...
3
votes
1answer
55 views

Add comma to number labels, multiple records in attribute table

A QGIS question: How can I insert commas in 4 digit numbers in an attribute table that has multiple records, with some numbers that are only in the hundreds? It's for an animation so multiple labels ...
1
vote
1answer
38 views

extract substring after first number

Suppose I have a field titled NAME1. Examples of what is in the field appear like this: Fox Lake 1 WABASCA 166 TSU TUE 196G YELLOW QUILL I.R. 90-8 POUNDMAKER INDIAN RESERVE NO. 114-17 CROSS LAKE ...
1
vote
1answer
37 views

Using Advanced Python Calculator in QGIS Modeler

I'm trying to create a column with integer values based on a small function that basically uses conditional statements. In short, a reclassification. My attempt below: def getValue(Etat): if Etat ...
3
votes
5answers
303 views

Easy way to sum up a lot of values?

I've got a shapefile that was made by the mother of all Unions. Because of that, it's got about 400 columns, and I want to sum about 100 of them (specifically, the "Score" from each). Is there an ...
1
vote
1answer
50 views

Conditional Statements in Arc Map 10 (field Calculator)

I'm attempting to calculate the values of a field based on IF THEN statements in ArcMap 10 (in field calculator) but I haven't succeeded yet on that. What I want to add is the following expression: ...
1
vote
1answer
57 views

CalculateField with variables

I'm trying to make a python script on arcmap 10.2.2 which will copy values from an old field (selected by the user) and paste them in an new field (named by the user). I wrote that: fc = ...
2
votes
1answer
67 views

Calculating Sinuosity Using ArcGIS Field Calculator

Trying to calculate sinuosity via Field Calculator (ArcGIS v 10.2.2); VBA Pre-Logic Script Code: Dim dblLe as double Dim dblLf as double Dim dblS as double Dim pCurve as Icurve Dim pFPoint as IPoint ...
0
votes
1answer
55 views

Counting Features to Calculate Field Value

Generally, I am trying to find the # of features in one shapefile within 1000 feet of EACH feature in a second shapefile - and then populate a field in the first shapefile with that #. More ...
2
votes
3answers
77 views

Creating Conditional Statement in QGIS Field Calculator

I've looked up some of the other threads on this topic, however, none have addressed what I am seeking to do. Essentially I have a large data set and I would like to search one field for any values ...
-5
votes
1answer
41 views

Field calculator with next() function? [closed]

I want to do calculate with script, field - field.next () with incrementation of 2 rows