1
vote
1answer
41 views

how to separate a list of features from its shapefile_

I tried to copy all features in a list of dictionaries. the code looks as follows: def iterate_features(self): feature_set = arcpy.SearchCursor(self.address) for feature in feature_set: ...
0
votes
2answers
32 views

Arcpy: calculating a field based on feature class geometry, eg 'if FC ==“POINT” calculate xy coord

I have a script that populates new fields based on user input. I would like it to also add the XY coordinates in DD if the Feature Class is a point feature, else, it moves on to the next command. I ...
1
vote
2answers
34 views

finding the index of a field with its name using arcpy

I wan to extract the index of a field with its name using arcpy. it seems what I have written is so dumb. is there any simpler method with out using for-loop. import arcpy fieldList = ...
3
votes
1answer
44 views

Crosstable two fields of a pointfile (ArcMap)

I'd like to produce a simple crosstabulation from two fields of a point feature class. These fields contain land use class information which I'd like to compare. One option is to export a dbf and do ...
2
votes
1answer
70 views

Using the UpdateCursor to change the values in fields added with arcpy.Addfield_management

I am working with some ArcGIS data and trying to add fields using AddField_management. >>> arcpy.AddField_management("huc4","Class","TEXT") I want to populate this new field using the ...
3
votes
1answer
92 views

How can I exclude a field on a table from being copied?

I have a query "layer": >>> r = arcpy.MakeQueryLayer_management(r'C:\path\to\connection\file\connection.sde', 'TEST', 'SELECT T.ID AS OBJECTID, T.* FROM MY_TABLE T WHERE T.SOME_COLUMN = 1', ...
2
votes
1answer
159 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 ...
0
votes
1answer
64 views

How to delete Field From Shapefile by Arcpy [closed]

I am using the following code to delete a field from a shapefile but I am getting an error! def main(): # Import arcpy module import arcpy # Local variables: point_shp = ...
0
votes
1answer
36 views

How to Add Field Between Two Existing Field in Shapefile

Can you please let me know if it is possible to add a new Field between two existing field using ArcPy? For Example if I have "Name", "Area", fiels already in my shapefile can I add a new field called ...
0
votes
1answer
51 views

missing values w/ updatecursor and addfield - gp

I added a feature to my 'overloading' field update script which adds a new properly named field if there is no space left to append the value into the record. This appears to run well, however upon ...
1
vote
1answer
57 views

Field's name with numbers: why not?

I have tried to create field in TOC called with numbers with python. But, it has a problem: it couldn't do it because name's of fields are numbers. It is strange for me. When I do new field in shape ...
4
votes
1answer
228 views

How to check if feature class or table contains field with specific name before adding it?

Im trying to write a script that finds out if the shapefile has a specific field and if not to add the field. I get it to show me the field, but the loop goes through each field, so it would create a ...
2
votes
1answer
79 views

Python scripting for making rings from the city center

Problem description: I have two layers: 1) [Polygon] city blocks, and 2) [Point] the city center. The City blocks layer has 110,681 records. And The city center layer has just one record because ...
1
vote
1answer
154 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 ...
1
vote
1answer
178 views

Updating the value of a field with pre-defined values

I am trying change the value of a row for a field whose type is "short" in arcmap using a python script. with arcpy.da.UpdateCursor(FILENAME, FIELD) as cursor: for row in cursor: row = ...
1
vote
1answer
81 views

How do I change the isNullable property for a field?

Once in awhile I encounter a field in my featureclasses that have their isNullable property set to No. Is there a simple way using python to correct this? I came up with this code, but ...
0
votes
2answers
951 views

Changing field type with arcpy

What I need to do is change data type of a field of a table or feature class. If there are some data, then I need to transfer it, if its possible, if not possible then just set null for that data. I ...
3
votes
5answers
4k views

Renaming a field using arcpy

What I need to do: rename a field name of a table/feature class copy all values to the new field So far I have done following code as artwork21 suggests: EDIT: import sys import traceback import ...
2
votes
2answers
837 views

rename feature layer fields

Guys and gals could you please provide me with a sample code as to how to rename a field name in a Feature Layer or Table. I've been trying to use the FieldInfo object to do so over the last couple ...