Select to view content in your preferred language

Rescale raster values to match elevation values

1895
5
Jump to solution
06-22-2020 10:11 AM
YusefSamari
Occasional Contributor

I am using ArcGIS Pro 2.5.1

I have just downloaded a raster of a UK digital terrain model from Ordnance Survey:

OS OpenData Supply - Download or order OS OpenData 

I have extracted the tiles of interest to me and created a raster from them using the Mosaic to New Raster tool.

I now have a single-band raster with cell values 0-255. I want to use the raster to display different elevation bands, so I would like to rescale these values to match the elevation values in metres of my area (Wales). The highest point in my area is 1085 m, so effectively I want to multiply each cell by (1085/255). 

First I tried changing the 'Max' value in the Statistics tab of the Symbology pane from 255 to 1085, but this had no effect I could see, and changed back when I clicked away and back to the Symbology pane.

I've tried using the Raster Calculator tool but I'm not sure if that's what I should be using. 

What is the best way to rescale the values in a raster?

0 Kudos
1 Solution

Accepted Solutions
DavidPike
MVP Frequent Contributor

Hi Yusef, something has gone wrong with your mosaic, there's no reason to be unbaking your 255 max value, and no guarantee they can be unbaked properly.

can you show your mosaic workflow and what format the tiles were supplied in?

View solution in original post

5 Replies
DavidPike
MVP Frequent Contributor

Hi Yusef, something has gone wrong with your mosaic, there's no reason to be unbaking your 255 max value, and no guarantee they can be unbaked properly.

can you show your mosaic workflow and what format the tiles were supplied in?

YusefSamari
Occasional Contributor

Hi David,

Thanks for your reply. I think you're right, I might well be doing something wrong in the mosaic. 

The data are supplied as a collection of ASC files, each one a 10km square tile, covering the entirety of Great Britain. If I drag an ASC file for an individual 10km square onto the map, it produces a raster with values of -20 (lowest point in metres on the DTM relative to sea level) to 1347 (summit of Ben Nevis, highest point in GB). These are the range of values I want for the mosaic.

For the Mosaic to New Raster tool I initially just used the default settings. It looked like this, except with a few hundred different .asc files as input rasters:

I see at least one mistake now - I used the default Pixel Type, when I should have changed it to '32 bit float', which is the pixel type of my input rasters. I've now changed the Pixel Type accordingly and re-run the tool.

The new output raster 'Test' has a value range -7.4 - 1079.2. This seems to makes sense, as one of the three 10km squares I used for the test run is mostly sea, and one contains the summit of Snowdon, which is roughly 1085m (and this is a 50m grid DTM so will be a little off). Would the Mosaic to New Raster tool automatically rescale the minimum and maximum values to match the minimum and maximum of the Input Rasters?

What seems strange though is that if I check the 'Statistics' of any of the three 10km square rasters I am using for the test run on their Layer Properties, they all match up to those of the larger GB dataset as a whole, even though they were downloaded as individual files. I know the minimum and maximum values for the 10km square ASC file below can't be correct, as it is inland, and should have a maximum of around 1080 as it contains Snowdon.

So these Statistics seem to be preset values. Is there a way to check the actual maximum and minimum values of the cells? That would confirm to me it has worked correctly.

Many thanks for your help.

0 Kudos
YusefSamari
Occasional Contributor

Update: I just ran a second test-run of the Mosaic to New Raster tool, this time adding the 10km square containing Ben Nevis to the input, and got an output with a maximum of ~1345, which checks out, so it seems the tool is automatically and correctly rescaling the minimum and maximum values to the raster tiles included in the Input Rasters. Looks like the issue was just me using the wrong Pixel Type. I would still be interested to know how to check the actual minimum and maximum cell values of a raster though.

0 Kudos
DavidPike
MVP Frequent Contributor

Hi Yusef, glad to hear it worked out.

Using the 'Calculate Statistics' tool should do what you're looking for. Keep the skip factor at 1 for both x and y. I think the default statistics upon loading are done using a higher skip factor for speed.

YusefSamari
Occasional Contributor

That's great David, thanks a lot!

0 Kudos