0

I am creating TIN out of each two cross sections and in the end I merge them all together and create a seamless TIN using python scripting. First I create all the TIN and save them somewhere in my local hard drive and finally I merge them. Someone told me there should be a way to do this process in the memory to save time and them create the final TIN and copy that in my hard drive. I already use feature layer for cross sections to expedite the process. I was wondering if there is still any trick I can use to lower the process time?

3

You are looking for the in_memory workspace. Though the files are generally relased upon closure of the application, it's generally a good idea to remove it from memory by running Delete. If you are using this in a loop, you'll want to delete the temporary files before creating a new one with the same name. At any rate, it saves memory.

For example:

featureclass = r"d:\data\test.shapefile"

tempfc = arcpy.CopyFeatures_management(featureclass, "in_memory/<temp name>")

#code here......

#Delete if necessary to conserve memory and cleanup
if arcpy.Exists(tempfc):
    arcpy.Delete_management(tempfc)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.