Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Problem. I have 413 ASCII files totalling 4 billion points, and my system cannot handle converting them to MULTIPOINT so that I can generate Terrains. Therefore I would like to create 12+ subsets of the area, using the lists generated from a shapefile(s).

  1. I've made my seperate Feature Classes listing the variable number of files that will make up each subset.

  2. I can generate (and print) a list of files from the Feature Class using the SearchCursor function.

  3. I'm running into problems using the generated list(s) to actually create the MULTIPOINT Feature Classes.

Here is my code:

# Import modules
import arcpy, os, sys, traceback
from arcpy import env


# generate a list of ascii files from the area-subset feature classes
env.workspace=r"F:\RTAMS\Petawawa\11-Library\LEGEO_Aug2012\LEGEO_Aug2012.gdb\LiDAR_ASCII"
fc=arcpy.ListFeatureClasses()

for fc in fc:
    cur=arcpy.SearchCursor (fc)

    for row in cur:
        fileName=row.TILENAME

        #this is the location of the ASCII files we want to import, so we change the workspace
        env.workspace=r"F:\RTAMS\Petawawa\11-Library\LEGEO_Aug2012\LiDAR\UTM18_WGS84\ASCII\FEATURES"

        # we should now have a list of files, which we will use to import into area-subset MULTIPOINT files
        # we set up some parameters for the ASCII3D to Feature Class tool

        try:
            arcpy.CheckOutExtension("3D")
            outWorkspace=r"F:\RTAMS\Petawawa\11-Library\LEGEO_Aug2012\LEGEO_Aug2012.gdb\LiDAR_ASCII_to_MULTIPOINT"
            inFormat="GENERATE"
            outFC=os.path.join(outWorkspace,fc+"_a")
            outType="MULTIPOINT"
            # find the ascii files listed in the search cursor
            txtList=arcpy.ListFiles(fileName)
            #Execute the ASCII3D_to_Feature_Class
            arcpy.ASCII3DToFeatureClass_3d(txtList,inFormat,outFC,outType)
            print outFC + " is complete."

        except arcpy.ExecuteError:
            print arcpy.GetMessages()

        except:
            # Get the traceback object
            tb = sys.exc_info()[2]
            tbinfo = traceback.format_tb(tb)[0]
            # Concatenate error information into message string
            pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\
                .format(tbinfo, str(sys.exc_info()[1]))
            msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2))
            # Return python error messages for script tool or Python Window
            arcpy.AddError(pymsg)
            arcpy.AddError(msgs)

Hoping you can help me out.

share|improve this question
1  
What kind of errors are you receiving? –  om_henners Dec 7 '12 at 23:06
    
What is the error message? Also if you have such a big dataset and you are using file geodatabases make sure you create the feature classes with the key word MAX_FILE_SIZE_256TB. –  Dowlers Dec 7 '12 at 23:14
    
This may be an aside but discussion here may be worth watching and contributing to if you are keen to have generation of all feature types from ASCII become as easy as it was in ArcInfo Workstation (with enhancements to cater for a few feature types that the old architecture did not support). –  PolyGeo Dec 10 '12 at 0:39
    
Thanks for the replies. I'm running into problems reading the list that was created from the shapefile. I think the problem was that during the list creation process I forgot to append the file extension to the file name, so that when it was looking for the reqisite file later on, it couldn't find one and would spit out an empty feature class. I now have a set of lists generated (visible when I use the print command), but the script still stops after the first output file which remains empty. How would I use the list to filter through the folder and find the required files? –  Rob Wiebe Dec 12 '12 at 15:07
    
Hi, have you tried converting 1 file at a time?, instead of passing the entire txtList into the arcpy.ASCII3DToFeatureClass_3d() maybe you could add a for loop and pass each file in seperatly and then merge them once the later on if needed –  dango Jan 4 '13 at 8:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.