Tagged Questions

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

0
votes
0answers
66 views

Populate a new field with list of the top 5 values of all fields for that record

I have 15 fields. I would like to add a new field that is populated with the field name and value of the top 5 highest values of the 15 fields for each record in the table. The new field would be a ...
5
votes
1answer
69 views

Calculate difference between values in linear order using ArcGIS

The best way to describe this without knowing Python or VB jargon is to add these screenshots. I would like to emulate this Excel calculation in ArcMap10.1. MEAS is the distance along my route and ...
1
vote
2answers
762 views

How to fill attribute field of one feature based on calculation on attribute field of another feature

I would like to fill an Attribute field of a geodateabase table based on some calculations such as 'sum' over specific field of another Feature class. Is there an Approach to formulate it? while in ...
1
vote
1answer
65 views

Mismatch in area calculation using Field Calculator vs Group Stats in QGIS 2.0

I have two polygon files (A being my area of interest and B being a categorised land cover layer). Both layers were in the same projection (projected and not geographic). Using QGIS 2.0, I used the ...
0
votes
0answers
14 views

Unique referencing based on Co-ordinates

I have a list of 400 nodes, all split across 'maps' which are gridlines 1000x1000m. Each grid area is referenced by the first 3 digits of the X value of the centre and first 3 digits of the Y value ...
3
votes
1answer
202 views

Can't compute area of shapefile in field calculator

