|
POST
|
I would follow Jake's suggestion, from a previous post of the exact same question, and simplify your script to more easily debug your issue with the SQL clause. Once that problem has been resolved I would work towards getting your more complex code working.
... View more
04-11-2013
08:52 AM
|
0
|
0
|
1787
|
|
POST
|
Chris and Caleb: After further research I think I have found out why my script which performs the same action on a much larger dataset runs quickly. I create an index on the field in the table that I am using to join to the feature class before I create the join. I took the model from another person who built the model in modelbuilder and I exported it to a python script where I made some tweaks (That is why I was unaware of the index previously). As such Chris, you could also add a arcpy.AddIndex_management step to your process in the CIS table which should dramatically speed up your original script (Only if you can not get Caleb's more advanced script to work for you).
... View more
04-11-2013
08:37 AM
|
0
|
0
|
1759
|
|
POST
|
Scott: Can you put in a print statement to determine what citiesL is defined as? I do not see you setting the workspace in your script (e.g. file geodatabase, SDE database, shapefile), so I do not know how the script knows how to define citiesL for the SelectLayerByLocation_management(citiesL, "WITHIN_A_DISTANCE", interstates, maxKmInterstate, "NEW_SELECTION").
... View more
04-11-2013
06:33 AM
|
0
|
0
|
3771
|
|
POST
|
Most of the thanks goes to Caleb. Although my script runs in a reasonable timeframe, I can use Caleb's code to make my script even better. Thank you very much Caleb.
... View more
04-10-2013
10:35 AM
|
0
|
0
|
1759
|
|
POST
|
Chris: With your current script without the data dictionary, can you verify that the data type is the same in the original field of the feature class and the source field you are calculating from in the table? Like I said before, I have a script that works like yours on a much larger dataset and it finishes in less than 5 minutes.
... View more
04-10-2013
09:54 AM
|
0
|
0
|
1759
|
|
POST
|
Caleb: Your solution is very elegant compared to the script that Chris wrote and I helped him modify. I cannot speak for Chris, but your script is advanced and might be difficult for a person new to python scripting. It just seems that Chris' script has a minor issue that can be quickly corrected (once its found) as he is working with such a small dataset.
... View more
04-10-2013
09:33 AM
|
0
|
0
|
1759
|
|
POST
|
Caleb: Is there any reason why Chris' original script should take so long to run? I am working with a much larger feature class and table performing the same type of join and calculate geoprocess and it completes in 5 minutes. Is there any chance it could be due to field type differences between the join field in the table and the field that is being calculated in the feature class?
... View more
04-10-2013
09:19 AM
|
0
|
0
|
2787
|
|
POST
|
Chris: Can you try to create a new layer on disk and work with that instead of the FeatureLayer? I'm not sure this is possible, as you might have to work with the in-memory feature layer and then save to disk once all the processing has been completed.
... View more
04-10-2013
08:49 AM
|
0
|
0
|
1945
|
|
POST
|
Chris: When is the feature class being saved to disk, as I do not see this in your code sample? arcpy.CalculateField_management(layerName, "SERVICE_LOCATION.MEMBER_NUMBER", '!MEMBERNO!', "PYTHON") This appears to be incorrect as layerName should be the in_table expression should be !CIS_Account_Data.MEMBERNO! as you need to explicitly specify that this is coming from a join field.
... View more
04-10-2013
07:54 AM
|
0
|
0
|
1945
|
|
POST
|
Two things: I would post this thread to the Python subforum as you might can help from more advanced python users. Can you provide the remainder of your code as I'm wondering if the bottleneck might be with saving the feature class to disk as the arcpy.MakeFeatureLayer_management should only save the feature class to memory so you still need to save the feature class permanently to your file gdb?
... View more
04-10-2013
07:08 AM
|
0
|
0
|
1945
|
|
POST
|
Chris: Here is a code snippet where I use python syntax instead of VB syntax: arcpy.CalculateField_management(rdcl_Layer, "MUNI_NUM_RIGHT_UNPAD", '!MUNI_NUM_RIGHT!.lstrip("0")', "PYTHON", "") For your code: arcpy.CalculateField_management(SERVICE_LOCATION_FL__2_, "SERVICE_LOCATION.MEMBER_NUMBER", "[CIS_Account_Data.MEMBERNO]", "VB", "") change it to arcpy.CalculateField_management(SERVICE_LOCATION_FL__2_, "SERVICE_LOCATION.MEMBER_NUMBER", '!CIS_Account_Data.MEMBERNO!', "PYTHON", "") I would even set the env variable as the destination file geodatabase so you do not need to reference it in your call to CalculateField_management Near the top of your script below import arcpy from arcpy import env env.workspace = "C:\\MEWCo GIS System\\Electric System\\MEWCo_Electric_Model-LOCAL.gdb\\CIS_Account_Data" then your code could be arcpy.CalculateField_management(SERVICE_LOCATION_FL__2_, "SERVICE_LOCATION.MEMBER_NUMBER", '!MEMBERNO!', "PYTHON", "") I'm not really sure this is the issue as I use VB notation in a CalculateField_management process where I have 200,000 records and it only takes 5 minutes as opposed to hours.
... View more
04-10-2013
04:38 AM
|
0
|
0
|
1945
|
|
POST
|
arcpy.CalculateField_management(SERVICE_LOCATION_FL__2_, "SERVICE_LOCATION.MEMBER_NUMBER", "[CIS_Account_Data.MEMBERNO]", "VB", "") Chris: Maybe because you are using the VB syntax it is taking a long time for the CalculateField_management process. Try converting this to PYTHON with the appropriate syntax for field names [field name] as per the documentation. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000004m000000
... View more
04-09-2013
10:25 AM
|
0
|
0
|
1945
|
|
POST
|
I'm curious on one thing - is doing the "Make Feature Layer" and "Add Join" have anything to do with the long time it takes to do the "Calculate Field" tool outside of an edit session?? Chris - Can you just run the "Make Feature Layer" and "Add Join" part of your python script and see how long it takes? This could determine that this is the cause of the long processing time? I would even just run the "Make Feature Layer" separately from the "Add Join" to determine which process is causing the long processing time.
... View more
04-09-2013
09:24 AM
|
0
|
0
|
2623
|
|
POST
|
Can you just run these python scripts in series, so there is never any parallel processing going on within 1 file geodatabase? I would suggest using a bat file to call each python script, so a python script will not get executed until the previous python script has completed its processing.
... View more
04-09-2013
06:06 AM
|
0
|
0
|
2734
|
|
POST
|
Robert: The ability to configure the eSearch widget, as Mike above posted, was a user desired requirement for an application that my organization is building. The fact that you can disable the display of the results window is very useful as the results can also be provided from an Identify pop-up window that does not take up as much real estate on the screeen as the results window. As such, thank you for the ability to disable the results window from the config file. Just an excellent widget.
... View more
04-09-2013
04:52 AM
|
0
|
0
|
2143
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-19-2024 10:38 AM | |
| 1 | 2 weeks ago | |
| 1 | 02-23-2026 05:32 PM | |
| 2 | 02-11-2026 10:42 AM | |
| 1 | 12-22-2025 10:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
13 hours ago
|