I am running multiple conditional selections, both where clauses with attributes and location based selections. I want to build functions, possibly within classes that are reusable and can pipe to each other or be scripted in different orders based on workflow. I DON'T want to
CopyFeatures_management constantly for intermediate features classes written to disc. I'm hoping for Python type:
temp = load_data(fp_data) temp2 = function1(temp) temp3 = function2(temp2) CopyFeatures_management(temp3)
Simple example of current workflow:
def select_by_location(fp_select, fp_location, distance_string, fp_out): arcpy.MakeFeatureLayer_management(fp_select, 'in_lyr') arcpy.MakeFeatureLayer_management(fp_location, 'location_lyr') arcpy.SelectLayerByLocation_management('in_lyr', 'within_a_distance', 'location_lyr', '5 Miles') arcpy.CopyFeatures_management('in_lyr', fp_out)
Call function with first feature layer:
select_by_location(fp1, fp2, '5 Miles')
Now take output and select with another feature layer:
fp_location2 = 'path/to/another/file'
arcpy.select_by_location(fp_out, fp_location2, '3 Miles', fp_out2)
What is a good protocol to avoid saving to disc constantly when in ArcPy world?