|
POST
|
I would make 2 passes through the table. First with a search cursor to find and record the duplicates, second with an update cursor to update the two fields as needed. Something like this...... addrkey_to_streets = dict()
with arcpy.da.SearchCursor(table, ['ADDR_KEY', 'CROSS_ST_NAMES']) as cursor:
for addrkey, street in cursor:
if addrkey not in addrkey_to_streets.keys():
addrkey_to_streets[addrkey] = {'first': street, 'second': None}
else:
addrkey_to_streets[addrkey]['second'] = street
with arcpy.da.UpdateCursor(table, ['ADDR_KEY', 'CS1StreetName', 'CS2StreetName']) as cursor:
for addrkey, cs1_street, cs2_street in cursor:
cursor.updateRow([addrkey, addrkey_to_streets[addrkey]['first'], addrkey_to_streets[addrkey]['second']])
... View more
10-27-2022
12:28 PM
|
1
|
0
|
788
|
|
POST
|
Here is a very inelegant way to do it - add this after your code fixed_range_values = ', '.join([r if r.split('-')[0] != r.split('-')[1] else r.split('-')[0] for r in range_values.replace(' ','').split(',')])
... View more
10-27-2022
12:01 PM
|
1
|
1
|
1116
|
|
POST
|
Can you post the error that you are seeing? The traceback stack trace might be useful too. Typically adding the self signed cert to your machine's (the one where you are running pycharm) cert store as a trusted root is all you need to do. I agree with Dan in that you should try other arcpy api calls too to see if they have the same problem.
... View more
10-27-2022
07:42 AM
|
0
|
0
|
841
|
|
POST
|
I have never found a way to create one from scratch so I have to have a "blank template" available to use as the starting point. Something like this: mxd_template_obj = arcpy.mapping.MapDocument(<blank_template_fn>)
df = arcpy.mapping.ListDataFrames(mxd_template_obj)[0]
arcpy.mapping.AddLayer(df, <layer file name>, "BOTTOM")
mxd_template_obj.saveACopy(<mxd file name>)
... View more
10-26-2022
06:45 AM
|
1
|
0
|
680
|
|
POST
|
I have some old code where ApplySymbologyFromLayer did work (not used anymore so I can't test it). You can see the the layer was created differently, I used a .lyr file, and I specify the layer title as the first parameter. arcpy.MakeFeatureLayer_management(in_features, layer_title, where_clause)
symbology_fn = r"xxxxxx.lyr"
arcpy.ApplySymbologyFromLayer_management (layer_title, symbology_fn)
... View more
10-25-2022
06:40 AM
|
0
|
0
|
2034
|
|
POST
|
I suspect you can not have a period in the feature class name in a file geodatabase. Can you change them to underscores? Or maybe just used the last portion of it (REGIE_EAUX_USEES)? DEV.gdb\rezo_h.geom04.REGIE_EAUX_USEES
... View more
10-03-2022
03:26 PM
|
0
|
0
|
1030
|
|
POST
|
I'm trying to figure out how to configure an Experience Builder Suitability Modeler widget and one prereq is to create a WRO service. So I follow the instructions to create the mosaic dataset in ArcGIS Pro using the Weighted Raster Overlay Service toolbox and that seems to go OK. My problem is when I run the publishing step with the ArcGIS Pro "Create Hosted Imagery Layer" command, it appears to hang with the Data Upload as "Staged" and the Output layers "Pending". Is there something I'm missing - am I supposed to do something more to move to to completed? I can't even find a log file that might give some hints.
... View more
09-30-2022
01:51 PM
|
0
|
8
|
3463
|
|
POST
|
I assume it is complaining about 'PatrolDateCalc', which I done see being defined anywhere.
... View more
09-27-2022
09:46 AM
|
1
|
2
|
1860
|
|
POST
|
Hi Rebecca - I know this is a bit dated and sorry to dredge it back up, but I'm trying to figure out how to add a combo box to a python tool. My understanding is that a combo box combines an editable field with a drop down list - so the user is not bound to entering just the fields in the drop down list (this is what I want). Your image looks more like a multi-select input field. Do you know if a combo box (what I'm seeking) is possible? Thanks
... View more
09-15-2022
06:48 AM
|
0
|
0
|
3469
|
|
POST
|
Can you provide more detail on how it is failing - for instance the error messages?
... View more
08-16-2022
12:49 PM
|
0
|
0
|
513
|
|
POST
|
After a lot of flailing around I was finally able to get Spyder installed with ArcGIS Pro 2.9. I think these are the steps - my objective was to upgrade from ArcGIS Pro 2.8.3 to 2.9 and get Spyder to use the python modules shipped with 2.9 Installed ArcGIS Pro 2.9 Used the ArcGIS Pro Python Package Manager to: Create and activate a clone 'arcgispro29-py3-081522' Restart ArcGIS Pro to make sure the clone is good (I was hoping I could just point my existing Spyder install at the new clone's python.exe but there seems to be a Spyder bug that prevents this) on to plan B Add package: spyder-kernels Add package: spyder (This ran for a long time but did NOT install spyder - the following steps are plan C) Opened a DOS window and: cd to the 2.9 conda environment Scripts directory (C:\Users\dmorrison\AppData\Local\ESRI\conda\envs\arcgispro29-py3-081522\Scripts) pip install spyder Run spyder.exe from the same directory I took pretty much the entire day to get this to work........not looking forward to the next ArcGIS Pro upgrade
... View more
08-15-2022
06:08 PM
|
5
|
2
|
4279
|
|
POST
|
I had the exact same experience in terms of expectations and the ultimate reality that the web service UI is much less functional that the desktop UI. This is mentioned in the documentation, but I just did a quick search and was unable to find it.
... View more
08-10-2022
08:27 AM
|
0
|
0
|
693
|
|
POST
|
Can you include the entire .pyt file? My guess is there there is something happening in the toolbox functions (eg updateParameters) that is causing that. Also please format the code
... View more
07-20-2022
03:48 PM
|
0
|
0
|
961
|
|
POST
|
I would make 2 passes through the table. On pass one use a search cursor to create a python dict with each entry having the ID as the key and the list of string to be concatenated as the value. On the second pass use an update cursor to populate the name_cancat field in each record by using the value of the ID field to get the concatenated string from the dict.
... View more
07-20-2022
03:39 PM
|
0
|
0
|
1550
|
|
POST
|
I agree that you should log before and after the if statements at lines 60/71 and also immediately after the cursor updates. Another option might be to try MakeFeatureLayer/MakeTableView (assuming you can somehow select the records with a query) then CalculateFIeld to set those fields.
... View more
07-20-2022
03:13 PM
|
0
|
0
|
5411
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-18-2025 03:42 PM | |
| 1 | 11-19-2025 02:36 PM | |
| 1 | 08-11-2025 09:19 PM | |
| 2 | 08-07-2025 11:47 AM | |
| 1 | 01-18-2022 07:15 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-28-2025
04:52 AM
|