I need to create a number of polygons in a loop from a raster. Essentially, the loop will call a function a number of times which needs to convert it to a polygon:
def myfunc(raster):
#do some raster processing
return arcpy.RasterToPolygon_conversion(raster, "in_memory\poly")
But the object it returns seemingly has nothing in it? The end result is I want to create a single shapefile from all the polygon features I will create. It seems silly to call RasterToPolygon, writing out a temporary shapefile for each polygon and then collecting them altogether as they will easily all fit in the RAM available.
Is there any way to output a Polygon geometry from RasterToPolygon ?. I.e, can I not do some thing like this:
poly = arcpy.RasterToPolygon_conversion(raster, arcpy.Polygon)