POST
|
No need to "del cursor" after the "with". The "with" closes the cursor for you. See the examples in the help. But this is all moot as you should not be dinking with cursors inside a Calculate Field code block - the code block is already executed for each selected row in the input to Calculate Field! As for your syntax error, I highlighted your code and found this immediately on line 10: with arcpy.da.SearchCursor(table, ["RID", "to_MEAS"], "RID = '" + RID + "'""'") your where expression has a syntax error. I like using the .format() method - easier to read and debug: with arcpy.da.SearchCursor(table, ["RID", "to_MEAS"], "RID = '{}'".format(RID))
... View more
10-24-2015
10:58 PM
|
0
|
0
|
223
|
POST
|
I'm trying to join 2 fields. the corridor field and the RM field. Calculate Field (PYTHON) str(!CORRIDOR!) + str(!RM!) worked but it adds a .0 to the end of the RM.. I created the RM field as a short with 0 decimal places. So it returned C000001E156.0. The precision is set to 4 Try this Calculate Field syntax arcpy.CalculateField_management(tbl, field,
"{}{:.0f}".format(!CORRIDOR!, !RM!), "", "PYTHON_9.3")
... View more
10-24-2015
10:47 PM
|
0
|
0
|
318
|
POST
|
You can use Feature Vertices To Points tool (Data Management toolbox - Features toolset) to obtain Start, End, or Mid Points from lines.
... View more
10-01-2015
10:21 AM
|
0
|
0
|
121
|
POST
|
Though I swore to never help a Cowboys fan, try the following: fc = "Sample"
rmList = []
with arcpy.da.SearchCursor(fc, ["ROUTE_ID"]) as cursor:
for row in cursor:
route = row[0].split("_")[0]
rmList.append(route)
del cursor
rmList.sort()
rmList = set(rmList)
for RM in rmList:
newList = []
with arcpy.da.UpdateCursor(fc, ["ROUTE_ID"], "ROUTE_ID LIKE '" + str(RM) + "%'") as cursor:
for row in cursor:
newList.append(row[0].split("_")[1])
del cursor
newList.sort()
firstTime = True
for val in newList:
with arcpy.da.UpdateCursor(fc, ["ROUTE_ID", "SHAPE_LEN", "beg_seg", "end_seg"], "ROUTE_ID = '" + str(RM) + "_" + str(val) + "'") as cursor:
for row in cursor:
if firstTime:
row[2] = 0
length = row[1]
row[3] = length
cursor.updateRow(row)
firstTime = False
else:
row[2] = length
newLength = row[1]
row[3] = length + newLength
cursor.updateRow(row)
length = row[3]
del cursor
... View more
10-02-2015
11:22 AM
|
1
|
0
|
1440
|
POST
|
I have not done anything with the ESRI Web components. I use my own home grown set up here since the company does not yet want to purchase the software. You can dissolve and but the process of creating a linear reference already dissolves the individual segments into one... In the pictured example I sent each corridor is composed of many segments and the creation a route dissolves that into one single line composed of measures?
... View more
10-01-2015
09:40 AM
|
0
|
0
|
586
|
POST
|
This sounds like exactly what I want to do.. I will try it in the morning when I return to work. Thank you..
... View more
09-17-2015
05:07 PM
|
0
|
0
|
2057
|
POST
|
Terry, Do you see now that I marked your reply as the correct answer. If so then do you now see the links where you can choose the correct rely as the answer? If not let me know which one you want marked, also you can use the helpful link.
... View more
09-17-2015
06:27 AM
|
0
|
0
|
162
|
POST
|
Here's a widget that has worked well for us: GitHub - igrasshoff/esri-wab-widget-google-analytics: A google analytics widget & template for use in Esri Web AppBuilde…
... View more
02-21-2019
07:26 AM
|
3
|
0
|
271
|
POST
|
I think I’m passing the corridor and the offset in as the x/y coordinate..
... View more
09-16-2015
06:25 AM
|
0
|
0
|
176
|
POST
|
Robert, As always you are of great help. Thank you.. Terry
... View more
09-09-2015
06:17 AM
|
0
|
0
|
383
|
POST
|
Terry, You need to get more familiar with the JS API. The extent and polygon objects have a contains function that you should use for this.
... View more
09-08-2015
11:13 AM
|
0
|
0
|
364
|
POST
|
Terry, When you configure an apps in WAB the apps config folder contains folder with widget names and in those folders is the .json configuration files for that widget. If the widget has images specific to it like the Bookmark widget those image will be located in that folder as well.
... View more
09-02-2015
06:49 AM
|
2
|
0
|
333
|
POST
|
Robert, Thanks for all of your help, I was able to get the widget working correctly.. Thanks for your patience.
... View more
08-25-2015
03:13 PM
|
0
|
0
|
181
|
Title | Kudos | Posted |
---|---|---|
1 | 03-10-2016 08:36 AM | |
1 | 03-10-2016 09:00 AM | |
1 | 07-16-2015 01:15 PM | |
1 | 08-19-2015 02:57 PM | |
1 | 09-14-2015 06:48 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|