Skip to main content

Class: RasterReprojector

Defined in: delatin.ts:143

RasterReprojector performs a Delaunay triangulation-based reprojection of a raster image.

It takes as input a set of functions to associate pixel positions with coordinates in the input and output CRS, as well as the dimensions of the output image, and it produces a triangulated mesh that can be used to reproject the input raster onto the output raster with bounded error.

Constructors

Constructor

new RasterReprojector(reprojectors, width, height?, options?): RasterReprojector

Defined in: delatin.ts:187

Parameters

reprojectors

ReprojectionFns

width

number

height?

number = width

options?
initialTriangulation?

InitialTriangulation

Returns

RasterReprojector

Properties

exactOutputPositions

exactOutputPositions: number[]

Defined in: delatin.ts:163

XY Positions in output CRS, computed via exact forward reprojection.


height

height: number

Defined in: delatin.ts:150

Height of the image in pixels


reprojectors

reprojectors: ReprojectionFns

Defined in: delatin.ts:144


triangles

triangles: number[]

Defined in: delatin.ts:168

triangle vertex indices


uvs

uvs: number[]

Defined in: delatin.ts:158

UV vertex coordinates (x, y), i.e. [x0, y0, x1, y1, ...]

These coordinates are floats that range from [0, 1] in both X and Y.


width

width: number

Defined in: delatin.ts:147

Width of the image in pixels

Methods

getMaxError()

getMaxError(): number

Defined in: delatin.ts:275

Returns

number


refine()

refine(): void

Defined in: delatin.ts:269

Returns

void


run()

run(maxError?, maxIterations?): void

Defined in: delatin.ts:246

Refine the mesh until its maximum error gets below the given one

Parameters

maxError?

number = DEFAULT_MAX_ERROR

The maximum reprojection error in input pixels that the mesh should achieve.

maxIterations?

Optional safeguard to prevent infinite loops in case of non-convergence. If the mesh fails to converge within this number of iterations, a warning will be logged and the function will return early.

maxIterations?

number = 10000

Returns

void

[return description]