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)

0
votes
1answer
33 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
49 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
43 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
33 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
32 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
15 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
37 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
59 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
27 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
48 views

Calculate field in modelbuilder

If vb code is also possible I could give that a try aswell.
7
votes
1answer
239 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
23 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
117 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
45 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
40 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
51 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 ...
-1
votes
1answer
30 views

Transferring Attributes on the Same Layer [closed]

How can I copy the values of one field in an attribute table into another field in the same attribute table?
0
votes
0answers
21 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
6 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
32 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
46 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
32 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
34 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
291 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
46 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
53 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
62 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
53 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
55 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
40 views

Field calculator with next() function? [closed]

I want to do calculate with script, field - field.next () with incrementation of 2 rows
2
votes
1answer
61 views

Replace Expression in Field Calculator to include a Numeric Range

There has to be an easier way to clean up address data, I hope? GeoCoding, I need to remove APT# and any number or letter that follows.
1
vote
1answer
58 views

delete a space with the field caculator

I would like to delete the space in this number like this 'F00 089' with the field-calculator. Is theres a function in the field-calculator? ! see my screenshot
1
vote
1answer
53 views

Field Calculation Python acceleration of gravity [closed]

In my problem i have a column DISTANCE and a column TIME and i want to calculate with python in field calculator how much time it needs to make that distance (for example 1000m) if you are moving with ...
0
votes
0answers
13 views

Populate field by numbering different types of roads using field calculator [duplicate]

I am trying to populate the Func_class field by numbering each type of road in my attribute table. I have different road types such as 'secondary road','local road','main road' see picture etc I ...
1
vote
2answers
55 views

Split a string between 2 characters

I have the following string in Arcmap: "Node 1_1234.23,Node 2_567.88,Node 3_45.25" I want to return the numbers between the "_" and the "," into three columns e.g "1234.23" in column A ...
1
vote
1answer
62 views

Create new attribute ranking polygons by size in QGIS

I'd like to create a new field in the attribute table which gives the rank of the polygon by size. For example, the polygon of the largest size would be rank 1 and the smallest rank N. I was hoping ...
1
vote
2answers
58 views

How to generate random points from FIDs using ArcPy or ArcGIS Field Calculator?

I'm trying to generate a shapefile of random points using FID from the attribute table. My attribute table has 800,000 features and I only need a sample of 240. Is there a way to do it in arcpy or in ...
1
vote
1answer
56 views

Add and Calculate Field in Table with ArcPy?

I have written the following script to iterate it as a tool for all my tables with ModelBuilder, but i have a problem wth my codeblock. I want to add a field FID to all my tables and to add the values ...
3
votes
2answers
102 views

Field Calculator Script

I am looking to check how up-to-date a feature class is by using our latest parcel update. I am wanting to check "owner" field with "Owner_1"...I am using field calculator to grab the last name in ...
0
votes
0answers
26 views

Creating a field calculator function that can cast string to a percentage value in a related field?

I am having issues trying to create a field calculator function based on a coded domain string parameter combined with a numeric field to obtain a percentage output. The example in question is as ...
1
vote
1answer
105 views

Area is calculating wrong using $area in field calculator (QGIS 2.8.1-Wien)

There is a similar question posted, but the solution to it seems to be that polygons were multipart: Wrong $area from field calculator (QGIS) In my case, all polygons are singlepart. I have several ...
2
votes
3answers
97 views

VBScript - If/Then Statement - Field Calculator

I am trying to do a simple (or so I thought) if/then statement in the ArcGIS field calculator. I am trying to add the HydroCode field - hydologic soil codes - to an existing data set. I know what the ...
1
vote
1answer
43 views

Update all cells in column to match value of first row?

I have a point layer; the attribute table includes x and y coordinates of original centroids associated with the points (the points were generated from the perimeters of circle features and still ...
1
vote
2answers
46 views

How to update a bulk selection of fields using field calculator in QGIS 2.8.1

I have an attribute table showing vegetation communities. The table has three columns ("ID", "Veg Comm" and "Area_ha". Instead of having to copy and paste text after each polygon created into each ...
1
vote
2answers
50 views

Error msg “Name is not defined” when trying to populate a field with the shape file name

I am trying to populate a field with corresponding file name. For example, if the file name is Route1.shp then the field value will be Route1 as well. However my code is not working. Can you please ...
1
vote
3answers
52 views

Generate a string based on an integer range

After some initial research, I was unable to find a solution for the following issue. I'm sure there's an answer to this question already floating around here somewhere, but hopefully someone can give ...
0
votes
2answers
83 views

ArcGIS Python if statements say field not nullable?

I am creating a new field - let's call it A (SHORT INTEGER) in shp file using Modelbuilder and I need to fill it it with the values from two different fields. First step is to fill field A with the ...
1
vote
1answer
63 views

How to use QGIS field calculator between different points of same layer?

I'm in a course learning about GIS systems, and we have recently recorded a gps track. I've exported this track as .gpx and imported the points into QGIS. Each point has a timestamp. One of the ...
3
votes
0answers
59 views

Field Calculator convert text to integer then populate new field with sum [closed]

I have a .dbf with about 50 text fields containing numerals, I would like to convert those to integers and then sum them all in a new double field I created, is there an easy field calculation that ...