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

2
votes
2answers
483 views

Field calculator or update cursor?

I have a feature class in which one field (let's call it "Field_A"), as yet empty, is to be populated by the contents of another field ("Field_B") multiplied by a certain number (I'll call it the ...
1
vote
1answer
75 views

How to fill inn A, B, C …Y, Z, A, B, …Y, Z, A, B, and so on? [duplicate]

as a second part of a problem i am trying to solve. I need help to figure out how to fill in serial letters.. Starting at A.. going to Z and starting over at A again.. I have a tabel with numbers ...
5
votes
4answers
669 views

How do I fill in serial letters (AA, AB,AC…,BA,BB,BC…ZZ) to a shape?

(I am using ArcGIS software, ArcMap...) MY PROBLEM I have a shape file containing points. The shape file contains 3 columns named FID, Shape* and Label. In the column I want to fill in AA, AB, ...
0
votes
1answer
646 views

How to calculate polygon areas in acres or square miles instead of feet?

I have a layer in State Plane NAD83. When I use "Vector|Geometry Tools|Add/export geometry columns" or Field Calculator they both create the area in feet. What if I want acres or square miles? Thanks ...
6
votes
3answers
2k views

How to replace non-English characters in attribute tables using Python?

I have a few shapefiles where some of the attributes contain the non-English characters ÅÄÖ. Since some queries doesn't work with these characters (specifically ChangeDetector), I tried to change them ...
1
vote
2answers
129 views

How to get a string from a Double with a fixed number of decimals?

I have a featureclass (in a File Geodatabase), with a particular field of type Double. I want to copy it over to a text field, so that only 3 decimal places are shown. For example: 34.78902345 ...
2
votes
2answers
235 views

Capitalizing The First Letter Of Each Word In Attribute Field

Does anyone know of a way to capitalize the first letter of each word in a field in an attribute table? I am doing this in QGIS. I know of field calculations to change all the words to Lower or ...
0
votes
0answers
29 views

Exporting QGIS attribute table to excel [duplicate]

I have a million rows in the attribute table, with lat/lon columns that I want to export to Excel. Selecting all the rows causes QGIS to crash. Is there another way to do the export? The million rows ...
1
vote
1answer
528 views

How do you calculate a column value based on the value of another column?

I am trying to select data based on whether it starts with certain characters and then update a field. For example if [Asbuilt] starts with "WL" then do something. Here are the two methods I have ...
6
votes
1answer
4k views

Calculate area within Python script in Arcmap

I am trying to calculate the area of a polygon within my Python script. I create a new polygon from merging two together, and I'd like to add the area of the resulting polygon to a field in the output ...
1
vote
2answers
376 views

area values determined with field calculator become null when saving

using field calculator in Qgis 1.8.0 to get the area, it shows just right at first but when I save it, the values become Null. help please
3
votes
4answers
1k views

Why does Field Calculator return 0 values when decimals are expected?

I realize I posed this question, and got answers, several days ago (see (Field calculator error)) , but none seem to really be working, and so am posing again. Below are two screenshots that show the ...
3
votes
0answers
289 views

Field calculator error [duplicate]

NOTE: This problem is similar to one that was answered here: Why does Field Calculator return 0 values when decimals are expected? I'm relatively new to python, and am trying to run a simple field ...
3
votes
2answers
368 views

QGIS Field Calculator Results Removed When Saving Edits

Mac OSX 10.6.8 QGIS 1.8.0 : Using the field calculator from the attribute table, the $area of each feature is shown nicely in the table until I try to save it, then all the values are replaced by NULL ...
0
votes
0answers
60 views

Replace Null Values Field Calculator [duplicate]

I am using ArcGIS 10 and have a polygon shapefile in which many of the numeric fields are Null. The polygon shapefile in question is produced by joining a polygon shapefile with a point shapefile and ...
2
votes
1answer
372 views

Am I over-complicating adding and then calculating fields? Suggestions for a better way? (Python)

I'm attempting to re-position a question I asked yesterday here. I am starting to think that the way I wrote my code just isn't the best way. Am I overcomplicating things? I know for a fact that ...
2
votes
1answer
917 views

Incorrect field name resulted in RuntimeError: ERROR 999999 (Also, better code for adding and calculating fields)

This is the bottom half of my code (and it's been edited somewhat to share publicly). The code works perfectly fine when the fieldList has only three fields in it, but when I populate it with all 108 ...
2
votes
1answer
263 views

Calculate field result is float with Arc tool, integer with arcpy script

I am trying to calculate a field for some points within a python script using arcpy functions. (This is calculating the percentage visibility from a cumulative viewshed, if that matters.) # Process: ...
0
votes
5answers
2k views

Changing null value to specific numbers in ArcGIS for Desktop? [closed]

I have a Excel file showing annual precipitation and I add it on arcmap. When I tried to check it's attribute table the field calculator is passive. I want to change all the Null value to specific ...
3
votes
2answers
237 views

How to create a label formatted like “ 1,000' ” from a numeric field?

This question builds on a previous question I came across at gis.stackexchange: How to easily edit attribute data using Regular Expressions? Perhaps someone can point me in the right direction? I ...
0
votes
0answers
26 views

I need to add one table to another table as strings.

But all of this two table data is numeric. And one of them is float. So I need to add from the float table only integer and merge it with other table. What to write in field calculator?
0
votes
0answers
374 views

How can I get shape filename in attribute field using field calculator with VBA?

I want to store ths shapefile name in an attribute field using the field calculator and visual, but can't find the way to do it. Can anyone help me, please? Thanks!!!
3
votes
1answer
1k views

Using the Field Calculator in a Domain field

I have a coded domain field with 10 dropdown options. Possible choices include integers and text. I need to change a selection of 250 features (which have differing values) to the same value. This ...
1
vote
1answer
1k views

Delete first two letters from a string field

I'm looking for a field calculator python statement to delete only the first two letters of string entries. For Ex: !Name!.strip([0:2]) I know this syntax is incorrect. Thanks a lot
0
votes
0answers
67 views

How to populate polygon extents to an attribute table in QGIS

Is there a way to calculate the XMIN, YMIN, XMAX and YMAX of a polygon and write it to a field in an attribute table? The Geometry functions available in the Field Calculator are for points. ...
2
votes
1answer
211 views

Mysterious Invalid Syntax in Field Calculation

I'm trying to calculate a field in Model Builder using the Calculate Field tool. I'm using the following code block and expression in the calculation, but am getting an "invalid syntax (, line 1)" ...
4
votes
2answers
480 views

Field Calculator decimal places - how can I limit them?

I've added a new column to an attribute table and performed an operation with the field calculator to populate the new column. The result is a column with a percentage. My problem isn't major but I ...
0
votes
3answers
420 views

How can I easily detect gaps in a polyline using arcmap 10.0 (arcview license)?

I'm making routes by selecting links from a streets layer which I export as a new temporarely layer in arcmap 10. This layer which I call route_temp unfortunately can be very long and contain gaps, ...
2
votes
2answers
463 views

Type mismatch error in Calculate Field tool in ArcGIS 10.1

I'm trying to run a rather lengthy model (built in ArcGIS 9.3.1) in ArcGIS 10.1 and I'm recieving an error on a Calculate Field tool. The error is - Type mismatch: 'iif'. This error is refering to ...
5
votes
1answer
288 views

How to add attributes in proportion to intersecting area from another layer

I am new to using QGIS. I have two polygon layers: Voronoi of Access Points Census block maps with population I want to get number of people covered by each Access Point (Assuming uniform ...
2
votes
1answer
109 views

Syntax question for ArcGIS ICalculator object

This is a silly question, but I have this code snippet that I can't figure out: 'Define a calculator for NewArea field pCalculator = New Calculator With pCalculator .Cursor = pCursor ...
1
vote
1answer
548 views

Using Python if/then/else to return value from either of two fields based on value of third using ArcGIS Field Calculator?

I'm trying to avoid manually inputting Begin and End engineering station values already inputted into a seperate field. I'm dealing with(4) fields: Begin_Sta End_Sta Beg_End and Station. The ...
4
votes
2answers
189 views

ArcMap: Calculate Quarter using Date field

I am using ArcMap 10.0 and making a map where I symbolize on annual quarter (i.e. Q1 2013, Q2 2013, and so on by quarter through 2015). If a date field contains this: 01/15/2013, and I wanted to ...
-1
votes
1answer
229 views

Field Calculator Does not Work in Arc10

I'm having a problem, described below, with Field Calculator in ArcGIS 10. I wonder if there is a known fix at this point. I'm updating to 10.1 soon, but this work cannot wait until then. Details: ...
0
votes
1answer
299 views

Add sequence numbering based on attributes in a table [duplicate]

Is there a way to auto populate a sequence of numbers based on another attribute in a table? For example, if field "Name" has a sequence of numbers from 1 to 10, and I want to number all the rows in ...
2
votes
1answer
594 views

Using Python in the Field Calculator, how do I refer to a field in another shapefile?

I want to compare the changes in geometry between two shapefiles (of election districts in NYC. One is from 2001 and the other 2005). I am attempting to calculate a new field in the 2005 shapefile ...
3
votes
1answer
2k views

Using Python to Calculate a field

I am trying to replace values in a single column using an else if statement, but I keep getting an Syntax error in line 2. I'm new to Python so it's probably an easy solution, but I haven't been able ...
5
votes
2answers
158 views

Using field calculator to delete specific contours

I have 3 contour shapefiles with 25m, 50m and 100m equidistance. Now I want to delete in the 25m-shp-file every **50m and **00m contour and in the 50m-shp-file every **00 contour. How can I show them ...
3
votes
3answers
845 views

Auto-calculate field (area or formula)

I'm wondering if anyone has any insight into the potential to auto-calculate the value of a field, either area or distance (ideally) or a formula (based on the values of say 2 other fields, or an ...
4
votes
3answers
770 views

How to insert a quotation mark through the Field Calculator of attribute table of a Shapefile?

I have a shapefile of polylines with information of diameter. But the problem is that i didn't enter the inch sign(") with the values of diameter. What would be the solution that qutation mark would ...
1
vote
1answer
916 views

How to use field calculator for area calculations in QGis? [duplicate]

Possible Duplicate: Calculate area between contour lines on a DEM with Qgis 1.8.0-Lisboa Based on a DEM of a whole country I have reclassified altitudinal bands with steps of 100 metres ...
8
votes
8answers
7k views

How to Remove return/newline (\n) character from Field using Python and Field Calculator?

I have a geodatabase table with a field that I'm trying to remove return characters (new line). I found this post (How can I remove (chomp) a newline in Python?) of how to do it, however it is not ...
2
votes
1answer
1k views

QGIS field-calculator replace function

I've got a Shapefile containing contourlines which I would like to style differently according to their value. For that reason I created a field named "100s" where I would like to give values from ...
0
votes
1answer
156 views

FieldPyculator Plugin - How to concatenate fields?

How can i concatenate two fields using pyculator plugin? There is any document with all pyculator functions that i can use in "field expression"?
3
votes
3answers
496 views

How to make Field Value constant size(length) by appending zeros towards the end?

I have been racking my brain, but I can't seem to find a solution to appending my field values in my .dbf to correspond with the values of my feature's attribute table. All I need to do is to append ...
4
votes
1answer
4k views

How to do a simple find and replace in QGIS field calculator?

I'm trying to replace selected string values in an attribute table, eg. "Text1" for "Text2" (QGIS 1.8.0), patriculary for those rows with NULL values. I have been trying to use the replace expression ...
4
votes
4answers
2k views

How to concatenate numbers and add in leading zeros?

I have three text fields populated as follows: 1, 9, 1 that I need to concatenate into a field that looks like 01.09.01. Getting to 1.9.1 is easy but can anyone help out with how to formulate it so ...
4
votes
1answer
677 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
613 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 ...