0

I want to accept feature set as input and convert it into feature layer or feature class so that I can use the input in select by location in the python script, as the select by location don't accept feature set as input.

For the graphicFeatureSet input I am drawing a polygon and for input_featureSet I am accepting to select featureSet within the drawn graphic layer. PS: I don't want to use the input type to feature class/layer it should be a feature set.

graphicFeatureSet = arcpy.GetParameterAsText(0)
input_featureSet = arcpy.GetParameterAsText(1)

arcpy.MakeFeatureLayer_management(graphicFeatureSet, "lyr")
arcpy.MakeFeatureLayer_management(input_featureSet, "input_lyr")

arcpy.SelectLayerByLocation("input_lyr","WITHIN", "lyr")

2

1 Answer 1

1

I'm not entirely clear what you are trying to accomplish. I also am not familiar with what a graphic feature set is.

If you wish to convert a feature set to an in memory feature class. You can use CopyFeatures_management

fc = arcpy.CopyFeatures_management(fs,"in_memory/origfs")

But I think feature sets can be used in place of a layer in SelectLayerByLocation. They are supposed to be faster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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