POST
|
你是说Pyhton 3.6 +吗?我能说的经验that some of the arcpy tools in Python 3.7 (ArcGIS Pro 2.9) that some of the tools accept f-string as parameters other does not: This example does not work (using the f-string in the where_clause parameter): where_clause_with_date_filter = f"{where_clause} AND {date_filter}" points_select = arcpy.analysis.Select("{0}.{1}".format(schema_owner, TABLE_CAL_POINTS), r"memory\f{0}".format(uuid4().hex),where_clause_with_date_filter) generates the error: File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\analysis.py", line 138, in Select raise e File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\analysis.py", line 135, in Select retval = convertArcObjectToPythonObject(gp.Select_analysis(*gp_fixargs((in_features, out_feature_class, where_clause), True))) File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in
11-22-202204:42 AM
|
0
|
0
|
283
|
POST
|
@JohannesLindner Thank you so much, it works perfectly you're a legend! In the hopes that it might help someone else create database sequences using arcpy here is my code for that: import arcpy def main(): fgdb = r'C:\pathtoyourdb.gdb' # Get all of the codes to build the sequences from table = r'C:\pathtoyourdb.gdb\yourFeatureClass' field = 'YourIDField' with arcpy.da.SearchCursor(table, [field]) as cursor: myValues = sorted({row[0] for row in cursor}) print (myValues) for value in myValues: arcpy.CreateDatabaseSequence_management(fgdb, value+"_1", 1, 1) for value in myValues: arcpy.CreateDatabaseSequence_management(fgdb, value+"_2", 1, 1) sequences = arcpy.da.ListDatabaseSequences(fgdb) for seq in sequences: print('Sequence name: {}'.format(seq.name)) print('Sequence start value: {}'.format(seq.startValue)) print('Sequence increment value: {}'.format(seq.incrementValue)) print('Sequence current value: {}'.format(seq.currentValue)) if __name__ == '__main__': main() Once again, can't thank you enough for your help it is very much appreciated!
... View more
04-07-202205:46 AM
|
0
|
0
|
331
|
POST
|
Wow this is great, thank you once again Johannes!
... View more
09-21-202107:45 AM
|
0
|
0
|
572
|
POST
|
Thanks for the help. I didn't realized that street_status wasn't numeric.
... View more
08-27-202112:31 PM
|
0
|
0
|
596
|
POST
|
That statement is correct and should work p.s. it is not Arcade, it is SQL.
... View more
08-20-202109:05 AM
|
1
|
0
|
437
|
POST
|
It should be identical
... View more
08-12-202112:31 PM
|
0
|
0
|
1117
|
POST
|
Wow so simple, that's great. Thanks again!
... View more
08-12-202108:39 AM
|
0
|
0
|
554
|
POST
|
That did it. I just had to change that line to the inverse as follows - str_list = "'{}'".format("','".join(olt_list)) Thank you and everyone else for the tips!
... View more
08-10-202111:42 AM
|
0
|
0
|
453
|
POST
|
Dan, Thanks for the advice. I ended up using Pandas.
... View more
07-26-202105:42 AM
|
0
|
0
|
723
|
POST
|
This will work! And you were right, the OID in the table is ordered sequentially and will serve as the segment id for the output of the script. Thanks a lot for your help.
... View more
07-09-202107:56 AM
|
1
|
0
|
409
|
POST
|
That works! The syntax example will also help a lot for future rules, so thanks so much!
... View more
06-22-202111:35 AM
|
1
|
0
|
649
|
POST
|
Please don't post code as screenshots. //www.gobook3.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552
... View more
06-18-202109:28 PM
|
0
|
0
|
248
|
POST
|
This is exactly what I was trying to do. I had read the documentation of the arcpy.GetParameterAsText() , but was a bit thrown off that the function didn't use [] to reference list index. This really helps clarify it for me. Thanks a lot!!
... View more
06-01-202108:21 AM
|
1
|
0
|
1493
|
POST
|
Update - I ended up testing the tool with a different co-worker with the same version of ArcPro as me (2.6.3) and the tool worked. Looks the the version discrepancy was the source of the issue.
... View more
05-24-202106:05 AM
|
0
|
0
|
883
|
Title | Kudos | Posted |
---|---|---|
1 | 09-16-202101:54 PM | |
1 | 08-18-202103:05 PM | |
1 | 08-12-202107:38 AM | |
2 | 07-19-202101:52 PM | |
1 | 07-09-202107:56 AM |
Online Status |
Offline
|
Date Last Visited |
09-28-202107:30 AM
|