AnsweredAssumed Answered

Join

Question asked by CCweedcontrol on Feb 2, 2018
Latest reply on Feb 7, 2018 by CCweedcontrol

I am doing a basic join from a table to  feature class, it takes about 6 mins.

How can up make this faster?

 

import arcpy, fnmatch
from arcpy import env
from datetime import datetime as d
startTime = d.now()

env.overwriteOutput = 1
env.workspace = r"C:\Temp"
table = r"C:\Temp\PermitsIssued" 
 
shapefile = "TaxParcels" 

arcpy.MakeFeatureLayer_management(shapefile, "In_memory\parcelLyr") 

#Join table to feature layer 
arcpy.AddJoin_management("In_memory\parcelLyr", "PIN_ID", table, "PINNum", "KEEP_COMMON")

#Export joined layer to new feature clas 
arcpy.FeatureClassToFeatureClass_conversion("In_memory\parcelLyr", r"C:\Temp", "ParcelPermits.shp")

print 'Done'

try:
    print '(Elapsed time: ' + str(d.now() - startTime)[:-3] + ')'

except Exception, e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "Line %i" % tb.tb_lineno
    print e.message

Outcomes