Raster Function Rendering Rules to apply a color ramp?

815
1
03-06-2019 06:37 AM
AustinBristow1
New Contributor

Does anyone have a working example using ESRI Leaflet to assign a color ramp to a DEM hosted as an ArcGIS REST ImageServer?

 

I've been using this documentation from ESRI and have managed to get a hillshade example working:

 

///Hillshade DEM
var renderingRule = {
 "rasterFunction":"Hillshade",
 "rasterFunctionArguments": {
 "Azimuth":315,
 "Altitude":45,
 "ZFactor":1
 },"variableName":"DEM"
};

var dem = L.esri.imageMapLayer({
 url: 'https://gis.arkansas.gov/arcgis/rest/services/ImageServices/DEM_1M_2018/ImageServer',
 renderingRule: renderingRule
});

 

But have had no luck applying a color ramp:

 

var renderingRuleTwo = {
 "rasterFunction" : "Colormap",
 "rasterFunctionArguments" : {
 "ColorrampName" : "Blue Bright"
 },
 "variableName" : "Raster"
};

var demTwo = L.esri.imageMapLayer({
 url: 'https://gis.arkansas.gov/arcgis/rest/services/ImageServices/DEM_1M_2018/ImageServer',
 renderingRule: renderingRuleTwo
});

 

Thanks in advance to anyone who can provide some insight!

 

Edit: Formatting

0 Kudos
1 Reply
JohnGravois
Frequent Contributor

in esri leaflet we're not doing anything special. we just pass through whatever JSON you supply.

if this thread isn't helpful, I'd recommend figuring out the appropriate syntax for your raster function directly at the REST endpoint and asking for help from image service experts if necessary.

https://gis.arkansas.gov/arcgis/rest/services/ImageServices/DEM_1M_2018/ImageServer/exportImage 

0 Kudos