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

1
vote
3answers
146 views

Conditional Statement for attribute data

I'm trying to write a conditional statement that references another field within the same shapefile layer. I want it to only do so if the one field is " Null " and leave is alone if there is already a ...
2
votes
1answer
338 views

How to use Field Calculator to calculate area as percentage?

I am searching for python code to use in Field Calculator to calculate area as a percentage in relation to another field? The area percentage needs be calculated based on the total area for each ...
0
votes
1answer
194 views

Conditional Calculation of a text Field Value Based on antoher text field value ArcGIS10.1 [duplicate]

I Created a new field to explain some zoning codes in an attribute Table. I basically want the new field "Zone" to have a string value based on the field "Zoning" For example if the "Zoning" field ...
2
votes
1answer
136 views

Batch Update Fields in Field Calculator or Model

I have a dataset of block-level census data that I clipped to an Illinois State Senate district. To update the data (e.g. for population) I'm applying an area multiplier, i.e taking the area of each ...
2
votes
1answer
172 views

How to assign values to field using if/then logic involving multiple fields?

I want to run a field calculation on a string field named [territory] that first looks at a string field [majr_src] to see if there is a value other than "NONE", if so [territory] = [majr_src]. If ...
2
votes
3answers
90 views

How to write FIDs of points within each polygon to polygon field?

I have two feature classes one with points one with polygons (in ArcGis 10.2). Now, I want to write into a String Field of the polygon layer a list of all the Point-FIDs that are within each polygon ...
3
votes
1answer
1k views

What expressions for QGIS field-calculator?

I do not understand what language I have to use in field-calculator and labels on QGIS: SQL or Python? And where I can find the possible script/expressions to use? in the image you can see the ...
1
vote
1answer
87 views

How to perform intersect operations in the Field Calculator in QGIS?

How to use the Intersect function? How would I specify to REPLACE layer1.field1 with layer2.field2 WHEN layer1.geometry INTERSECTS layer2.geometry Is that feasible in QGIS?
1
vote
1answer
299 views

How to sum up multiple columns values into one single column

I have one table containing many columns. Using field calculator, I want to create a new column containing (for each line) the sum of all columns values. Pretty dumb, but just cannot find the correct ...
3
votes
1answer
488 views

How to use the field calculator's centroid() Geometry function in qgis 2.0?

There is an option in the field calculator for centroids under geometry which when you double click gives you "centroid( ". What information is required here in order to use this function?
2
votes
2answers
158 views

Correctly calculating attribute table column in gvSIG

I am trying to conduct a multicriteria evaluation, and it is necessary to check the compatibility of two different land-use types that I have in seperate layers. I am working in gvSIG 1.12, and have a ...
2
votes
1answer
145 views

Using Sum() or something similar with CalculateField_management and FieldLists

I need some help with using variables with CalculateField_management tool. I've tried several different scenarios but don't seem to have any luck. What I have is a list of fields containing water ...
8
votes
3answers
2k views

Is there a way to concatenate fields in field calculator of QGIS?

Is there a way to concatenate fields in field calculator of QGIS? (e.g. hectares + ' ha')
0
votes
0answers
172 views

Using Field Calculator to Calculate a Mean for Multiple Rows

I am trying to calculate a mean across a multiple number of attribute rows and have this value added to a new field that I have entered in the attribute table. I have an attribute table which has a ...
1
vote
2answers
156 views

Using a different projection to calculate areas using the Field Calculator

I have a dataset that is in a WGS84_UTM projected coordinate system, can I force the Field Calculator to use another coordinate system when I use it to calculate areas using pythons ...
2
votes
1answer
211 views

How can I refer to a model variable in a Field Calculator or Pyculator formula?

I am new to QGIS 2.0.1 Modeler (Sextante) and not very able in Python programming. My question regard the use of field calculator (or advanced python field calculator) inside the modeler. Is it ...
2
votes
1answer
273 views

Generating sequential numbering for duplicate values in a field sorted by ObjectID

