How can the 3D analyst slope tool be used with a File Geodatabase Raster Dataset?

1050
9
Jump to solution
11-29-2018 01:56 PM
SkySmith
New Contributor

This slope tool: Slope—Help | ArcGIS for Desktop 

is what I've been using on my regular raster TIFF files. However, I have a group of rasters that are File Geodatabase rasters, and the tool doesn't seem to work with them. I've tried both in the GUI and in ArcPy. The geodatabase rasters are about 13GB total, so converting them to regular TIFFS would be time and space consuming, and I'm not sure if that's actually possible..

I need to figure out how to use this slope tool with gdb rasters. Attached is my code, for reference. Any help is appreciated! 

0 Kudos
1 Solution

Accepted Solutions
CodyBenkelman
Esri Regular Contributor

Sky

you're correct that the slope raster is calculated 'on the fly', so it's a virtual raster not persisted to disk *unless* you explicitly save it.  If you load your elevation raster into the map and add the slope function (you can specify units = degrees or percent rise), you can then save this to disk by right clicking in the table of contents and running "Data --> Export" and be sure to specify extent (if not the full extent) and raster resolution (if not full resolution).  

If you're doing this programmatically and want to use a GP tool, input the layer (elevation raster with slope function applied) and save using Split Raster.  (If the elevation raster is really large, can output tiles, and then a mosaic dataset can compile those tiles into a virtual raster.)

However, it sounds like you don't really need the slope raster, but ultimately only need the individual slope values sampled at points defined by an input shapefile.  Your method for extracting samples should (?) work by inputting the layer into your "point slope extraction" tool.  Would it be hard to test that and let us know if it works?  

[I would suggest trying this FIRST, to save the disk space and processing time, unless you're sure you need to persist the slope raster]

I believe all of this should work with rasters inside GDBs, but I've always worked with raster files on disk, so there may be other issues I'm not aware of...  

Cody B

View solution in original post

9 Replies
DanPatterson_Retired
MVP Emeritus

skip the code for now, what are you specifying in the slope tools as your output file?  Have you tried a *.tif in a folder as the output? Doesn't seem to work suggests that there is a problem with the output otherwise you might have gotten an error

0 Kudos
SkySmith
New Contributor

Hi Dan,

Thanks for the response! I have tried naming the output raster file as a .tif, I have tried naming it without a file extension, I have tried to specify the output raster path so that the raster file ends up in a .gdb, and I have tried routing the raster to a regular folder. None of the combinations have worked thus far.. The error is the 999999 Error Executing function.

0 Kudos
DanPatterson_Retired
MVP Emeritus

your output tif isn't in a folder... you have to delete the U11.gdb portion of the path

0 Kudos
SkySmith
New Contributor

Right, that was what I tried first- the output tif in a regular folder, not in a .gdb.

0 Kudos
CodyBenkelman
Esri Regular Contributor

Sky

I have to admit I've never used the slope tool because I always use the slope raster function.

for Pro:  Slope function—ArcGIS Pro | ArcGIS Desktop 

for ArcMap:  Slope function—Help | ArcGIS for Desktop 

Have you tried that, or is there a reason it won't work for you?
Cody B. 

SkySmith
New Contributor

Hi Cody,

I don't generally work with functions, but I'm under the impression that my slope map would be a sort of "on the fly" projection if I used the slope function. I need my output to be a new raster comprised of slope values, so that I can extract slope values at point locations that I read in using a shapefile. Is there a way to get a new raster file using the slope function?

-Sky

0 Kudos
CodyBenkelman
Esri Regular Contributor

Sky

you're correct that the slope raster is calculated 'on the fly', so it's a virtual raster not persisted to disk *unless* you explicitly save it.  If you load your elevation raster into the map and add the slope function (you can specify units = degrees or percent rise), you can then save this to disk by right clicking in the table of contents and running "Data --> Export" and be sure to specify extent (if not the full extent) and raster resolution (if not full resolution).  

If you're doing this programmatically and want to use a GP tool, input the layer (elevation raster with slope function applied) and save using Split Raster.  (If the elevation raster is really large, can output tiles, and then a mosaic dataset can compile those tiles into a virtual raster.)

However, it sounds like you don't really need the slope raster, but ultimately only need the individual slope values sampled at points defined by an input shapefile.  Your method for extracting samples should (?) work by inputting the layer into your "point slope extraction" tool.  Would it be hard to test that and let us know if it works?  

[I would suggest trying this FIRST, to save the disk space and processing time, unless you're sure you need to persist the slope raster]

I believe all of this should work with rasters inside GDBs, but I've always worked with raster files on disk, so there may be other issues I'm not aware of...  

Cody B

SkySmith
New Contributor

Hi Cody B.

You're right- "However, it sounds like you don't really need the slope raster, but ultimately only need the individual slope values sampled at points defined by an input shapefile.  Your method for extracting samples should (?) work by inputting the layer into your "point slope extraction" tool. "

I added the slope function to my raster layer and was able to extract those values to my point shapefile without saving the slope raster to my disk. Thanks so much for the help! That's definitely the fastest way to do this.

0 Kudos
CodyBenkelman
Esri Regular Contributor

Sky 

Thanks for the feedback.  I try not to be heavy handed about telling people "you need to do it differently" but sometimes there are easier/better/faster methods!

In a similar vein, I typically recommend against storing rasters inside a database unless there's a really compelling reason.  If you have a need for that, I'm curious what is driving that requirement.
Cody 

0 Kudos