Folks,
I am a SUPER new python user and I am attempting to do the following:
1. Navigate to a folder full of .las files
2. Use the data management tool "create las dataset" to create an las dataset for each individual .las file
3. Convert said .lasd file into a tin using 3d Analyst's "LAS Dataset to TIN" tool
4. Repeat this process for ~100 or so .las files, ultimately ending up w/ 100 individual .adf files
I can perform this fairly easily using modelbuilder and batch mode, but it's somewhat time consuming.
My question: How in the world do I go about automating this process? I am attempting to write a script (command line using the powershell) to run everything outside of the GUI, but would be happy to even figure out how to do it w/in ArcPy if necessary. My initial attempts used some code from the ESRI help menu. What follows was my attempt to take 1 .las file, and convert it to a .lasd file (steps 1-2 above):
import os
import arcpy
import exceptions, sys, traceback
print "Set the input workspace for my .las files"
arcpy.env.workspace = raw_input()
print "This is my output workspace"
arcpy.env.workspace = raw_input()
try:
print "Set local variables: inLas"
inLas = raw_input()
print "set local variables:outlas"
lasD = raw_input()
print "..and finally we will create the new LAS Dataset"
arcpy.management.CreateLasDataset (inLas,lasD)
except:
print "Well you tried your best, better luck next time."
Obviously I am lost in the sauce, and would love some guidance. I'm sure I'm forgetting to import something, or who knows what. TThanks!
Cheers,
Mike
I am a SUPER new python user and I am attempting to do the following:
1. Navigate to a folder full of .las files
2. Use the data management tool "create las dataset" to create an las dataset for each individual .las file
3. Convert said .lasd file into a tin using 3d Analyst's "LAS Dataset to TIN" tool
4. Repeat this process for ~100 or so .las files, ultimately ending up w/ 100 individual .adf files
I can perform this fairly easily using modelbuilder and batch mode, but it's somewhat time consuming.
My question: How in the world do I go about automating this process? I am attempting to write a script (command line using the powershell) to run everything outside of the GUI, but would be happy to even figure out how to do it w/in ArcPy if necessary. My initial attempts used some code from the ESRI help menu. What follows was my attempt to take 1 .las file, and convert it to a .lasd file (steps 1-2 above):
import os
import arcpy
import exceptions, sys, traceback
print "Set the input workspace for my .las files"
arcpy.env.workspace = raw_input()
print "This is my output workspace"
arcpy.env.workspace = raw_input()
try:
print "Set local variables: inLas"
inLas = raw_input()
print "set local variables:outlas"
lasD = raw_input()
print "..and finally we will create the new LAS Dataset"
arcpy.management.CreateLasDataset (inLas,lasD)
except:
print "Well you tried your best, better luck next time."
Obviously I am lost in the sauce, and would love some guidance. I'm sure I'm forgetting to import something, or who knows what. TThanks!
Cheers,
Mike