Advertisement
maphew

arcgis agreggate points mem leak?

Aug 3rd, 2011
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. # http://gis.stackexchange.com/questions/12904/alternatives-to-arcgis-10-functionality/
  2. import os, sys, arcpy, time
  3. from arcpy import env
  4. env.workspace = 'D:/s/default.gdb'
  5.  
  6. scratchDB = 'D:/s/'
  7.  
  8. #point fc, 3938 points
  9. #from http://www.yukongis.ca/Data/Yukon_Place_Names, in file-gdb.
  10. geom = 'Z://no_scale.gdb/placenames_comprehensive'
  11.  
  12. def createGeom(geom, scratchDB):
  13.     filetime = (str(time.time())).split(".")
  14.     outfile = "fc" + filetime[0]+filetime[1]
  15.     outpath = scratchDB + "default.gdb/"  
  16.     outFeatureAggClass = outpath+outfile +"_Agg"
  17.     try:
  18.         arcpy.AggregatePoints_cartography(geom, outFeatureAggClass,"124000 meters")
  19.     except:
  20.         print arcpy.GetMessages(2)
  21.        
  22. for i in range(1,700):
  23.     start = time.time()
  24.    
  25.     createGeom(geom,scratchDB)
  26.    
  27.     end = time.time()
  28.     elapsed = end - start
  29.     minutes = elapsed / 60
  30.     print 'Iteration %s took %ss (%smin)' % (i,elapsed,minutes)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement