POST
|
I must still be missing something here. The following prints class 'arcpy.Raster.Raster': elev = arcpy.Raster("some_dem.tif")
hillshade = arcpy.sa.Hillshade(elev)
print(type(hillshade)) ...which is a raster object, not a result object, and doesn't have a getOutput method. hillshade.isTemporary returns True, but the temporary raster output seems to persist in the scratch workspace after code completion/Pro restart/PC restart. Am I doing something incorrectly here?
... View more
03-25-2023
08:52 PM
|
0
|
1
|
676
|
POST
|
Thanks for the reply! My understanding of what should happen with rasters mostly comes from the Zandbergen book (pg. 328): "The result from running the Slope tool is stored only in memory as a temporary raster object." I suppose it doesn't make a ton of sense to assume this will always be the case, but this statement seems pretty explicit, especially in combination with everything from the previous page or so. I am, however, seeing now that I misread the official documentation on this, as it does specify "the output is a temporary raster object on disk". So, what's the default location for the temporary rasters?
... View more
03-25-2023
07:26 PM
|
0
|
0
|
684
|
POST
|
From Esri's documentation and Zandbergen's Python Scripting for ArcGIS Pro book, it seems that geoms = arcpy.management.CopyFeatures(in_fc, arcpy.Geometry()) (where in_fc is some input feature class) should write the geometry objects in the input feature class to memory, not a new feature class. This appears to be the case when running the code from a Jupyter Notebook in the browser or a .py file, but it writes out a new feature class if run from an ArcGIS Notebook in ArcGIS Pro (v 3.0.3). In this case, instead of containing the geometries, the geoms variable will contain the path to the new feature class as a string. Similarly, the same sources suggest something like hillshade = arcpy.sa.Hillshade(input_dem) should also just write output to memory until the save method is called. However, this code also creates a new raster when run from a Notebook in Pro. There seems to be some subtly to this that I'm missing. Can anyone shed some light on this? Is this expected behavior? Is there some setting I need to change to avoid producing a bunch of intermediate output?
... View more
03-22-2023
12:23 PM
|
1
|
6
|
745
|
Title | Kudos | Posted |
---|---|---|
1 | 03-22-2023 12:23 PM |
Online Status |
Offline
|
Date Last Visited |
03-27-2023
09:29 PM
|