API / geotoolkit / map / coordinatesystems / Transformer / 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));Transformer
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
Constructors
• new Transformer(initSystem, targetSystem)
| Name | Type | Description |
|---|---|---|
initSystem | string | AbstractSystem | initial coordinate system |
targetSystem | string | AbstractSystem | target coordinate system |
• new Transformer(systems)
| Name | Type | Description |
|---|---|---|
systems | Options | options to specify initial and target coordinate systems |
Methods
▸ getClassName(): string
string
▸ getInitialCoordinateSystem(): AbstractSystem
Gets initial coordinate system
▸ getTargetCoordinateSystem(): AbstractSystem
Gets target coordinate system
▸ setInitialCoordinateSystem(system): Transformer
Sets initial coordinate system
| Name | Type | Description |
|---|---|---|
system | string | AbstractSystem | initial coordinate system |
this
▸ setTargetCoordinateSystem(system): Transformer
Sets target coordinate system
| Name | Type | Description |
|---|---|---|
system | string | AbstractSystem | target coordinate system |
this
▸ transform<T>(source, dst?): T
Returns transformed point, rectangle or polygonal geometry object
| Name | Type |
|---|---|
T | extends Point | Rect | PolygonGeometry |
| Name | Type | Description |
|---|---|---|
source | T | origin to be transformed |
Optional dst | T | optional destination object |
T
▸ transformPoint(point, dst?, clamp?): Point
Returns transformed point
| Name | Type | Description |
|---|---|---|
point | Point | to transform |
Optional dst | Point | optional destination point |
Optional clamp | boolean | if set to true, coordinate values will be clamped |
▸ transformPolygon(geometry, dst?): PolygonGeometry
Returns transformed polygonal geometry object
| Name | Type | Description |
|---|---|---|
geometry | PolygonGeometry | polygonal geometry object to transform |
Optional dst | PolygonGeometry | optional destination geometry |
▸ transformRect(rect, dst?): Rect
Returns transformed rectangle
▸ Static getClassName(): string
string