Skip to content

VolumeMeasurementAnalysis

ESM: import VolumeMeasurementAnalysis from "@arcgis/core/analysis/VolumeMeasurementAnalysis.js";
CDN: const VolumeMeasurementAnalysis = await $arcgis.import("@arcgis/core/analysis/VolumeMeasurementAnalysis.js");
Class: @arcgis/core/analysis/VolumeMeasurementAnalysis
Inheritance: VolumeMeasurementAnalysisAnalysisAccessor
Since: ArcGIS Maps SDK for JavaScript 4.34
beta

VolumeMeasurementAnalysis calculates and visualizes the volume of ground surfaces within a defined polygonal area, offering multiple measure types and displaying results in a 3D SceneView.

The measure type is set with the measureType property, and can be further customized using optional, type-specific options.

To display a volume measurement of a ground surface bounded by a given polygon:

Use the VolumeMeasurementAnalysisView3D to retrieve the analysis result.

// create analysis
const volumeMeasurementAnalysis = new VolumeMeasurementAnalysis({
  measureType: "stockpile", // if not set it defaults to "cut-fill"
  geometry: new Polygon({ }),
});

// add to scene view
view.analyses.add(volumeMeasurementAnalysis);

// retrieve the result from the analysis view once available
const analysisView = await view.whenAnalysisView(volumeMeasurementAnalysis);
await reactiveUtils.whenOnce(() => analysisView.result);

const result = analysisView.result;

To draw a volume measurement polygon interactively, use the VolumeMeasurementAnalysisView3D.place() method.

// cancel the placement operation at some later point
// by calling abortController.abort()
const abortController = new AbortController();

try {
  await analysisView.place({ signal: abortController.signal });
} catch (error) {
  if (error.name === "AbortError") {
    console.log("Placement operation was cancelled.");
  }
}

The analysis depends on the scene's spatial reference, and the length of the measured perimeter:

  • In Projected Coordinate Systems (PCS) apart from Web Mercator, used in local viewing mode:

    • There is no limit to the measurement's perimeter. This is the recommended setup for using the analysis as the accuracy is not compromised.
  • In Web Mercator PCS used in local viewing mode:

    • If the measurement's perimeter exceeds 10 km, the analysis is considered invalid due to potential accuracy issues.
  • In Geographic Coordinate Systems (GCS) and Web Mercator in global viewing mode:

    • If the measurement's perimeter exceeds 50 km, the analysis is considered invalid due to potential accuracy issues.

In certain situations (including information in Known Limitations below), the analysis result cannot be computed. Refer to the VolumeMeasurementAnalysisView3D.error property for more information.

Known Limitations

  • This analysis is only supported in a 3D SceneView.
  • The results of the tool vary depending on the zoom level, as changes in zoom level affect the level of detail (LOD) of the scene geometry.
  • If the view is too close or too far from the measurement polygon, the results will not be computed due to LOD-induced inaccuracies.
  • The target elevation of the fill plane ("cut-fill" measureType) is restricted to the range of -11 km and +9 km.
  • This analysis operates only on the non-transparent Map.ground, IntegratedMeshLayer and an IntegratedMesh3DTilesLayer.
  • This analysis does not support WGS 1984 spatial reference in a local viewingMode.
See also

Constructors

VolumeMeasurementAnalysis

Constructor
new VolumeMeasurementAnalysis(properties)
Parameter
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
Show inherited properties Hide inherited properties
Name Type Summary Class

The configuration used when the measureType is set to "cut-fill".

VolumeMeasurementAnalysis

The name of the class.

Accessor

Units used for displaying values in the UI.

VolumeMeasurementAnalysis

A polygon that defines the boundary for volume measurement computations and visualizations for all measure types.

VolumeMeasurementAnalysis

A user settable identifier for the analysis.

Analysis

Units used for interpreting input values.

VolumeMeasurementAnalysis

Specifies the desired volume measure type.

VolumeMeasurementAnalysis

The origin of the analysis.

Analysis
For VolumeMeasurementAnalysis the type is always "volume-measurement". VolumeMeasurementAnalysis

An automatically generated unique identifier assigned to the instance.

Analysis

Indicates whether the analysis is ready to be computed and interacted with in the view.

VolumeMeasurementAnalysis

Property Details

cutFillOptions

Property
cutFillOptions VolumeMeasurementCutFillOptionsautocast

The configuration used when the measureType is set to "cut-fill".

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

displayUnits

Property
displayUnits VolumeMeasurementDisplayUnitsautocast

Units used for displaying values in the UI.

geometry

Property
geometry Polygon |null |undefinedautocast

A polygon that defines the boundary for volume measurement computations and visualizations for all measure types.

If the polygon has z-values these will be ignored as the polygon will be projected on the ground.

Known Limitation

Polygons with multiple rings are currently not supported.

id

Inherited
Property
id String
Inherited from Analysis

A user settable identifier for the analysis. A unique value is automatically generated when the analysis is created if it is not set explicitly during construction.

inputUnits

Property
inputUnits VolumeMeasurementInputUnitsautocast

Units used for interpreting input values.

measureType

Property
measureType String

Specifies the desired volume measure type.

Mode Description
"cut-fill" Computes cut and fill volumes relative to a flat, horizontal surface defined by the input polygon. VolumeMeasurementCutFillOptions allows setting the elevation of the target surface and the unit of elevation.
"stockpile" Calculates cut and fill volumes against a surface approximated from the input polygon's control points.

Possible Values:"cut-fill" |"stockpile"

Default Value:"cut-fill"

origin

Inherited
Property
origin AnalysisOriginWebScene |null |undefinedautocast
Inherited from Analysis

The origin of the analysis. The origin can be of type web-scene when the analysis was applied from the WebScene.initialViewProperties or a Slide.

type

Property
type Stringreadonly

For VolumeMeasurementAnalysis the type is always "volume-measurement".

uid

Inherited
Property
uid Stringreadonly
Inherited from Analysis

An automatically generated unique identifier assigned to the instance. The unique id is generated each time the application is loaded.

valid

Property
valid Booleanreadonly

Indicates whether the analysis is ready to be computed and interacted with in the view. It requires the geometry to be a valid polygon whose first ring contains at least 4 points, with the first and last points being the same to close the polygon.

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

Accessor
this

Creates a deep clone of this object.

Analysis

Returns true if a named group of handles exist.

Accessor

Removes a group of handles owned by the object.

Accessor

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

clone

Inherited
Method
clone(){this}
Inherited from Analysis

Creates a deep clone of this object. Any properties that store values by reference will be assigned copies of the referenced values on the cloned instance.

Returns
Type Description
this A deep clone of the class instance that invoked this method.

hasHandles

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.