Last updated

API / geotoolkit / map / coordinatesystems / Transformer / Transformer

Class: Transformer

coordinatesystems.Transformer.Transformer

Used to transform points from one CoordinateSystem to another.

Example

// transform points from one CoordinateSystem to another.
import {Transformer} from '@int/geotoolkit/map/coordinatesystems/Transformer';
import {GeodeticSystem} from '@int/geotoolkit/map/GeodeticSystem';
import {Point} from '@int/geotoolkit/util/Point';
...
const transform = new Transformer({
// initial system: latitude/longitude:
'initialcoordinatesystem': GeodeticSystem.LatLon,
// target system: WGS84:
'targetcoordinatesystem': GeodeticSystem.WGS84
});
transform.transform(new Point(longitude, latitude));

Hierarchy

Table of contents

Constructors
[new Transformer(initSystem, targetSystem)](/solutions/geotoolkit/apis/classes/geotoolkit.map.coordinatesystems.transformer.transformer.md#new transformer(initsystem, targetsystem))[new Transformer(systems)](/solutions/geotoolkit/apis/classes/geotoolkit.map.coordinatesystems.transformer.transformer.md#new transformer(systems))
Methods

Contents

Constructors

new Transformer(initSystem, targetSystem)

new Transformer(initSystem, targetSystem)

Parameters

Name Type Description
initSystemstring | AbstractSysteminitial coordinate system
targetSystemstring | AbstractSystemtarget coordinate system

new Transformer(systems)

new Transformer(systems)

Parameters

Name Type Description
systemsOptionsoptions to specify initial and target coordinate systems
Methods

getClassName

getClassName(): string

Returns

string


getInitialCoordinateSystem

getInitialCoordinateSystem(): AbstractSystem

Gets initial coordinate system

Returns

AbstractSystem


getTargetCoordinateSystem

getTargetCoordinateSystem(): AbstractSystem

Gets target coordinate system

Returns

AbstractSystem


setInitialCoordinateSystem

setInitialCoordinateSystem(system): Transformer

Sets initial coordinate system

Parameters

Name Type Description
systemstring | AbstractSysteminitial coordinate system

Returns

Transformer

this


setTargetCoordinateSystem

setTargetCoordinateSystem(system): Transformer

Sets target coordinate system

Parameters

Name Type Description
systemstring | AbstractSystemtarget coordinate system

Returns

Transformer

this


transform

transform<T>(source, dst?): T

Returns transformed point, rectangle or polygonal geometry object

Type parameters

NameType
Textends Point | Rect | PolygonGeometry

Parameters

Name Type Description
sourceTorigin to be transformed
Optional dstToptional destination object

Returns

T


transformPoint

transformPoint(point, dst?, clamp?): Point

Returns transformed point

Parameters

Name Type Description
pointPointto transform
Optional dstPointoptional destination point
Optional clampbooleanif set to true, coordinate values will be clamped

Returns

Point


transformPolygon

transformPolygon(geometry, dst?): PolygonGeometry

Returns transformed polygonal geometry object

Parameters

Name Type Description
geometryPolygonGeometrypolygonal geometry object to transform
Optional dstPolygonGeometryoptional destination geometry

Returns

PolygonGeometry


transformRect

transformRect(rect, dst?): Rect

Returns transformed rectangle

Parameters

Name Type Description
rectRectrectangle to transform
Optional dstRectoptional destination rectangle

Returns

Rect


getClassName

Static getClassName(): string

Returns

string