Skip to content
import { isLoaded, load, execute, executeMany, supportsCurves } from "@arcgis/core/geometry/operators/geodeticDensifyOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

Densifies line segments by length in a 2D plane, making them run along specified geodetic curves. There are no segments longer than the specified maximum segment length.

Notes

If you have an area of interest such as a visible extent, clip the input geometries before densifying to limit the amount of segments produced. Verify that isLoaded() returns true before using this module. Use load() to load this module's dependencies.

Type definitions

Options

Type definition

curveType

Property
Type
GeodeticCurveType | undefined

The type of geodetic curve used to densify the geometries.

Default value
"geodesic"

unit

Property
Type
LengthUnit | undefined

The length unit of maxSegmentLength.

Default value
"meters"

Functions

isLoaded

Function

Indicates if all dependencies of this module have been loaded.

Signature
isLoaded (): boolean
Returns
boolean

Returns true if this module's dependencies have been loaded.

load

Function

Loads this module's dependencies. This method must be called first if isLoaded returns false.

See also
Signature
load (): Promise<void>
Returns
Promise<void>

Resolves when the dependencies have been loaded.

execute

Function

Densifies the input geometry.

Signature
execute (geometry: GeometryUnion, maxSegmentLength: number, options?: Options): GeometryWithoutMeshUnion | null | undefined
Parameters
ParameterTypeDescriptionRequired
geometry

The input geometry to be densified.

maxSegmentLength

The maximum segment length allowed. Unless the unit option is set, the default is meters. Must be a positive value.

options

Additional options.

Returns
GeometryWithoutMeshUnion | null | undefined

Returns the densified geometry or null. Geometries with a dimension of < 1 are simply passed along.

Example
if (!geodeticDensifyOperator.isLoaded()) {
await geodeticDensifyOperator.load();
}
// Densify a polyline geometry
const densifiedPolyline = geodeticDensifyOperator.execute(polyline, 100);

executeMany

Function

Densifies the input geometries.

Signature
executeMany (geometries: GeometryUnion[], maxSegmentLength: number, options?: Options): (GeometryWithoutMeshUnion | null | undefined)[]
Parameters
ParameterTypeDescriptionRequired
geometries

The set of geometries to be densified. All the geometries must have the same spatial reference.

maxSegmentLength

The maximum segment length allowed. Unless the unit option is set, the default is meters. Must be a positive value.

options

Additional options.

Returns
(GeometryWithoutMeshUnion | null | undefined)[]

Returns an array whose elements may either be densified geometries or null.

Variables

supportsCurves

Variable

Indicates if the operator supports input geometries that contain curves. The value is null or undefined until the operator is loaded, then it will always be true. This will produce densified output geometries.

Type
boolean | null | undefined