Raster Function Hillshade vs. Spatial Analyst

648
9
Jump to solution
09-22-2020 07:03 AM
GregoryBacon
Occasional Contributor

I'm trying to figure out why my raster function hillshade has a noticeably more coarse texture than a hillshade produced by the Spatial Analyst tool. In the image below, the image service with a raster function and the hillshades stored as files all have no contrast stretch and display using bilinear interpolation. The same azimuth and altitude parameters (defaults) were used to produce the hillshades. Also, a temporary raster produced by a hillshade raster function returns better results than the raster function I've saved and applied to my image service. Why the difference in appearance?

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
PeterBecker
Esri Regular Contributor

Gregory

Following is a sample of the data directly in ArcGIS Pro with the hillshade function applied (Ie in the native projection of the raster, Virginia NAD83 State Plane North)

The checker pattern that is seen is a result of the original data being resampled during the reprojection. Any resampling (including all reprojection) will cause artifacts in the data. I can not confirm but it would appear that nearest resampling was used (vs bilinear). It is highly recommended that source data is not resampled. If the data was collected in a specified projection, sampling and pixel alignments then is it best to keep it as it is and only resample if required for display. If resampled then use bilinear. The issue here is that the data is resampled and then applying hillshade will extenuate the artifacts. Further resampling will only make it worse. 

View solution in original post

Reply
0 Kudos
9 Replies
PeterBecker
Esri Regular Contributor

Primary difference is related to when the sampling is performed. Spatial Analyst (or a raster function directly on the source) will perform the hillshade on the data to create a hillshade greyscale image in the source projection. When you display it in a different projection the hillshade mage will be resampled. By default in a raster function the input rasters are sampled to the required output projection (and pixels size) and then the hillshade is applied. Note that with image server / raster functions you can also control if the function should be applied before or after the function is applied. IE are you applying the hillshade on each item or are you applying the hillshade on the service output? 

GregoryBacon
Occasional Contributor

Thanks for picking this up, Peter. Since I am not sure of the answer as to when this is applied (I believe it's the output), here is the service in question:

LiDAR/2018_LiDAR_Digital_Surface_Model (ImageServer) 

I added my raster functions through the ArcGIS Pro publishing process as follows:

Note that with image server / raster functions you can also control if the function should be applied before or after the function is applied. 

Do you mean to say "...before or after the projection is applied"? Where do I specify this? In ArcGIS Pro or the server manager?

Reply
0 Kudos
GregoryBacon
Occasional Contributor

Peter, I've tried some different coordinate systems but the result is the same as far as texture. Do you have any further ideas before I contact tech support? Thank you.

Reply
0 Kudos
PeterBecker
Esri Regular Contributor

Can you provide the coordinates of the area you are looking at. From the graphic I can see -77.2835062, 38.8017132 but that does not appear to be the same location. Preferably also send me a similar small section of the original DTM  (wihtout any resampling) that I can try on.

Reply
0 Kudos
GregoryBacon
Occasional Contributor

Peter,

Here is a link containing a .tif of the area shown above: ShareFile 

Thanks again for your help.

Reply
0 Kudos
GregoryBacon
Occasional Contributor

Peter,

USGS provides these 2018 LiDAR based rasters on their National Map Viewer as part of our agreement when the data was collected. They provide the data in UTM Zone 18N at 1-meter resolution whereas our data was delivered in Virginia NAD83 State Plane North (feet) as we requested. Our data's cell size is 2 feet. I've resampled our data to 1-meter and reprojected to UTM Zone 18N but I still get the same odd texture in the hillshade. The USGS rasters do not produce the texture that our data does; it is as smooth as I expected. 

Reply
0 Kudos
PeterBecker
Esri Regular Contributor

Gregory

Following is a sample of the data directly in ArcGIS Pro with the hillshade function applied (Ie in the native projection of the raster, Virginia NAD83 State Plane North)

The checker pattern that is seen is a result of the original data being resampled during the reprojection. Any resampling (including all reprojection) will cause artifacts in the data. I can not confirm but it would appear that nearest resampling was used (vs bilinear). It is highly recommended that source data is not resampled. If the data was collected in a specified projection, sampling and pixel alignments then is it best to keep it as it is and only resample if required for display. If resampled then use bilinear. The issue here is that the data is resampled and then applying hillshade will extenuate the artifacts. Further resampling will only make it worse. 

View solution in original post

Reply
0 Kudos
GregoryBacon
Occasional Contributor

Thanks, Peter. My request to have the data in state plane probably resulted in the vendor reprojecting my rasters prior to delivery, causing the artifacts in my hillshade. I went back to my LAS dataset and created a test raster using bilinear resampling and applied a hillshade function, producing the smooth results below. 

Reply
0 Kudos
GregoryBacon
Occasional Contributor

This has been resolved by the vendor and a new raster has by supplied to the image service, 2018 LiDAR Digital Terrain Model here. Thanks again.

Reply
0 Kudos