Add style
Description
Adds a point cloud style.
Endpoint
/path/{pathId}/pointCloud/style
Method
POST
Access Level Rules
Minimum Access Level
edit+
Processing Units
Minimum processing units
2
Parameters
pathId
The id of the point cloud layer.
true
name
The name of the style to add.
true
parameters
The parameters for the style. See details below.
true
default
Boolean whether the style should be used as the default styling of the timestamp.
true
method
The method of the style, should be 'v2' to use the most recent styling framework.
true
description
A description of the style as string.
false
Default null.
dryRun
Boolean whether to to only check the validity of the style without instead of creating it.
false
Default null.
Sample requests for different methods
//Define the values of the three color channels using free expressions
{
"fill": {
"type": "channelMap", //must be channelMap
"channelMap": [
{
"expression": "band3", //An expression giving the value of the particular color channel
"channel": "red", //The color channel to place the expression outcome in
},
{
"expression": "band2", //An expression giving the value of the particular color channel
"channel": "green", //The color channel to place the expression outcome in
},
{
"expression": "band1", //An expression giving the value of the particular color channel
"channel": "blue", //The color channel to place the expression outcome in
}
],
},
"alphaMultiplier": 1,//A float between 0 and 1 to fade the image
"alpha": null, //An alpha object documented below
"noData":null, //A noData object documented below
"shade":null //A shade object documented below
}//Define conditions and assign colors based on those conditions
{
"fill": {
"type": "caseMap", //must be caseMap
"defaultTarget":{"color":"#FFE733"}, //Color to assign if all conditions evaluate false
"caseMap": [
{
"expression": "band1>0", //An expression to evaluate
"target": {"color":"#2A5C84"}, //The color to assign if the expression evaluates true
"label":"label" //An optional label to use in the legend
},
{
"expression": "band1>1", //An expression to evaluate
"target": {"color":"#74AE56"}, //The color to assign if the exxpression evaluates true
"label":"label" //An optional label to use in the legend
},
{
"expression": "and(band1>2, band2<0 )", //An expression to evaluate
"target": {"color":"#ED2938"}, //The color to assign if the expression evaluates true
"label":"label" //An optional label to use in the legend
}
],
},
"alphaMultiplier": 1,//A float between 0 and 1 to fade the image
"alpha": null, //An alpha object documented below
"noData":null, //A noData object documented below
"shade":null //A shade object documented below
}//Define an expression and sent the result to a color using ranges.
{
"fill": {
"type": "rangeMap", //must be rangeMap
"expression":"2*band1+5", //An expression whose output to apply the rangeMap to
"gradient":true, //A boolean indicating whether the color shoud fade from one range to the other
"rangeMap": [
{
"value": 1, //Start of the range
"target": {"color":"#2A5C84"}, //The color to assign if the output of the expression falls in this range
"label":"label" //An optional label to use in the legend
},
{
"value": 2, //Start of the range
"target": {"color":"#74AE56"}, //The color to assign if the output of the expression falls in this range
"label":"label" //An optional label to use in the legend
},
{
"value": 3, //Start of the range
"target": {"color":"#ED2938"}, //The color to assign if the output of the expression falls in this range
"label":"label" //An optional label to use in the legend
}
],
},
"alphaMultiplier": 1,//A float between 0 and 1 to fade the image
"alpha": null, //An alpha object documented below
"noData":null, //A noData object documented below
"shade":null //A shade object documented below
}//Define an expression and sent the result to a color based on a value to color map
{
"fill": {
"type": "valueMap", //must be valueMap
"expression":"2*band1+5", //An expression whose output to apply the valueMap to
"defaultTarget":"#FFE733", //Color to assing if the output of the expression does not match any of the values in the valueMap
"rangeMap": [
{
"value": 1, //Value to sent to the specific color. Must be integer
"target": {"color":"#2A5C84"}, //The color to assign if the output equals the given value
"label":"label" //An optional label to use in the legend
},
{
"value": 2, //Value to sent to the specific color. Must be integer
"target": {"color":"#74AE56"}, //The color to assign if the output equals the given value
"label":"label" //An optional label to use in the legend
},
{
"value": 3, //Value to sent to the specific color. Must be integer
"target": {"color":"#ED2938"}, //The color to assign if the output equals the given value
"label":"label" //An optional label to use in the legend
}
],
},
"alphaMultiplier": 1,//A float between 0 and 1 to fade the image
"alpha": null, //An alpha object documented below
"noData":null, //A noData object documented below
"shade":null //A shade object documented below
}Expressions
An expression is a string containing an expression outputting either a number or boolean.
In the expression you can use raster values by referencing the band:
band1, band2, band3, ...The expression can also contain standard operators such as:
*,+,-,/, floor(_),),(Lastly one can use these logical operators
&&, ||, !, ==,<=,<,>,>=,!=An expression can simply be the value of the band
expression = "band1"Or an expression can simply be a value
expression="1"Or boolean
expression="true"An example of an expression rendering a number:
expression = "(band1^2+band2^2)^(1/2)"An example of an expression rendering a boolean
expression = "!( band1 > 0 && band2>0)"Alpha object
The Alpha object can have two types. Expression Map and caseMap
In case of type expression the result of the expression will be used as alpha value. Mind that the alpha value will be clipped to 0 and 1.
alpha={type:"expressionMap", expression: "5*band1/2"}In case of type case, all expressions in the conditions are evaluated and the given value is assigned if the condition evaluates true.
alpha={"type":"caseMap", "caseMap":[{"expression": "band1>0 && band1<1" , "target":{"number":0.2}}, {"expression":"band1>1 && band1<2", "target":{"number":0.4}}] }NoData
NoData should be an expression outputting a boolean. True will make the output pixel transparent, false will make it non transparent.
noData="or(band1<0, band2==0)"Shade
Shade should be an object describing a hill shade.
shade={bandNumber:1, exaggerate:1, azimuth:90, factor:0.5, angle:45 }The bandNumber tells which band of the raster to interpret as altitude.
The factor should be between 0 and 1 and describes the weight with which to blend the shade into the output.
The exaggerate is used to multiply the band with.
The angle and azimuth describe the position of the sun in degrees.
RECOMMENDED READING
๐๏ธRaster styling methodsLast updated
Was this helpful?