Using a raster function to set symbology

633
9
01-29-2021 05:09 AM
Labels (1)
Giannalogy
Occasional Contributor

Hi everyone, 

I'm trying to set the symbology on several hundred .tiff raster files. 

I need to customize the statistics and would like to symbolize using a stretch MinMax function on each raster. 

So I've set up the custom statistics in the raster function as below:

Giannalogy_0-1611923924391.png

From there, I've tried every combination of using Stretch and ColorMap functions but the result ends up with a classified symbology ranging from 0-255

Giannalogy_1-1611924236784.png

Any ideas?

9 Replies
DanPatterson
MVP Esteemed Contributor

Are they singleband tiff files?

Are the data integer or floating point?

What are the expected min and max's?

Do all rasters cover basically the same min and max range?


... sort of retired...
0 Kudos
Giannalogy
Occasional Contributor

Hi Dan, 

Singe-band 32-bit floats

mins and maxes somewhere in the ranges from 0-1000 of different meteorological indicators 

rasters in sets of four cover the same min/max ranges, 420 maps total

0 Kudos
DanPatterson
MVP Esteemed Contributor

If you did it manually, and it is single band, float, I would have expected a gray scale image  ie a color ramp, then stretched


... sort of retired...
0 Kudos
Giannalogy
Occasional Contributor

Yep but I've set my Raster and Imagery defaults to a different colorramp, should have mentioned. It would typically default to grayscale, but still be classified instead of stretch

0 Kudos
DanPatterson
MVP Esteemed Contributor

Raster rendering behavior—ArcGIS Pro | Documentation

the default resampling method is bilinear and the default stretch is minimum-maximum.

That is why I wonder why you mention ColorMap instead of ColorRamp


... sort of retired...
0 Kudos
Giannalogy
Occasional Contributor

I refer to the ColorMap raster function, which has colorRamp as an option within it

 

I have found a workaround to this by attaching a processing template which calcs the statistics (and does nothing else) and then set the rendering defaults to my desired symbology within ArcGIS Pro. 

But I'm looking for a solution to this symbology issue with raster functions because I'd like to publish it as an image service and have the correct symbology already applied instead of using client-side rendering to change the vis (which is was I'm doing now in Esri JS API)

0 Kudos
AndrewRitchie_CoL
New Contributor II

Did you ever find a solution Giannalogy?

I'm trying to publish an image service, with a predefined stretch/colour ramp and came up with the same workflow.

I've built the Raster Function template, but cannot get the Colormap and Stretch tools to work together - so I end up with the classified raster, same as you.

 

Giannalogy
Occasional Contributor

Hi Andrew,

No dice, I'm afraid. It seems like pretty buggy behaviour to me.

0 Kudos
AndrewRitchie_CoL
New Contributor II

Thanks. I can see that we are trying to apply two different visual functions, so they can't be chained. But the stretch function should allow you to apply a colour ramp.

It's also supposed to be possible from the Symbology tool:

AndrewRitchie_CoL_0-1633088876389.png

But this method doesn't work for me either. It manages to apply the correct color ramp, but seems to now think it's an RGB raster, and I lose access to the original band data.

AndrewRitchie_CoL_1-1633089551122.png

Time to lodge a case for this method - or try and hack the Raster Function xml :\