POST
|
You should be able to do something like this:
for row in cursor:
row.setValue("NewField", row.getValue("OldField"))
cursor.updateRow(row)
What I am attempting to do is create a copy of an attribute field in a feature class. I want the values of both fields to be exactly the same, but I want their titles to be different. I think I'm close but I am receiving errors, and cannot resolve them myself. import arcpy, string, os, fileinput
from arcpy import env
env.workspace = "filepath/filepath.gdb"
env.overwriteOutput = True
fc = "FeatureClass"
verification = arcpy.Exists (fc)
print verification
del verification
arcpy.AddField_management (fc, "NewField", "TEXT", "", "", "", "", "", "", "")
cursor = arcpy.da.UpdateCursor (fc, "NewField")
for row in cursor:
delimfield = arcpy.AddFieldDelimiters (fc, ["OldField"])
row[0]
cursor.UpdateRow(row)
del row
del cursor I think my issue is here: "delimfield = arcpy.AddFieldDelimiters (fc, ["OldField"])" I'm not even sure this is the right tool for copying over the values from one field to the other. After running the script I receive the error listed below. Any ideas? Runtime error
Traceback (most recent call last):
File "<string>", line 22, in <module>
AttributeError: 'da.UpdateCursor' object has no attribute 'UpdateRow'
... View more
08-12-2013
09:44 AM
|
0
|
0
|
426
|
POST
|
Are the fields that are being joined coming in as text/string fields as opposed to numeric fields?
... View more
12-10-2012
12:14 PM
|
0
|
0
|
159
|
POST
|
Hi All, We have been encountering problems lately while editing (using 10 sp 2). The speed of ArcMap while editing slows to a crawl, and snapping will not work (unless classic snapping is enabled). I was wondering if anyone else has encountered this issue? Thanks, Angela
... View more
01-06-2012
09:49 AM
|
0
|
34
|
17336
|
POST
|
Hi, Off of the top of my head, this is one way to do it... Add 4 new fields to the feature class (startX, startY, endX, endY) and calculate geometry for each. Then these values can be used in your formula to measure the distance.
... View more
01-03-2012
01:50 PM
|
0
|
0
|
473
|
POST
|
Hi, I am using ArcGIS for sharepoint. I have set the maximum cluster to 20. However, over a few points I have more than 20 features. They are share a single location, but are separate point features. I was wondering if anyone has any ideas on how to make these features visible through clustering, as it is an issue that as soon as there are more than 20, you can no longer hover over them to see their attributes. Thank you so much, Angela
... View more
10-07-2011
08:49 AM
|
0
|
0
|
750
|
POST
|
Hi, I am having an issue with symbology. I took a great deal of time symbolizing a polygon feature class based on RGB values that were within a column. I then saved this as a layer file. I did this for 3 seperate polygon feature classes (could not apply symbology from layer as RGB values differed slightly). I went back to the layer files today, and 2 out of 3 of them are no longer showing up. It is not an issue with broken links or missing data sources. When I click the symbology tab, it says it is a "Custom Renderer" as opposed to symbology based on categories -> Unique Values. In fact, the categories option is missing. Nothing is being displayed. If I were to bring the feature class back into ArcMap and apply symbology from the layer file, it works. But if I try to save this as a new layer file, it again is converted to custom renderer and fails to show up in ArcMap again. I am not sure if this is a clear explanation of the issue. Any thoughts or similar experiences would be useful. Thank you! Angela
... View more
07-29-2011
12:37 PM
|
0
|
0
|
756
|
POST
|
Hi, I am quite new to this. I am trying to use Java ArcGIS Add-Ins through eclipse. I have created a combobox that consists of a drop down with the 3 options that are possible for the one single parameter of a python tool I customized with arcpy. Is there any way to execute this tool within the combo box, or do I have to recreate the tool in Java? I tried adding the toolbox to my eclipse project, and upon selection change, I used the selection to populate the parameter array (which, in this case, is just one string), and then tried to execute the tool. No luck. Any pointers in the right direction would be much appreciated! (this is just the code from the onSelChange) public void onSelChange(int cookie) throws IOException, AutomationException { GeoProcessor geoProcessor = new GeoProcessor(); geoProcessor.addToolbox("*******catalogPath********/xy.tbx"); VarArray parameters = new VarArray(); if (cookie == gisOption) { String gis = "gis"; parameters.add(gis); } geoProcessor.execute("updateDate",parameters,null);
... View more
02-04-2011
03:33 PM
|
0
|
0
|
477
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|