I am trying to figure out a solution to an field calculation problem. What I'm trying to do is automatically (using either ArcPy or the Field Calculator) generate sequential numbers, beginning at 1, ...
1
vote
1answer
90 views

How to correctly use LIKE in the code block of a Reclass expression in ModelBuilder Calculate Field

I have a Reclass expression that works when i am search for single instance of a data field. I also wish the Reclass to work with a SQL type LIKE selection with Wildcards. e.g. I need to reclassify ...
1
vote
1answer
226 views

remove whitespace Python code results in odd character - Field Calculator

I need to remove whitespace from the end of a string in a field in ArcMap. I tried first the VBA function RTrim, but whitespace still remained. I thought maybe the whitespaces were tabs, so I tried ...
2
votes
1answer
335 views

Calculating a field based on two other fields, if they exist [duplicate]

I'm using ModelBuilder to iterate through ~800 shapefiles to add and calculate a new field (I'll call it Field_A). Field_A needs to be populated by either Field_B or Field_C, whichever exists. Half of ...
1
vote
1answer
177 views

How to concatenate XY values in attribute table without messing up the numbers in ArcGIS 10.1?

Here's the procedure I use and the resulting problem I'm having. First I use the Add XY coordinates tool to add POINT_X and POINT_Y fields to the attribute table of a point layer. I then add a new ...
0
votes
0answers
79 views

Import csv file and use “toggle editing” and “field calculator” without Saving it as a Shapefile.

I am importing a .csv file in QGIS and I have also made the *.csvt file where I have specified my data types. I still cannot use "Toggle editing" and "field calculator".Whether I must save it as a ...
4
votes
2answers
149 views

Can Hyperlink be based on two fields for path and file name separately?

I need to create a hyperlink field. I have one field with the file name, and another field that contains only part of the file path (the real path is unknown). The table contains 14,000 records with ...
1
vote
1answer
235 views

Python Field Calc for Document Hyperlink

I am trying to create a script that will hyperlink to a .tiff or .pdf. These files are stored in one folder on a shared server. I want the script to look in a field: 'PLAT_IMAGE', which has the plat ...
0
votes
1answer
117 views

Problem in calculating length

I am Digitizing road line in India using open layer plugin.When I calculate the length of line using field calculator it gives me the result in millimeter . I thought it is the projection problem and ...
3
votes
1answer
415 views

Calculate Field python code has “Expected end of statement” error

I am creating a line shapefile from a csv in a Python (2.7) script. I am assigning an ID field from the csv to a variable and then later using it in the Calculate Field tool. The ID field originally ...
2
votes
3answers
530 views

Python script for identifying duplicate records (follow up)

I am trying to calculate a field that marks duplicates and sequentially numbers them. I am using the code below that I found here: Generating sequential numbering for duplicate values in a field ...
2
votes
3answers
481 views

How to count occurrences of one field grouped by values of another?

Is there a way of calculating the number of unique text strings in a field in ArcGIS 10.1? I have a number of repeated strings in this field, but would like to calculate the number of unique strings ...
2
votes
2answers
50 views

How to flag parcels as being within stop type dependent distance of transit stops?

first question here! I have a parcel layer and a transit stop layer. The transit stop layer has different bus stops, light rail stops, etc. I want to add to my parcel layer attribute table fields ...
2
votes
2answers
225 views

Can anyone tell me why my field calculator is returning this error?

All I am trying to do is pull into a text field, a section of another text field via: fieldB = !fieldA![some_index:other_index] However I keep receiving the error below and I can't figure out why. ...
2
votes
2answers
785 views

Use Feature Class “Name” from Iterate Feature Classes to Calculate Field with Model Builder 10.1

My goal is to create shapefile that contains merged feature classes from a geodatabase. I would like for there to be a new field in the resulting shapefile that contains the name of the original ...
5
votes
2answers
180 views

Field calculator script to work out first 5 dominant area fields?

