Field calculators (which are available in QGIS, ArcGIS-related products, etc.) can recalculate the values of a single field, on all, or selected records within a table based on a symbolic expression.

learn more… | top users | synonyms

4
votes
1answer
681 views

Unit of $length in QGis Field Calculator

I'm calculating field of various features in my shapefile using QGis. I'm getting some sample length as 0.134914579766986. I want to know in what unit (eg: meters, km etc) is the above value ?
5
votes
2answers
621 views

How to add a sequence to the attribute table?

Is there a way to use the field calculator in QGIS to create a range of values in a count sequence with a specified input range? For example, if I wanted to have the values 1 to 5 repeated within my ...
2
votes
1answer
2k views

How to combine If Then with InStr in ArcMap field calculator?

I want to write an if then in field calculator that tests if a field in the attribute table contains one of several versions of another string (the versions vary by capitalization). Trouble is, I ...
0
votes
1answer
725 views

How to use VBA in the field calculator, to copy the last 7 characters to a new field?

Im using ArcMap 9.3. Im looking for a VBA code to use in the field calculator to make a new field of the last 7 digits of a "pin" field. For example. my pin is 00-00-999-999 and i want it to ...
3
votes
1answer
4k views

Elseif Conditional Statement in QGIS Field Calculator

I am trying to write an ELSEIF conditional statement in QGIS Field Calculator (version 1.8.0). I have used an example I found online: CASE WHEN val < 0 THEN 'negative' WHEN val = 0 THEN ...
3
votes
1answer
1k views

How to use field calculator from QGIS Sextante plugin

I am trying to use the Sextante field calculator to calculate a field for a buffer radius using a categorical text field. The formula works fine when I run it using the standard QGIS field calculator ...
2
votes
1answer
639 views

Cursors and Field calculation - Python 2.5 - ArcGis 9.3

I hope my question is not redundant. I wrote a script to Update a table using two imbricate cursors. The goal was 1) to read a records, update some of its values 2) Make a selection based on this ...
6
votes
1answer
2k views

How to measure area correctly?

I have now used my entire evening, but I can't figure out how to make areal calculations (eg. in km2). I have tried the 'field calculator', I have tried the 'measure area' function on the "attributes" ...
1
vote
1answer
148 views

How do you calculate values of a field based on two others using Field Calculator in ArcGIS 10.0?

I need to combine two fields in an attribute table. I want to do this using the field calculator. What is the proper script to write to combine a field called "name" and "type", so that it produces ...
2
votes
1answer
2k views

ArcGIS 10.0 \ arcpy - CalculateField_management : help with syntax for updating text in attribute table of feature classes

I am trying to add (ie "Author", "LastUpdated") to feature classes within a gdb and then populate each of those fields. I have been able to get my code to run properly for the numerical field but I ...
3
votes
3answers
663 views

ArcGIS Field Calculator Python numbering rows of fishnet

I have a grid of 100*100 cells. I want to add to each cell a number representing the row it is in (like in excel). I added a field and want try to solve that with field calculator: The code is ...
4
votes
1answer
691 views

Why can't I multiply two string fields in the Field Calculator by converting them to int() and float()

I'm using ArcGIS 10 and new at python scripting. I have a string field that I need to calculate by multiplying two other string fields. I can do it in python using two arbitrary values... CINPT1 = ...
3
votes
1answer
360 views

Measurement units not returned in project CRS units

I am attempting to calculate area of country polygons using the field calculator. The layer in question is unprojected WGS84, but I have set the project CRS to World Equidistant Cylindrical ...
3
votes
2answers
2k views

using mod() with IF THEN field calculation

I am trying to use the field calculator to assign a "odd" or "even" value to a field of small integers. I usually do this with by selecting where: MOD([field],2) = 0 and then just calculating it ...
2
votes
1answer
672 views

Counting occurrences across a record in ArcGIS 10.0

I'm a student at Millersville University, PA studying for a BA in Geography with a concentration in GIS. I've stumbled across this site for questions I've had over the past year or so with getting ...
1
vote
2answers
3k views

Use Round in ArcMap 10.x Field Calculator on field with both numeric and NULL values