This shapefile represents the counties of NM. I am trying to compute the area of each polygon (yes, I know there is an area field, but this is a simpler example of a problem I'm having which doesn't ...
4
votes
3answers
3k views

How to replace null values in attribute table ArcGIS 10.2

I have a string field 'Oneway' with three values '+' '-' and Null showing a street accessibility, I would like to replace them with values 'F' 'T' and null as the script for Network dataset expect ...
0
votes
1answer
174 views

Field Calculator - replace string function - data value recognised as a column and is “not found” [closed]

I have the same challenge as GrahamD - Field Calculator - replace string function I have exactly the same challenge. Exactly the same as GrahamD's challenge, p abbreviated for pan. Type_2 as a test ...
0
votes
2answers
300 views

Field Calculator - replace string function

Within an attribute table I'm trying to replace one string with another using the 'replace' function . As an example, there are a number of features whose field 'NAME' contain the string '(B)' and ...
4
votes
2answers
81 views

How to replicate trunc function on QGIS?

I've search a bit before asking this question, but I haven't found the answer. Is there a Trunc function on QGis? I've tried using floor, but it doesn't work (like I want) if the number is negative, ...
1
vote
1answer
165 views

Is there a way to automatically calculate attribute values for new features?

I am creating a vector point layer which will be added to over time. I have been using the field calculator to populate fields such as X and Y coordinates. I'm wondering if there is a way to have ...
2
votes
2answers
121 views

Field Calculator, Conditional

I am trying to assign Value from one field of my Attribute table to a new field based on the 3d field.... The Code Block I am thinking about as follows: *def conditional (!FarmCateg!): if ...
3
votes
2answers
452 views

If-Then Statement in Field Calculator

Scenario: I have four fields: A, B, C and D Field A is text-based and contains values from '000' up to some number 'xxx' Field B contains a set of values (also text, but represented by numbers) ...
0
votes
1answer
109 views

Is it possible to calculate a value based on values of another row?

I have a point shape file in qgis. For one of the attributes, I would like to offset the values, i.e. the value for point 1 goes to point 10, the value for point 2 goes to point 11 and so on. I see ...
2
votes
1answer
89 views

Populate an attribute table field using the 'startswith function

I am hoping that someone may be able to help me. I am new to ArcGIS, and even newer to Python. Working in ArcGIS 10.1, I have done is created a new text field in an attribute table, which I have ...
4
votes
2answers
169 views

Changing default parser in ArcGIS Field Calculator to Python?

Is there a way to change the default parser in the Field Calculator to Python? So annoying to always change now that I'm trying to move away from using VBScript... I'm using ArcGIS 10.1 for ...
0
votes
0answers
186 views

Select Expression and Field Calculator in ONE STEP with QGIS

I have an Open Street Map Shapefile and i want to use Field Calculator to add information to a field called a800900 according to the field TYPE of street, by different area (field called ID_2). The ...
1
vote
1answer
159 views

Help with field calculator in Python script

I am getting a syntax error in my script but I know from testing it in ArcMap attribute table, the syntax is fine. Anyone have any idea why this code doesn't work? I see that a search cursor has been ...
4
votes
1answer
488 views

How to use the Intersects function in the Field Calculator of QGIS?

I would like to have an example on how to use the Intersects function in the Field Calculator of QGIS. Basically, I want to know which feature from a polylines layer intersects a polygons layer and ...
1
vote
2answers
181 views

Using python elif syntax in Field Calculator to reclassify a range of values from a different field and populate a new field

I'm trying to use the Field Calculator with a python elif statement to reclassify values from a different field and populate a new field, and while I'm not getting an error message of any kind, I'm ...
0
votes
0answers
98 views

Doubt in Field Calculator

I am working in an project.I have a point Shapefile its projection is NAD83(HARN)Pennslyvaniasouth(ftUS)*EPSG3365* when I measure its distance(between two points) it gives me the answer in feet .yes ...
3
votes
3answers
433 views

How to create button that calculates acres on selected polygon features?

I'm looking to create a simple button that calculates acres on selected polygons and can't quite find what I'm looking for. I read through this thread: automating a python script..., but found it ...
1
vote
1answer
227 views

Field Calculator returning incorrect length and area values

I can get accurate lengths of line features and areas of polygon features using the "Measuring Tool" in a QGIS project. However, when I attempt to generate length or area data in Attribute Tables ...
3
votes
3answers
168 views

ArcGIS 10.1 : Returning shape.area in my code block

I try to calculate a field using an 'if' statement in the field calculator. Here is my code : " #Expression MyField_2 = def Reclass(!MyField_1!) #Parser Python 9.3 #Code Block def ...
5
votes
1answer
1k views

Python If else statements

I'm trying to populate a field from another. The catch is that it isn't 1 or 2 values. If my field A = 4 then I want it to return field B to 0. But if Field A is 1, 2 or 3 then I want the user to be ...
0
votes
0answers
48 views

Ádvance Python Field Calculator - Global Expressions [duplicate]

I am trying to create a global expression that populates a new field based upon existing values in an attribute table. I am using QGIS Dufour and the Sextante toolbox, and the "Advanced Python Field ...
1
vote
0answers
85 views

VB Script can't run in Field Calculator

I wrote a simple script in VB. But it failed to run in field calculator. I can't figure out what is wrong with it. Below is a screenshot. Thanks for your help.
4
votes
2answers
633 views

Using Calculate Field (Data Management) tool to calculate 3D Length in ArcGIS 10.1

I'm relatively new to the world of model builder and scripting, so it's likely there is a very simple solution to the question I've been trying to figure out. I'm trying to create a tool that takes ...
1
vote
1answer
127 views

Why do area measurements from “measure area” tool and field calculator differ?

My problem is when using the "measure Area" tool on the toolbar I get the correct value but when using the field calculator in the Layer Attributes the area is very different including -ve areas. ...
4
votes
1answer
86 views

Area calculation of an object without coordinates

I have a photo of an object with a scale and I want to calculate its area. I guess I have to create a polygon of the area to be calculated to use the 'field calculator'. But how do I tell the program ...
2
votes
1answer
90 views

Extract characters inside parentheses in QGIS

I have a shapefile of the buildings on my college campus. It has a "name" field that includes the name of the building and then in parentheses the building's campus address (i.e. Health and ...
1
vote
2answers
217 views

VBA ArcGIS 9.3 Field Calculator: 'countif' across several fields

I have an attribute table with 15 columns that contain either a '0' or a taxonomy number. I would like a summarized column that shows the number of different species. location type1 type2 type3 ...
1
vote
1answer
184 views

Cursor Update Python Script for Multiplying Several Fields against a Ratio (Real) in ArcGis

Disclaimer: Python Neophyte, Uber-reliant on GUI, working to wean... I have a Python script for replacing multiple Field values with another table value that was graciously provided by the inimitable ...
0
votes
1answer
277 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
220 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
96 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 ...
1
vote
1answer
95 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?
2
votes
1answer
162 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 ...
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 ...
4
votes
1answer
128 views

Calculating a Unique ID on a Subgroup of Polygons

I would like to assign a unique ID to polygons in a dataset. The catch to my issue is that I would like polygons that fall within a polygon to have the same unique ID. My example is related to ...
1
vote
1answer
349 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
596 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?
0
votes
0answers
217 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
193 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 ...
6
votes
1answer
3k views

How to perform If Statement in Field Calculator of ArcGIS for Desktop?

I have a shapefile containing two numeric fields ("Dist_1" and "Dist_2"). I want a Field Calculation that will populate an additional field ("Result") with one of three answers: First if Dist_1 is ...
1
vote
1answer
111 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 ...
0
votes
1answer
225 views

Arcpy CalculateField using formatting syntax

I have 2 feature classes (FC) that I am merging together and then performing some field calculations on. The 1st FC has 100k+ records in it, and the second FC is a blank FC that I'm using as a ...
2
votes
2answers
175 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
237 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 ...
1
vote
1answer
213 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 ...