I have 5 fields of different landcover types with areas of each and found below: > PRC_Water| PRC_Bare| PRC_Urban| PRC_LVeg| PRC_LVeg| > 5 20 40 20 15 I have ...
1
vote
1answer
476 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 ...
1
vote
0answers
618 views

Using multiple fields for a Reclass calculation in ArcGIS Field Calculator [closed]

I am trying to create a dummy variable from an existing dataset using ArcGIS's Field Calculator tool with a Python script. My conditions require the use of multiple fields to determine the output ...
1
vote
2answers
117 views

Creating a new integer field based on text in a different field - ArcGIS 10.1

I need to create a new integer field based on another text field. All instances of a the same text string in the existing field should be assigned the same number (starting at number 1). Can I do this ...
1
vote
2answers
262 views

How to use centroid option in Field Calculator in QGis

I want to use Centroid option in field calculator in QGis .How to access it?
1
vote
1answer
144 views

Convert a number in attribute table to binary

I would like to convert whole integers from decimal to binary in ArcGIS using the field calculator. I am looking for the equivalent of DEC2BIN excel command. All values are 255 or below so 8 bit is ...
1
vote
1answer
125 views

Stuck updating one field based on the condition of another using Acrpy or Field Calculator

I have a shapefile with 5,000 city points. I need to populate a new field, "cls_pop", based on each cities population, so that cities with a population > 2,000,000 will have "cls_pop" = 1, cites with ...
5
votes
1answer
314 views

Translate Excel formula to be used in field calculator

I have a series of equations to create corner points to make rotated polygons based on angles in the attribute table, but I have created it in excel and can't figure out the syntax to get it to work ...
0
votes
0answers
78 views

Automatic update of field calculator. [duplicate]

When I calculate length or ID it is only for the existing data but not doing it for new entry. How can I make the fields calculate current/data?
0
votes
1answer
141 views

Python: using CalculateField_management for duplicating attributes with a double quotation mark

I am writing a python script which duplicates a field. The field contains names of pipelines but some of these names has double quotation (ex. 8" NGL PIPELINE). I have created a new field and trying ...
2
votes
1answer
105 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 ...
0
votes
3answers
241 views

Why does CalculateField set values to <Null> when output extent is in a different coordinate system?

I'm quite new to ArcGIS, and now I have to work on a script that goes through a list of feature classes to: add a field to their attribute table and fill that field with a number that I retrieve ...
3
votes
3answers
164 views

Count the number of characters in a field (Python)

I have a field that contains street names and a second field called COUNT. I need to perform a Python field calculation on the COUNT field that counts the number of characters in the STREET_NAME ...
1
vote
0answers
52 views

How to measure area of polygons generated from gps data in qgis? [duplicate]

Somebody classified my question as a duplicate. But applying the answer doesn't work for me. Here is what I did: - I made sure that my layer is in a projected coordinate system (UTM30N, WGS84) - I ...
2
votes
1answer
145 views

Using update cursor on a field with a domain

I have been replacing field calculations with python update cursors in many of my work flows and today I ran into a problem. The fields being updated have an attribute domain. so now, when I ...
1
vote
2answers
158 views

Stop rounding values in Qgis attribute table

I am calculating the areas of my polygons in Qgis using $area and everything works fine until I click on "save". All my values are rounded to an integer. I tired setting the output field type to ...
0
votes
4answers
149 views

How can I calculate different polygons by different attributes?

I'm doing my master thesis and want to calculate different polygons (in QGIS 1.8 for Mac) in four different columns which I defined by different attributes. i.e. some of the attributes in the first ...
0
votes
1answer
1k views

How to search text string and select item in QGIS?

I have a table attribute with complete roads name. I have to search items by digiting a part of the road name and I need to colour all the items selected. eg: ROAD NAME: / road 01 / road 02 / road 11 ...
1
vote
1answer
103 views

How to write a expression in field calculator for finding $X and $Y?

I'm trying to calculate the lat/long of points using the Q GIS field calculator.Nathan W suggested to First, save the layer as WGS84 and import it again. Then in the field calculator you can use $x or ...