import os import arcpy import glob ws = raw_input("Set the input workspace for my .las files\n") las_files = glob.glob(os.path.join(ws, '*.las')) # create dictionary las_dict = dict(enumerate(las_files)) las_dict[len(las_files)] = 'Include all .las files in this list' # print menu for num,las in sorted(las_dict.iteritems()): print '{0}: {1}'.format(num, las) inLas = raw_input("\n\ncreate a comma separated list for all .las data sets " + "you want to include\nor choose {0} to select all .las files (ex 1,2,3,7)\n".format(max(las_dict.keys()))) # choose full path for output .lasd file lasD = raw_input('\nEnter full path to output .lasd file (ex. C:\Full_path\To_output\las_data.lasd)\n') print "..and finally we will create the new LAS Dataset" if ',' in inLas: inLas = map(lambda x: las_dict[int(x)], inLas.split(',')) else: if int(inLas) == len(las_files): inLas = las_files else: inLas = las_dict[int(inLas)] arcpy.management.CreateLasDataset(inLas,lasD) raw_input('Process complete...hit enter to close')
import os import arcpy import glob # this is a folder containing .las files ws = r'C:\some_path\to_your\las_files' # get list of .las files inLas = glob.glob(os.path.join(ws, '*.las')) print 'found {0} .las files'.format(len(inLas)) print inLas # name of output LAS data set lasD = r'C:\full_path\to_output\las_data.lasd' print "..and finally we will create the new LAS Dataset" arcpy.management.CreateLasDataset(inLas,lasD) print 'Process complete.'
import os import arcpy import glob # this is a folder containing .las files ws = r'C:\some_path\to_your\las_files' # get list of .las files inLas = glob.glob(os.path.join(ws, '*.las')) print 'found {0} .las files'.format(len(inLas)) print inLas # directories lasd_dir = r'C:\some_path\for_lasd_files' tin_dir = os.path.join(lasd_dir, 'tins') if not os.path.exists(tin_dir): os.makedirs(tin_dir) # iterate through .las files for las in inLas: lasD = os.path.join(lasd_dir, os.path.basename(las) + 'd') arcpy.management.CreateLasDataset(inLas,lasD) print 'Created Las dataset: {0}'.format(lasD) out_tin = os.path.join(tin_dir, os.path.basename(las).split('.')[0][:9] + '_tin') arcpy.LasDatasetToTin_3d(lasD, out_tin) print 'Created tin: {0}'.format(out_tin) print 'Process complete.'
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.