The Field calculator in ArcGIS-related products can recalculate the values of a single field on all or selected records within a table based on a symbolic expression in a programming language.
5
votes
2answers
202 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
450 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
210 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 ...
2
votes
1answer
650 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
540 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
376 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 ...
5
votes
1answer
446 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
111 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 ...
1
vote
1answer
675 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
353 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
313 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
120 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
1k 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
213 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
755 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
289 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 ...
3
votes
1answer
158 views
Is there a (better) way to debug Visual Basic Code Block in calculate field using ArcGIS?
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
354 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
148 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
782 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 ...
6
votes
2answers
569 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
309 views
How to auto populate multiple fields in attribute table?
i have Feature Class Buildings, it has many fields like ...
1
vote
2answers
775 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
432 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
239 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
253 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
83 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
1
vote
1answer
139 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
328 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
317 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
734 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
688 views
Update NULL values MDB table
How do you update NULL values within mdb geodatabase table using ArcGIS Field Calculator (service pack 4) without changing other values to NULL? I've tried the suggestions on this previous question:
...
1
vote
3answers
207 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 ...
14
votes
6answers
3k 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
446 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
371 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
250 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
526 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
567 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
238 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
472 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
970 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
422 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 = ...
2
votes
2answers
755 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
324 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
393 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 = ...
5
votes
2answers
336 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
293 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
154 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 ...
1
vote
1answer
163 views
Small issue with field calculator
What am I doing wrong in this field calculator logic?
Pre-logic
def re_score(elev_t,f2, contour):
f2=contour
if elev_t.endswith('.5'):
f2 = "Midi"
return f2
Expression for field "Contourtyp"
...
