Hello,
So I've been racking my brain as to why this isn't working. Basically I have a script to process LiDAR .las data and I have a step to "Change LAS Class Code". And eventually I want to have this in a GP Script Tool or as a Notebook where my coworker(s) just need to put in the inputs.
Per the documentation for the Change LAS Class Code tool, the input format for "class_codes" can be
For example, a current class code of 5 can be changed to 25 by specifying "5 2" or [[5, 2]]. Likewise, a change to the synthetic class flag can be made by adding the keyword for the desired modification ("5 2 SET" or [[5, 2, "SET"]]). Multiple changes can be specified as a semicolon-delimited string (for example, "5 2; 8 3; 1 4") or as a list of lists (for example, [[5, 2], [8, 3], [1, 4]]). https://pro.arcgis.com/en/pro-app/latest/tool-reference/3d-analyst/change-las-class-codes.htm
But when I put in the Input() or arcpy.GetParameterAsText to use as a variable, in the same way the documentation has the change class codes formatted, the script will fail. But when I hard code it into the Geoprocessing step (ex: class_code = [[1,0]]) it works just fine.
Example Code
inputClassCodeChange = input("..."): [[0,1]]
arcpy.ddd.ChangeLasClassCodes(in_las_dataset = lasdsets, class_codes = inputClassCodeChange)
^ This will not work and fails.
But hard coding it in like, below, works just fine.
arcpy.ddd.ChangeLasClassCodes(in_las_dataset = lasdsets, class_codes = [[0,1]])
I'm trying to figure out what I'm missing. I've tried adding quotes, and some many combinations.
I may just be dumb but any help y'all can give will be greatly apprciated.
Thank you
Thomas