With older versions of ArcMap (9.3, 9.2, etc) I was always able to round numbers down to 2 decimal places using field calculator even if that field had both numeric values and a bunch of NULL values. ...
1
vote
1answer
467 views

How to calculate field as cursor name?

First time dealing with cursor. I have lines intersecting polygons, I want to get a table with all attributes of the lines, add a field and calculate the field as the name of the polygon. I was able ...
4
votes
1answer
271 views

Debugging Visual Basic Code Block in calculate field using ArcGIS Desktop?

From time to time, I have to use Visual Basic in Calculate Field. As the code get bigger, the more complicated is to debug it. And ArcGIS (9.3) does not help as the error messages are, in the best ...
2
votes
2answers
594 views

Trimming Specific Text Values in QGIS Field Calculator

Sorry if this is a dumb question, but I am wondering if there is a way to copy the text from one field to a new field, but eliminate specific words. For example: **Old Field** ...
1
vote
0answers
228 views

How to calculate column average in Arcmap using VBA [closed]

I'm really new in gis and programming... So could anyone write VBA code for counting average. For example I have 3 columns which are named as JAN, FEB, MART...Each of them have 50 values in column. ...
5
votes
2answers
2k views

ArcGIS 10 Field Calculator doesn't notice selection/Attribute Table problem?

I just have an annoying problem with the Field Calculator in ArcGIS 10. I selected specific points of a Shapefile I want to calculate, but FC is always calculating all fields. Unfortunately there is ...
7
votes
3answers
2k views

Calculating Field based on name of shapefile

I have multiple shapefiles to which I have added a field called "gname1". For each shapefile, I want "gname1" to be set to the name of that particular shapefile, for every feature within the ...
0
votes
2answers
818 views

How to auto populate multiple fields in attribute table?

i have Feature Class Buildings, it has many fields like ...
1
vote
2answers
1k views

ArcGIS field calculator: VBScript get data from previous row

When using the field calculator, how do I get data from the previous row in VBScript? In Python I'd do something like this: for index, row in enumerate(rows,start=1): row[index-1] += 5 I'm ...
2
votes
2answers
825 views

FIeld calculator gives integer not a real as requested

Two fields "population" and "F06_popula" (both integers) were used in calculating a new field pct-diff. I asked that the new field be a decimal with a width of 10 and precision of 3. The result has ...
2
votes
1answer
481 views

Field Calculate Degree Minute Second in Different Format

I have a field that is in degree minutes seconds, populated from ET Geowizards COGO Inverse tool. It populates the values as 90-12-28.15 where 90 is the degree, 12 is the minutes and 28.15 is the ...
3
votes
2answers
440 views

Python find string with two decimal characters

I have two columns in a personal geodatabase table that I'm trying to add up (to a third field) using a python function in field calculator, however some of the string values are not real numbers. ...
1
vote
1answer
92 views

How to import text only out of a string field to a new field

I want to import data out of a string field in my shapefile to a new field for labeling. The string field contains river names and codes and I just want to display the text i.e river names
2
votes
1answer
267 views

How to implent a “maketrans” python function on field calculator

i'm traying to implent python string translate function at field calculatore http://www.tutorialspoint.com/python/string_translate.htm in order to fix hebrew imported from cad. here is the code - def ...
2
votes
1answer
415 views

Field Calculator Runs In IDLE (2.6.5) but not ArcGIS 10 SP3

just wondering if anyone else is having issues with the field calculator in ArcGIS 10 SP3. In the following code I do a pretty simple field calculation with a variable (an array) as one of the ...
2
votes
1answer
457 views

Field Calculator operation is not working

I've done this 100s of times and I can't understand why it won't work! I'm trying to copy the first 8 digits of from a HUC 12 (Hydrologic Unit Code) to a new field, which represents a larger ...
4
votes
2answers
1k views

Field calculation- Arcpy

I am developing a script to calculate the values of two fields (C and D) based on value of field A (It is a Point feature): A C D 0.2 1 1 0.2 1 2 0.2 1 3 0.4 2 1 0.5 3 1 0.5 3 2 So the idea is n ...
0
votes
2answers
2k views

Replacing NULL values in geodatabase table?

How do you update NULL values within a geodatabase table using the ArcGIS Field Calculator (service pack 4) without changing other values to NULL? I've tried the suggestions on this previous ...
1
vote
3answers
520 views

