Skip to main content

Class: GeodesicResampler

Defined in: src/sdk/geo/GeodesicResampler.ts:14

Resamples projected geodesic (great-circle) paths between defined endpoints into series of straight line segments.

Constructors​

Constructor​

new GeodesicResampler(minDistance, dpTolerance, maxDepth): GeodesicResampler

Defined in: src/sdk/geo/GeodesicResampler.ts:31

Constructor.

Parameters​

ParameterTypeDescription
minDistancenumberThe minimum geodesic distance this resampler enforces between two adjacent resampled points, in great-arc radians.
dpTolerancenumberThe Douglas-Peucker tolerance this resampler uses when deciding whether to discard a resampled point during the line simplification process.
maxDepthnumberThe maximum depth of the resampling algorithm used by this resampler. The number of resampled points is bounded from above by 2^[maxDepth] - 1.

Returns​

GeodesicResampler

Properties​

dpTolerance​

readonly dpTolerance: number

Defined in: src/sdk/geo/GeodesicResampler.ts:31

The Douglas-Peucker tolerance this resampler uses when deciding whether to discard a resampled point during the line simplification process.


maxDepth​

readonly maxDepth: number

Defined in: src/sdk/geo/GeodesicResampler.ts:31

The maximum depth of the resampling algorithm used by this resampler. The number of resampled points is bounded from above by 2^[maxDepth] - 1.


minDistance​

readonly minDistance: number

Defined in: src/sdk/geo/GeodesicResampler.ts:31

The minimum geodesic distance this resampler enforces between two adjacent resampled points, in great-arc radians.

Methods​

resample()​

resample(projection, start, end, handler): void

Defined in: src/sdk/geo/GeodesicResampler.ts:45

Resamples a projected geodesic (great-circle) path.

Parameters​

ParameterTypeDescription
projectionGeoProjectionThe projection to use.
startLatLonInterfaceThe start of the path.
endLatLonInterfaceThe end of the path.
handlerGeodesicResamplerHandlerA function to handle the resampled points. The function is called once for each resampled point, in order.

Returns​

void

Throws​

Error when the start and end of the path are antipodal.