Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

arcpy.Intersect_analysis using Geometry object as input

$
0
0

Is there a way to run arcpy.Intersect_analysis using an arcpy.Geometry object as one of the input datasets?

I’ve tried different variations of the following, but I can’t seem to get it to work.

with arcpy.da.SearchCursor(input_feature_class, ["SHAPE@"], "ObjectID = 100") as cursor:
    for row in cursor:
        geometry = row[0]

intersection = arcpy.Intersect_analysis([geometry,input_feature_class], arcpy.Geometry(), output_type="POINT")[0]

Results in:

 File "C:Program Files (x86)ArcGISDesktop10.3ArcPyarcpyanalysis.py", line 289, in Intersect
raise e
 ValueError: DescribeGeometry: Unexpected error

I’m already using a feature layer and SelectLayerByAttribute to achieve the same thing. I’m curious as to why the above code doesn’t work.


Viewing all articles
Browse latest Browse all 767

Trending Articles