/** * 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. * * > [!WARNING] * > * > **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. * * @since 4.31 */ import type { LengthUnit } from "../../core/units.js"; import type { GeometryUnion, GeometryWithoutMeshUnion, GeodeticCurveType } from "../types.js"; /** @since 5.2 */ export interface GeodeticDensifyOptions { /** * The type of geodetic curve used to densify the geometries. * * @default "geodesic" */ curveType?: GeodeticCurveType; /** * The length unit of `maxSegmentLength`. * * @default "meters" */ unit?: LengthUnit; } /** * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [GeodeticDensifyOptions](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticDensifyOperator/#GeodeticDensifyOptions). */ export type Options = GeodeticDensifyOptions; /** * Indicates if all dependencies of this module have been loaded. * * @returns Returns `true` if this module's dependencies have been loaded. * @since 5.2 */ export function geodeticDensifyIsLoaded(): boolean; /** * Indicates if all dependencies of this module have been loaded. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [geodeticDensifyIsLoaded()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticDensifyOperator/#geodeticDensifyIsLoaded). * @returns Returns `true` if this module's dependencies have been loaded. */ export function isLoaded(): boolean; /** * Loads this module's dependencies. This method must be called first if `geodeticDensifyIsLoaded` returns `false`. * * @returns Resolves when the dependencies have been loaded. * @since 5.2 * @see [geodeticDensifyIsLoaded()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticDensifyOperator/#geodeticDensifyIsLoaded) */ export function geodeticDensifyLoad(): Promise; /** * Loads this module's dependencies. This method must be called first if `isLoaded` returns `false`. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [geodeticDensifyLoad()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticDensifyOperator/#geodeticDensifyLoad). * @returns Resolves when the dependencies have been loaded. * @see [isLoaded()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticDensifyOperator/#isLoaded) */ export function load(): Promise; /** * Densifies the input geometry. * * @param geometry - The input geometry to be densified. * @param maxSegmentLength - The maximum segment length allowed. Unless the `unit` option is set, the default is meters. Must be a positive value. * @param options - Additional options. * @returns Returns the densified geometry or null. Geometries with a dimension of < 1 are simply passed along. * @since 5.2 * @example * if (!geodeticDensifyIsLoaded()) { * await geodeticDensifyLoad(); * } * * // Densify a polyline geometry * const densifiedPolyline = geodeticDensifyExecute(polyline, 100); */ export function geodeticDensifyExecute(geometry: GeometryUnion, maxSegmentLength: number, options?: GeodeticDensifyOptions): GeometryWithoutMeshUnion | null | undefined; /** * Densifies the input geometry. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [geodeticDensifyExecute()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticDensifyOperator/#geodeticDensifyExecute). * @param geometry - The input geometry to be densified. * @param maxSegmentLength - The maximum segment length allowed. Unless the `unit` option is set, the default is meters. Must be a positive value. * @param options - Additional options. * @returns Returns the densified geometry or null. Geometries with a dimension of < 1 are simply passed along. * @example * if (!geodeticDensifyIsLoaded()) { * await geodeticDensifyLoad(); * } * * // Densify a polyline geometry * const densifiedPolyline = geodeticDensifyExecute(polyline, 100); */ export function execute(geometry: GeometryUnion, maxSegmentLength: number, options?: GeodeticDensifyOptions): GeometryWithoutMeshUnion | null | undefined; /** * Densifies the input geometries. * * @param geometries - The set of geometries to be densified. * All the geometries must have the same spatial reference. * @param maxSegmentLength - The maximum segment length allowed. Unless the `unit` option is set, the default is meters. Must be a positive value. * @param options - Additional options. * @returns Returns an array whose elements may either be densified geometries or null. * @since 5.2 */ export function geodeticDensifyExecuteMany(geometries: GeometryUnion[], maxSegmentLength: number, options?: GeodeticDensifyOptions): (GeometryWithoutMeshUnion | null | undefined)[]; /** * Densifies the input geometries. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [geodeticDensifyExecuteMany()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticDensifyOperator/#geodeticDensifyExecuteMany). * @param geometries - The set of geometries to be densified. * All the geometries must have the same spatial reference. * @param maxSegmentLength - The maximum segment length allowed. Unless the `unit` option is set, the default is meters. Must be a positive value. * @param options - Additional options. * @returns Returns an array whose elements may either be densified geometries or null. */ export function executeMany(geometries: GeometryUnion[], maxSegmentLength: number, options?: GeodeticDensifyOptions): (GeometryWithoutMeshUnion | null | undefined)[]; /** * 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. * * @since 5.2 */ export const geodeticDensifySupportsCurves: boolean | null | undefined; /** * 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. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [geodeticDensifySupportsCurves](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticDensifyOperator/#geodeticDensifySupportsCurves). */ export const supportsCurves: boolean | null | undefined;