Hi,
I try to zonal statistics as Table in script.
my workflow is
In this workflow, output of "PolygonToRaster" is temporal (finally delete).
So, I tried to save it at "in_memory" workspace, but not worked(crashed).
output raster size is about 5GB(save to gdb on HDD and check size), My memory is 32GB.Memory seems to be enough.
What should I do?
I use ArcGIS pro 1.4.1
Thanks in advance!
things to try and report
Also, report your cell size, extent, projection and snap raster used
What happens if you save the raster output to a defined workspace, and mark the Raster output as intermediate data.
A quick tour of managing intermediate data—Help | ArcGIS for Desktop
Deleting intermediate data—Help | ArcGIS for Desktop
Sorry for late reply
>Dan
I answer your questions.
1:No,it didn't fail.Saving to disk worked well.
2:I monitored memory consumption.When start PolygonToRaster, it increased about 10GB,then crash.
it doesn't seem to be memory capacity problem.
3:trying some smaller polygon,it didn't fail(crash)...
it's the matter of polygon(complex shape, a lot of vertices, lots of features in polygon)?
>Jayanta
Thanks for your information!
I set scratch workspace to "in_memory".
I'm sorry that this is not the problem of model builder...
>Also, report your cell size, extent, projection and snap raster used
I add these information.
extent and snap raster are not used.
cell size and projection are below.
arcpy.env.outputCoordinateSystem = arcpy.SpatialReference(4326)
arcpy.PolygonToRaster_conversion(feature_lyr, "OBJECTID", ras_feature, cellsize=0.00025)
Beyond the issues that can arise with 'in_memory I would just recommend adding Delete_management to your workflow since you have clearly identified that things work fine when saved to disk. It could be a combination of factors which would be hard to pin down.
Thanks
Though adding Delete_management , the problem still occurred.
I tried the script below.
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"C:\Data\check.gdb"
features = arcpy.ListFeatureClasses()
feature = features[0]
feature_lyr = "in_memory\\featureLyr"
arcpy.MakeFeatureLayer_management(feature, feature_lyr)ras_feature = "in_memory\\RasFeature"
arcpy.env.outputCoordinateSystem = arcpy.SpatialReference(4326)
arcpy.PolygonToRaster_conversion(feature_lyr, "OBJECTID", ras_feature, cellsize=0.00025)
When arcpy.PolygonToRaster_conversion, the script crashed. Because saving to the disk work, I try the modified script.
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"C:\Data\check.gdb"
features = arcpy.ListFeatureClasses()
feature = features[0]
feature_lyr = "in_memory\\featureLyr"
arcpy.MakeFeatureLayer_management(feature, feature_lyr)tmp = r"C:\Data\check.gdb\tmpRas"
ras_feature = "in_memory\\RasFeature"
arcpy.env.outputCoordinateSystem = arcpy.SpatialReference(4326)
arcpy.PolygonToRaster_conversion(feature_lyr, "OBJECTID", tmp, cellsize=0.00025)
arcpy.BuildRasterAttributeTable_management(tmp, "Overwrite")
arcpy.CopyRaster_management(tmp, ras_feature)
In this script, crash happened when arcpy.CopyRaster_management....
As you said, it's hard to pin down...
Sorry, I want clear... skip in_memory altogether, save interim results to disk and then add Delete_management to the workflow. Whatever is going on hardware/software-wise, in_memory isn't working in your workflow. In the end, you just don't want interim results kicking around (ie a purpose of in_memory useage) and Delete will handle that.
At least you can move forward with your work.