colorModulation is used to display scanned surfaces of a point cloud in a more realistic way by adjusting the color to the intensity value captured by the scanner. The brightness of the color is reduced with lower intensity values, creating darker areas and helping to distinguish different parts of the scanned surface.
This sample shows how to get more information from a classified point cloud data by using intensity based color modulation.
// Intensity values can vary between 0 and 255. The values set here are
// minimum and maximum values of the Intensity field of the point cloud layer.
const colorModulation = {
field: "INTENSITY",
minValue: 35, // colors of points with this intensity value will be the darkest
maxValue: 211 // colors of points with maximum intensity value will be displayed the same
};
This property can be set on any renderer, in this sample we used the PointCloudUniqueValueRenderer which assigns colors to points based on a given classification:
const pcLayer = new PointCloudLayer({
url: "https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/SONOMA_AREA1_LiDAR_RGB/SceneServer",
renderer: {
type: "point-cloud-unique-value", // autocasts as new PointCloudUniqueValueRenderer()
field: "CLASS_CODE", // field containing data for standard LAS classification
colorModulation: colorModulation,
pointsPerInch: 35,
colorUniqueValueInfos: [
{
values: ["1"],
label: "Unclassified",
color: [178, 178, 178]
},
{
values: ["2"],
label: "Ground",
color: [168, 112, 0]
},
{
values: ["5"],
label: "High Vegetation",
color: [205, 245, 121]
},
{
values: ["6"],
label: "Building",
color: [229, 75, 65]
},
{
values: ["7"],
label: "Low Point(noise)",
color: [229, 0, 0]
},
{
values: ["9"],
label: "Water",
color: [0, 92, 230]
}]
}
});