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

closed as unclear what you're asking by PolyGeo, Simbamangu, Chad Cooper, Mapperz Jun 15 at 18:35

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
What kind of errors are you receiving? –  om_henners Dec 7 '12 at 23:06
1  
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
    
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
1  
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
    
This is an old Question, but if we are to try and Answer it, then we will need you to edit it so that it reflects where you are currently stuck. Try to make the new form of the Question as clear and concise as you can. –  PolyGeo Jun 15 at 12:39

Browse other questions tagged or ask your own question.