import { isLoaded, load, execute, executeMany, supportsCurves } from "@arcgis/core/geometry/operators/geodeticDensifyOperator.js";const { isLoaded, load, execute, executeMany, supportsCurves } = await $arcgis.import("@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
curveType
- Type
- GeodeticCurveType | undefined
The type of geodetic curve used to densify the geometries.
- Default value
- "geodesic"
unit
- Type
- LengthUnit | undefined
The length unit of maxSegmentLength.
- Default value
- "meters"
Functions
| Name | Return Type | Object |
|---|---|---|
| | |
| | ||
| | ||
| | ||
(GeometryWithoutMeshUnion | null | undefined)[] | | |
| |
isLoaded
Indicates if all dependencies of this module have been loaded.
- Signature
-
isLoaded (): boolean
- Returns
- boolean
Returns
trueif this module's dependencies have been loaded.
load
Loads this module's dependencies. This method must be called first if isLoaded returns false.
- See also
- Signature
-
load (): Promise<void>
execute
Densifies the input geometry.
- Signature
-
execute (geometry: GeometryUnion, maxSegmentLength: number, options?: Options): GeometryWithoutMeshUnion | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| geometry | The input geometry to be densified. | | |
| maxSegmentLength | The maximum segment length allowed. Unless the | | |
| 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 geometryconst densifiedPolyline = geodeticDensifyOperator.execute(polyline, 100); executeMany
Densifies the input geometries.
- Signature
-
executeMany (geometries: GeometryUnion[], maxSegmentLength: number, options?: Options): (GeometryWithoutMeshUnion | null | undefined)[]
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| 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 | | |
| options | Additional options. | |
- Returns
- (GeometryWithoutMeshUnion | null | undefined)[]
Returns an array whose elements may either be densified geometries or null.