-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
02 Slice Census #1
Comments
This error shows because the ID field of the input slice data is not a text field. |
That is good, I just check the code and found the ID = arcpy.GetParameterAsText(2) |
I added a new field in TEXT type and set the value = ID. It was deleted in both the input and output feature classes after finishing the process. The revised codes are: import os, arcpy ''' input = arcpy.GetParameterAsText(0) totaln = int(arcpy.GetCount_management(input).getOutput(0)) if step == '#' or step == '': sys.path.append(os.path.split(os.path.realpath(file))[0]) arcpy.SetProgressor("step", "Reading files...") newfieldname = str(ID) + "COPY" i = 1 select_list.sort() i = 0
arcpy.DeleteField_management(input, [newfieldname]) |
Executing: 02SliceCensus "D:\Project\OD time matrix\Draft\JournalofTransportGeography\Tool\TestData\US_PriSec_2018.gdb\PriSec_routing_LA\PriSec_routing_LA_ND_Junctions" "D:\Project\OD time matrix\Draft\JournalofTransportGeography\Tool\TestData\temp2.gdb" OBJECTID 3
Start Time: Sun Jul 5 11:33:59 2020
Running script 02SliceCensus...
Failed script 02SliceCensus...
Traceback (most recent call last):
File "D:\Project\OD time matrix\Draft\JournalofTransportGeography\Tool\LargeODcost-master\02Slice_census.py", line 43, in
arcpy.FeatureClassToFeatureClass_conversion(input, outputgdb, os.path.splitext(os.path.split(input)[1])[0]+"_"+str(i), "{0} IN ({1})".format(ID, str(criteria[1:len(criteria)-1])))
File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\conversion.py", line 1918, in FeatureClassToFeatureClass
raise e
ExecuteError: ERROR 999999: Error executing function.
An invalid SQL statement was used.
An invalid SQL statement was used. [PriSec_routing_LA_ND_Junctions]
The table was not found. [PriSec_routing_LA_ND_Junctions_0]
Failed to execute (FeatureClassToFeatureClass).
Failed to execute (02SliceCensus).
Failed at Sun Jul 5 11:34:00 2020 (Elapsed Time: 1.38 seconds)
The text was updated successfully, but these errors were encountered: