0
votes
1answer
71 views

ArcGis Python Script, Calculate Field

Sorry for my English. I am trying to write a Python Script for ArcGis 10.2. #import system modules import arcpy import math from arcpy import env #Set environment options ...
1
vote
1answer
81 views

How to create sequential field based on sorted data? (or extract pop-up data?)

I downloaded a kmz field and converted it to a GDB fc on arcmap. However, the field I need to label the layer by is stored in the pop-up html field... It looks like this: <html ...
2
votes
2answers
52 views

python add fields that may have NULL values

I would like to use python to calculate a field (short integer) using other fields (short integer) present in the table. In some cases these fields may have NULL values for one or more of the fields. ...
2
votes
3answers
214 views

Calculate X and Y of line start and line end in Python? ArcGIS 10.1

I have a series of polyline shapefiles and I am trying to automate the process of calculating the X and Y coordinates of the line start and line end using Python. I have added the 4 fields (startx, ...
2
votes
1answer
42 views

Arcpy Calculate Field Formatting Syntax

I am trying to field calculate a double field (PID) to a new string field (PIN). Using: qry = '"139-{}".format(!PID!)' arcpy.CalculateField_management(out, "PIN", qry, "PYTHON") Given a PID = ...
1
vote
2answers
71 views

Calculate field based on most frequently occuring text/value in other fields in attribute table (ArcGIS)

I was wondering if anyone knows if it is possible to calculate a field based on the most frequently occurring value in other fields. What I have is 5 fields with crop information over 5 consecutive ...
2
votes
1answer
87 views

How to copy values from field to another using arcpy?

Can some one please let me know how I can do simple field calculation like Copying From "A" to "B" in ArcPy? I have found lots os example on web which they all used extra expression and they were ...
3
votes
3answers
312 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
115 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 ...
2
votes
3answers
80 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 ...
0
votes
1answer
202 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 ...
1
vote
1answer
124 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 ...
2
votes
1answer
185 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
88 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 ...
0
votes
1answer
91 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
127 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 ...
2
votes
1answer
108 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 ...
0
votes
3answers
199 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 ...
0
votes
1answer
103 views

Trying (+ failing) to use a Function in Field Calculator

I'm trying to populate a field using a function. When I run this in Pyscripter, it works fine: d = {} # Function # def find_dups(val): d[val] = d.setdefault(val, -1) + 1 return d[val] # ...
1
vote
2answers
284 views

ArcPy Field Calculation with special characters

I'm trying to calculate a string field, using "µSv/h". Running this in the manual field calculator works just fine, but I've tried this in the Python window in ArcMap as well as the IDLE, but both ...
0
votes
0answers
165 views

python script to calculate and return values based on several conditions

I need to calculate and return the value "continuous" to those records in a polygon feature class with species records aggregated to a UTM grid considering the attributes are species name, grid code, ...
2
votes
1answer
186 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
1answer
505 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 ...
4
votes
1answer
539 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 = ...
1
vote
1answer
387 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 ...
2
votes
1answer
392 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 ...
4
votes
2answers
968 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 ...
1
vote
1answer
214 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" ...
4
votes
2answers
864 views

arcpy: check for same record in cell above and below

After using the find duplicates in arcmap 10, I want to check if the feat sequence ("find duplicates" marks all records with the same attributes with the same number [in "feat_seq"] and creates a ...
6
votes
1answer
1k views

Get shape filename in attribute field using field calculator

I apologize for crossposting against the ESRI geoprocessing forum, but it seems like this one gets answers. I'd like to have a modified append tool (ArcToolbox) that takes multiple shapefiles with ...
4
votes
3answers
4k views

ArcGIS 10/arcpy: Help needed with syntax for CalculateField_management in Python script

I need to use CalculateField_management in a Python script, and the calc expression needs to concatenate a runtime variable, a string, and a field (string) value. I have searched all over for ...