ghobart

Merge_management function selects wrong files from geodatabase

Discussion created by ghobart on Nov 7, 2011
Latest reply on Nov 22, 2011 by ghobart
I have a large 9.3 file geodatabase with about 1300 points files that comprise about 32 million points. I have written a custom python 2.6 script  that uses the 10.0 python arcpy geopressing libraries to accept a polygonal shapefile and using some other metadata shapefiles  determine which of the 1300 points files are within the polygon and then call the Merge_management function to combine them into a single file.  Everything works fine when there is only a few files being merged but I recently ran the script on a large area that had 33 different points files to be merged and it failed spectacularly by ignoring some files and merging totally random files instead from the database. I've printed out the arguments that are passed to the arcpy.Merge_management function and they are correct files but the function only manages to get about half of the correct files and then goes off and selects some of the other 1300 files to merge instead for the other half. I've repeated the process a couple of times and it consistently merges the same incorrect files each time. Has any one encountered this behaviour before? I haven't found anything online about it. If so does any one have and elegant work-around to handle this. I can probably brute force it by doing multiple smaller merges and then cascade them together but it will obviously be far more complicated and much slower. Thanks

Outcomes