Automatically assign numbers to point file in various order in QGIS

I know how to automatically assign numbers to a new point files using the $rownum function in the field calculator. However it does it from the top-left over and down like reading a book. I could ...
15
votes
6answers
5k views

ArcMap 10.0 Python Field Calculator, Find/Replace Double Quotes

I'm trying to use the Field Calculator (ArcMap (10)) to strip out double quotes in an address field (I didn't put them in there, believe me). I've tried many incantations but am still unable to even ...
1
vote
1answer
964 views

Concatenate Fields into One Field in QGIS

I have seen some posts on this, but only for ArcMap. I am looking to take a range of values from two fields and concatenate them into one field to make a unique value. For example: XMAX YMAX ...
5
votes
1answer
1k views

How to fill my column with consecutive numbers

I m very new to Qgis, so forgive this simple question. Searching in older topics didn t help either.So: I make a new column in my attribute table and it has a default value(for example 0). I want to ...
4
votes
1answer
432 views

How to add attribute data up?

Sorry if this question is too simple/easy for you guys, but I'm still learning QGIS and pretty much teaching myself where I can. Is there a way to add data from 2 columns into one new column inside ...
10
votes
2answers
987 views

How to compute a new attribute based on changes in another attribute?

I am attempting to classify a set of gps time-encoded point data into behaviors based on different attributes. I have created an attribute that is 0 for home and 1 for away based on location, and now ...
5
votes
2answers
1k views

How to find wildcard string using Field Calculator script code?

I'm trying to find part of a text string in the CLASS_NAME field and return a text string to the Abrv_Name field using the Field Calculator in ArcGIS 10 via a Python parser. Here is what I have tried ...
1
vote
2answers
411 views

FieldPyculator Plugin - How to Classify Fields?

Could someone tell me how to classify/populate fields with QGIS FieldPyculator Plugin? In the Attribute Table, I have a field named POPULACAO with population data: I want to apply a weight to ...
2
votes
3answers
803 views

Python and CalculateField

I am having trouble with using Python together with my gp.Calculatefield tool in my python script, and I am not sure why.. Heres the code (UPDATED) import arcgisscripting, os, sys myTempWorkspace = ...
2
votes
2answers
2k views

Multiple input tables for Add Field in ModelBuilder

My model requires field1 to be added to fc1 and fc2, and then calculated according to a Python expression calc1. field2 is then added to fc2, and calculated using calc1. How do I add the multiple ...
3
votes
2answers
802 views

Why is ICalculator.Calculate significantly slower than the CalculateField geoprocessing tool with SDE datasets?

I just discovered today that there are essentially two ways to calculate field values in ArcObjects: 1. Using ESRI.ArcGIS.GeodatabaseUI.ICalculator: ITable table = …; ICursor updateCursor = ...
3
votes
2answers
2k views

Use output of Add Field as input for Calculate Field in ModelBuilder

I have created a simple model in ArcGIS 10 which, after some initial processing of a feature class, outputs outputfc and adds a field to it. Regardless of the feature class input (which the user ...
2
votes
2answers
492 views

Looking for python/VB script to insert a new uniqe field

Is there any phyton/VB script which will add a field to shapefile which will be corresponding to first three characters from the shapefile name ? I am working in modelbuilder and arcgis 10. Thanks ...
3
votes
2answers
598 views

Adding VBA into a Python script generated by ModelBuilder

I have created a model that does a calculate field and have used VBA in the code block. But when I export it to Python, it doesn't work. Here is the VBA code: new_value = ...
6
votes
2answers
574 views

Random value calculation in QGIS

Is there a way to do a random value calculation within a range in QGIS? I have been able to do this within ArcMap Field Calculator with the following code: Dim max, min max=20 min=5 ...
0
votes
1answer
352 views

Python Field Calculation [duplicate]

Possible Duplicate: Iterative position within Field Calculator/Python I need to calculate a field for a data set that is grouped by county. At each change in county I need the column to ...
2
votes
1answer
201 views

Why isn't this Python calculation working correctly?

I want to label the source files for a unified shapefile, and there are three respective columns for each. If there is no value in the column, there is no data from that source; if there is a value in ...