|
POST
|
Another idea is to start removing fields from the list until is starts working, or try a SearchCursor on that feature class- perhaps with just the ['objectid'] field to start with ( assuming you have field called that).
... View more
02-16-2022
08:31 AM
|
0
|
0
|
3797
|
|
POST
|
Is "Target Field" really the field name or is it an alias? I think some databases don't allow spaces in the field names.... If the failure is on the updateRow I would add some print or AddMessage statements to dump out descriptions[i] to see which record it is choking on and the contents of the field at that point.
... View more
02-16-2022
06:23 AM
|
1
|
2
|
3806
|
|
POST
|
For this to work you must have a field or combination of fields in your table view that uniquely identifies each record in that view AND the "matching record" in the feature class. I may be wrong but it appears to me that you don't have this so the problem really has nothing to do with python but in your data.
... View more
02-16-2022
05:26 AM
|
0
|
0
|
1620
|
|
POST
|
If you are sure your table and feature classes line up (after being sorted) as you show in your diagram then you should use a list to store your table data instead of a dict. This will preserve the order so you can step through one rows at a time and move the Par field over when you find an open slot. But I'd be surprised if your table and feature class really are lined up like that......
... View more
02-10-2022
02:00 PM
|
0
|
2
|
1662
|
|
POST
|
The dict is exactly what I would expect. But, I still don't understand your objective - and will ask this again: Just curious - in your "I need the following" graphic, how do you know which values to put in the 'Par' column?
... View more
02-10-2022
08:32 AM
|
0
|
4
|
1942
|
|
POST
|
I think your dict is being built with "PermitNum" as the key - and since that field is not unique the dictionary entry is being overwritten. Just curious - in your "I need the following" graphic, how do you know which values to put in the 'Par' column? Since 'PermitNum' is not unique you must be using some other piece of information (I assumed it was the date field but it appears that is wrong).
... View more
02-09-2022
01:26 PM
|
0
|
1
|
1980
|
|
POST
|
You need to figure out how to uniquely identify each record and make that your dict key. From you example it looks like a combination of 'PermitNum' and 'Apps' is unique. In that case I would make my dict look like this: valueDict = {(r[0],r[2]): r for r in arcpy.da.SearchCursor(sourceFC, sourceFieldsList)}
... View more
02-09-2022
12:21 PM
|
0
|
3
|
1987
|
|
POST
|
I would start by printing out the parameters as your code receives them and also the where clause so you can inspect what they really look like - then run the commands interactively using those as inputs to see if they work. The AddMessage function can be used for writing to the custom tool message log.
... View more
02-08-2022
03:04 PM
|
0
|
0
|
1065
|
|
POST
|
Hi. Can you please include your code snippet (formatted properly)? I assume you have tried this and it fails the same way every time?
... View more
02-03-2022
06:08 AM
|
1
|
0
|
644
|
|
POST
|
Good question - I had the same reaction when I first ran into this. I'm not a database expert but I believe SQL server has the ability to constrain a column to a set of values so I'm curious why this isn't enforced.
... View more
01-31-2022
06:53 AM
|
1
|
0
|
1083
|
|
POST
|
That's it! I must have tried a hundred combinations and at some point I was using 4326 but must have had something else off at that point. Thanks Dan!
... View more
01-27-2022
03:02 PM
|
1
|
0
|
1122
|
|
POST
|
I have a script that takes in lot, long values (in decimal degrees) and determines whether the points are contained within a polygon in another feature class. I assume I have to create a point object and get it into the same coordinate system as the polygon, but the projection comes back empty (no points). I don't fully understand all the ins and outs of projections so hopefully I'm doing something obviously incorrect here. x = -88.155675
y = 43.223869
f_cs = 'WGS 1984 Web Mercator (auxiliary sphere)'
t_cs = 'NAD 1983 UTM Zone 16N'
xform = 'WGS_1984_(ITRF00)_To_NAD_1983'
pt = arcpy.Point(x,y)
pg = arcpy.PointGeometry(pt, arcpy.SpatialReference(f_cs))
pgp = pg.projectAs(t_cs, xform)
print (pgp.firstPoint)
... View more
01-27-2022
01:18 PM
|
0
|
2
|
1152
|
|
POST
|
Thanks - this does indeed work - more elegantly than I was considering. I've been working in Python exclusively for the past 5 years so it's hard to get used to lots of loops and tricks like this again.
... View more
01-18-2022
08:28 AM
|
1
|
0
|
3859
|
|
POST
|
I'm getting started with Arcade and can't figure out how to do something that I expect is quite simple. I have a function that returns a Dictionary object. There is a special case that the caller has to process where the returned Dictionary is empty (ie. it has no keys). How do I write that in Arcade? I would think at least I could get an Array of keys then check the length, but I don't see how to do that either var x = Dictionary ()
// My code here
if (??????(x)) {
// Dict is empty!
}
else
{
// Dict is not empty
}
... View more
01-18-2022
07:15 AM
|
1
|
2
|
3883
|
|
POST
|
You could try running Repair Geometry against the output and before you try to use it to see if that clears things up
... View more
01-12-2022
04:47 PM
|
0
|
0
|
2313
|
| 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
|