AnsweredAssumed Answered

memory error with list

Question asked by lmwood on Nov 18, 2014
Latest reply on Nov 19, 2014 by jamesfreddyc

I am taking lats and longs from .csv and creating polygons I originally used them to make .shp files until I found about the 2GB limit.

So I thought I would use a .gdb for the feature class but I think I am running into another issue with the

featureList I am creating it has a memory error and stops at around 2 mil I believe.

What would be the best approach to create one large feature in a .gdb through a .csv that may have 3 mil or more.

I thought maybe reset the featureList but then lose the index if I append to the attribute table.

Ultimately I may have a need to join the orginal .csv to the feature class through a common index.

Any ideas appreciated I realize I may also be able to solve by using 10.2 with 64 bit however if I need to move to production I can not guarantee all users will have this and I read you would need to make sure of libraries are running 64 as well.

So for now assume Running arcGis 10.0 32bit

ps sorry about the code I do not see a button to format the code have not been on this new forum.

Thanks!!

 

 

featureList = []
coords=([(ullon_val, ullat_val),(urlon_val,urlat_val),
         (lrlon_val,lrlat_val),(lllon_val,lllat_val),(ullon_val, ullat_val)])
    array = arcpy.Array()
               
    for x, y in coords:
        array.add(arcpy.Point(x, y))

        # Add the first point of the array in to close off the polygon
        array.add(array.getObject(0))
        print array.getObject(0)
        # Create a Polygon object based on the array of points
        polygon = arcpy.Polygon(array)               
        # Clear the array for future use
        array.removeAll()
               
        # Append to the list of Polygon objects
        featureList.append(polygon)
        print sys.getsizeof(featureList)
        ##2097152  bytes in 2 megabytes
    try:
        arcpy.CopyFeatures_management(featureList,"D:/Footprints/process/Fgdb.gdb/test_3")
    except:
        # If an error occurred while running a tool print the messages
        print arcpy.GetMessages()

 

Message was edited by: Curtis Price - see Posting Code blocks in Esri GeoNet

Outcomes