This API call has been replaced. See this page to find the new documentation.
Description
Adds a raster style.
Endpoint
/path/{pathId}/raster/style
Method
POST
Access Level Rules
Minimum Access Level
edit+
Processing Units
Minimum processing units
2
Parameters
Name
Description
Required
Default
pathId
The id of the raster layer.
true
name
The name of the layer to add.
true
method
Name of the visualization method. Must be one of the following:
- bandToColor
- hillShade
- vectorField
- rgb
- formula
- classToColor
true
parameters
The parameter for the visualization. See details on the required parameters for every styling method in the table below.
true
description
A description as string.
false
Default null.
Sample requests for different methods
//Assings bands to a specific color channel (red, green or blue)
{
"method": "rgb",
"name": "Create a false or true color image based on 3 bands",
"parameters": {
"bands": [
{
"bandNumber": 1,
"color": "red",
"bias": 1,
"weight": 8
},
{
"bandNumber": 2,
"color": "green",
"bias": -4,
"weight": 3
},
{
"bandNumber": 3,
"color": "blue",
"bias": -3,
"weight": 2.3
}
],
"alpha": 1,
"noData":[{"bandNumber":1,"fromValue":0,"toValue":1}]}
}
}
//Allows you to define bins. Colors are given based on the bin in which the pixel value falls.
{
"method": "bandToColor",
"name": "Map to a color based on a band value",
"parameters": {
"alpha": 1,
"bandNumber": 1,
"continuous": true,
"transitionPoints": [
{
"color": "#2A5C84",
"value": 0
},
{
"color": "#74AE56",
"value": 51
},
{
"color": "#FF8C01",
"value": 153
},
{
"color": "#ED2938",
"value": 204
}
],
"noData":[{"bandNumber":1,"fromValue":0,"toValue":1}]},
}
}
//Creates a terrainRgb based on the chosen band.
{
"method": "terrainRgb",
"name": "Create a terrain rgb image to display altitude in mapLibre or mapBox",
"parameters": {
"bandsNumber":1,
"alpha": 1,
"offset": 1,
"noData":[{"bandNumber":1,"fromValue":0,"toValue":1}]}
}
}
//Creats a hill shade for the chosen band.
{
"method": "hillShade",
"name": "Create a standard hill shade",
"parameters": {
"angle": 45,
"azimuth": 90,
"exaggerate": 1,
"bandNumber": 1,
"alpha": 1,
"noData":[{"bandNumber":1,"fromValue":0,"toValue":1}]}
}
}
//Uses the two chosen bands as the x and y direction of a vector field.
{
"method": "vectorField",
"name": "Create vector field out of 2 bands",
"parameters": {
"alpha": 1,
"xDirection": {
"bandNumber": 1,
"weight": 1,
"bias": 2
},
"yDirection": {
"bandNumber": 2,
"weight": 1,
"bias": 1
},
"clipValueMin": 1,
"clipValueMax": 10,
"noData":[{"bandNumber":1,"fromValue":0,"toValue":1}]}
}
}
//Allows you to perform band algebra and sent the result to a color.
{
"method":"formula",
"name":"pass a custom formula and map the result to a color"
"parameters":{
"formula": "2*band1 + band2",
"alpha": 1,
"continuous": true,
"transitionPoints":[{"color":"#2A5C84","value":25},{"color":"#74AE56","value":129.5},{"color":"#FFE733","value":234},{"color":"#FF8C01","value":338.5},{"color":"#ED2938","value":443}],
"noData":[{"bandNumber":1,"fromValue":0,"toValue":1}]}
}
}
//Allows you to assign specific pixel values to specific colors.
{
"method": "classToColor",
"name": "map an integer class to a color",
"parameters": {
"alpha": 1,
"bandNumber": 1,
"divisionFactor":1,
"transitionPoints": [
{
"color": "#2A5C84",
"value": 0
},
{
"color": "#74AE56",
"value": 1
},
{
"color": "#FFE733",
"value": 2
},
{
"color": "#FF8C01",
"value": 3
},
{
"color": "#ED2938",
"value": 4
}
],
"noData":[{"bandNumber":1,"fromValue":0,"toValue":1}]}
}
}