POST
|
Is there a widget to export a selected set of points to a shapefile?
... View more
03-30-2016
07:12 AM
|
1
|
1
|
4092
|
IDEA
|
Prior to Collector for ArcGIS Version 10.3.6 build 1017 on Android the keyboard would not open when editing a coded-domain field. Since this latest update, the keyboard now appears each time a coded-domain field is edited. I don't understand the logic behind this change. My idea is to revert back to not having the keyboard appear or have an option to disable the automatic keyboard. The keyboard unessessarily takes up half the screen and needs to be closed each time. This is extremly problematic from a usability standpoint.
... View more
01-26-2016
09:48 AM
|
28
|
17
|
4654
|
POST
|
Thank you for stating the risks of using eval and providing me with an excellent solution. Your insight is very much appreciated. I would like to get your opinion on the getattr function. Could it be used as an alternative to eval? If so, does it represent a security risk?
... View more
11-30-2015
07:03 PM
|
0
|
0
|
362
|
POST
|
Converting a string to the variable name in Python use eval(). for cls in feedcls: with arcpy.da.UpdateCursor(out_data, (fld,)) as cursor: for row in cursor: row[0] = eval(cls + 'SPAN') print row[0] cursor.updateRow(row)
... View more
11-24-2015
08:37 AM
|
1
|
2
|
2368
|
POST
|
Thank you for your insight. I'm sure that post will alleviate forthcoming issues. I'm really struggling with referencing a variable when the variable name is formed through concatenation. I recall seeing many top quality posts from you when I worked in Avenue. I'm a beginner programmer in Python and can't get over this hurdle.
... View more
11-24-2015
07:29 AM
|
0
|
0
|
2368
|
POST
|
I've checked my sample dataset and there are values for shape_length in each row. Both the span count (eg. ARSSPAN) and cost (eg. ARSCOST) are intended to be int variables.
... View more
11-23-2015
07:46 PM
|
0
|
2
|
2368
|
POST
|
To provide further context, the field I'm attempting to write to is a long integer type. The variable list shows ARSSPAN as an int; however, for row[0] it's listed as a string. How do I make that string become the int variable I want to get the value from? Even though in this case it's 0.
... View more
11-23-2015
06:42 PM
|
0
|
0
|
2368
|
POST
|
Hi Christian, Thanks for correcting that error in my code. Unfortunately, it hasn't resolved the issue with the UpdateCursor entirely.
... View more
11-23-2015
06:32 PM
|
0
|
0
|
2368
|
POST
|
I summarize rows in a table in the SearchCursor and store them as variables. I want to refer to these variables in the following update cursor to write to a table. I get the following error on the second last line of code (in red): Tuple object does not support item assignment. When I debug the code, ROW[0] equals 'ARSSPAN' as a string. I want ROW[0] to reference the integer ARSSPAN summarized in the search cursor above. In the next iteration of the UpdateCursor, I want the integer STSPAN to be written out, etc. I feel my issue is with assembling a variable reference through concatenating a string with the iterator. Any assistance would be greatly appreciated. # Create the search cursor to iterate through table and sum spans and cost with arcpy.da.SearchCursor(fcdtest, ("FeedClass","SHAPE_Length","MGMTCOST",)) as cursor: for row in cursor: if row[0] == "ARS": ARSSPAN += row[1]/55 ARSCOST += row[2] elif row[0] == "ST": STSPAN += row[1]/55 STCOST += row[2] elif row[0] == "S": SSPAN += row[1]/55 SCOST += row[2] elif row[0] == "ARU": ARUSPAN += row[1]/55 ARUCOST += row[2] elif row[0] == "UT": UTSPAN += row[1]/55 UTCOST += row[2] elif row[0] == "U": USPAN += row[1]/55 UCOST += row[2] fld = "YR2015" feedcls = ["ARS","ST","S","ARU","UT","U"] for cls in feedcls: with arcpy.da.UpdateCursor(out_data, (fld,)) as cursor: row[0] = cls + 'SPAN' cursor.updateRow(row)
... View more
11-23-2015
04:41 PM
|
0
|
10
|
6396
|