19

I have a series of continuous rasters representing the same phenomenon over time, so I need to use the same symbology across them all.

So I set the stretched symbology of the first raster, with a color ramp from the min/max values:

enter image description here

Now in the second raster, I import the symbology from the first raster. Unfortunately, although the labels match, the actual min/max values are not the same as the first layer:

enter image description here

So the red in the second raster corresponds to a value of 0.47, rather than 0.66.

How can I ensure that both rasters are using a consistent symbology?

4 Answers 4

22

Many thanks to @Erica for the reply, which for some reason didn't work for me.

But it did put me on the right track to finding a solution, which was to use the Minimum/Maximum Stretch, in combination with the Edit High/Low Values option:

enter image description here

Importing this symbology into the other rasters caused the correct stretch to be applied to all images.

5
  • I'm running into this same problem today. Did you also use the custom settings for the Statistics, or did you use just leave it on the default? Apr 2, 2014 at 7:50
  • 3
    This is the straightforward and most simple way to go. @Devdatta Tengshe: There is no need to use the Custom Settings in combination with Minimum-Maximum stretch and edited High/Low Values. Minimum-Maximum stretch is always linear (unless an additional Gamma Stretch is applied), and edited High/Low values override the Custom statistics.
    – lavarider
    Apr 2, 2014 at 9:02
  • 2
    Awesome, I learned an easier way :)
    – Erica
    Apr 2, 2014 at 14:13
  • I also just ran into this problem! This solution is great, but it would be even better if the link between layers were dynamic; if you set colours based on the raster with the largest range, but find that some rasters with a small range look "washed out", then you'll want to tweak the min/max a bit. However, when you do that, the other ramps don't update dynamically, and you end up having to go through the whole process of setting each layer's symbology again. Is anyone aware of a way to preserve a dynamic symbology link? Nov 28, 2017 at 21:38
  • Can @lavarider or someone explain a bit more about what happens to the values when you apply a gamma stretch on a min-max stretch with edited high/low values as described above? I have a series of rasters that I'm visualizing values changes in over time, however, the value range is such that there is not enough contrast to visualize much change. I was able to help the visualization by applying a gamma stretch (=4) to each raster. I'm not so concerned about the absolute values, but are the gamma-stretched values still comparable across rasters? If not, do you have any suggestions?
    – cms
    May 18, 2020 at 5:20
6

Right click on the raster layer in the TOC and select "Save As Layer File". Add your other raster to map, go to Layer Properties - Symbology tab, click import, find the saved layer file. Alternatively, you can apply the symbology of any raster in your map document to any other raster in your document by also clicking import but selecting the source raster symbology from the list.

EDIT: The values you are seeing in your screen shot #2 are the minimum and maximum values of the raster whose symbology you are trying to match to the one of your original raster. (If you check the properties - source tab - scroll down to statistic - Min and Max - these values are the same as those being reported on the symbology tab.

In order for all symbology to match, all rasters values have to fall within the same range of the symbology.

Design your symbology with a range that can accommodate ALL your rasters. In your case of the 2 rasters you showed: High: 0.66196 Low: 0140288 (High from raster 1 and low from raster 2). To do this, you have to change the Stretch Type to Minimum-Maximum. Once you do so, you will be edit the High and Low values of your desired symbology then save it as a layer file. If all your rasters fall withing the range you specified, and you apply the same layer file to all, the symbology will match.

I've been doing something similar with aerial imagery RGB Composite tiles but have just tested is with 2 completely different rasters; Land Information Ontario DEM version 2 20m resolution and Province wide SMRT3 DEM (90m resolution) and the symbologies match as expected.

FIGURE 1: Assume I already tweaked and saved a layer file to a min-max range i wanted (high 600, low 300). Here I am adding a new DEM raster of diferent dimensions and resolution but whose min, max range falls withing the symbology range: enter image description here

After you load the symbology into this raster: enter image description here

And here is how they match - you can't see where one DEM ends and the other begins, only that the cells are larger in the one compared to the other:

enter image description here

2
  • 1
    Thanks for the tip - however, this is what I was doing in the second screenshot of the original post, where you can see the max value of the ramp doesn't match that of the label. Apr 2, 2014 at 2:36
  • 1
    @StephenLead - I added more info to my answer. Apr 2, 2014 at 14:03
6

To apply the Layer file with python for all rasters with a certain name one could use:

# read in mxd file
mxd=arcpy.mapping.MapDocument(r"Path_To_MXD_File")

# read in all rasters in the mxd which have names starting with "test"
rasters=arcpy.mapping.ListLayers(mxd,"test*") 

# apply the symbology lyr file to the rasters
for r in rasters:

     arcpy.ApplySymbologyFromLayer_management(r,r"Path_To_Lyr_File")
5

Great question -- I needed to do something similar recently, and it is well-hidden! In the Symbology dialog that you show above, you need to scroll down. That will bring you to the "Stretch" dialog.

Tscroll down to find histogram specifics

By default, ArcMap will analyze the histogram and come up with its own best fit based on the statistics of a specific image. This optimizes the color ramp for each image, but isn't what you want -- you want ONE ramp for MANY images. Choose Type "Custom" and Statistics "From Custom Settings (below)", then enter values which cover the full min-max range of your rasters.

1
  • Thanks, this looks to be just what I need. Unfortunately I'm finding that it doesn't actually seem to work - although the range in the Symbology dialog now correctly shows the new min/max, the symbols on the map are unchanged (0.47 is still red). I'll test it some more then log a support call if necessary. Apr 1, 2014 at 21:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.