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
|
653
|
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
|
773
|
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
|
811
|
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
|
818
|
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
|
430
|
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
|
259
|
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
|
462
|
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
|
550
|
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
|
580
|
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
|
1667
|
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
|
0
|
2
|
1691
|
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
|
1020
|
POST
|
You can use the python '_file_' variable to get the path to your .py file. From there you can back it up to the root of your toolbox. Here is an example of how I do it: path_code_base = os.path.normpath(__file__ + '/../../../../')
... View more
01-12-2022
04:43 PM
|
1
|
0
|
605
|
POST
|
I took at look at one of the REST endpoints behind one of the layers ('Registered Two Unit Dwellings') and it did not have the EXTRACT capability enabled. I suspect this is why it is not working for your.
... View more
01-11-2022
09:50 AM
|
0
|
0
|
350
|
POST
|
I can't easily recreate the ExecutionError exception but one thing I would try is to see what you get with the exception's 'args' property, which will give you the arguments passed in by the ESRI code when the exception was created. try:
my code here...
except arcpy.ExecuteError as ex:
print (str(ex.args)) # Maybe the specific error code is one of the args ??????
e = sys.exc_info()[1]
print(e)
except:
handle of other errors
... View more
01-09-2022
02:52 PM
|
2
|
1
|
1347
|
Title | Kudos | Posted |
---|---|---|
1 | 03-06-2024 11:59 AM | |
1 | 12-11-2023 03:20 PM | |
2 | 11-17-2023 06:52 AM | |
1 | 10-12-2023 07:38 AM | |
1 | 10-01-2023 04:02 PM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|