My problem: Using ArcPy I want to loop over buffers and select geometry_features inside each buffer and do something (update) only the objects found within that specific buffer. The code below explains what I want to do (more or less):
def _update_connections_inside_buffers(self): buffers = arcpy.SearchCursor(self.__buffer_class_name) in_layer = "connections" for i_buffer in buffers: shape = i_buffer.shape # can not use a geometry to do a selection.. very inconvenient!! connections = arcpy.SelectLayerByLocation_management(in_layer, "WITHIN", shape) self._update_connections(connections)
However: this will not work because SelectLayerByLocation_management() does not accept a geometry, "shape" as an argument but expects a feature_class_name (layer name). Is there a arcpy method that can do a search using a spatial predicate. I could not find how to do this from the ESRI manual.