Prepares default definitions, source transform, and destination transform
Optional
sourceCode: string | ProjectionParamsconvenience: if provided, we run this.setSource(sourceCode)
immediately
Optional
destCode: string | ProjectionParamsconvenience: if provided, we run this.setDestination(destCode)
immediately
an array of projection definitions for the transformer if needed
a record of EPSG codes to use for the transformer if needed
the grid readers
Insert a new NadGrid into the store
a nadgrid class to store
Add a grid given a data input
the key or name of the grid
the input data to parse
Forward projection from src projection to dest projection
const transformer = new Transformer();
transformer.setSource('EPSG_4326');
const point = transformer.forward({ x: 0, y: 0 });
vector point currently in the "source" projection
Optional
enforceAxis: booleanenforce axis ensures axis consistency relative to the final projection
Forward projection from src projection to dest projection
const transformer = new Transformer();
transformer.setSource('EPSG_4326');
const point = transformer.forward({ x: 0, y: 0 });
vector point currently in the "source" projection
Optional
enforceAxis: booleanenforce axis ensures axis consistency relative to the final projection
Get a grid from the store given a key or name
the key or name of the grid
Get a grid definition from a string
a single grid name to test against
Get grid definitions from a string name
Optional
keys: stringcomplex string of grid keys to test against
Insert a projection definition
import { Transformer, HotineObliqueMercator } from 'gis-tools-ts';
const transformer = new Transformer();
transformer.insertDefinition(HotineObliqueMercator);
a class that may be instatiated with future setSource and setDestination
optionally add projection reference names to add lookups to the definition
Insert an EPSG code definition
import { Transformer, EPSG_4326 } from 'gis-tools-ts';
const transformer = new Transformer();
transformer.insertEPSGCode('EPSG_4326', EPSG_4326);
EPSG code to insert e.g. "EPSG_4326" (uses underscore instead of colon)
the EPSG definition which is either a WKT string object or proj4 encoded string
Inverse projection from dest projection to src projection
const transformer = new Transformer();
transformer.setSource('EPSG_4326');
const point = transformer.inverse({ x: 0, y: 0 });
vector point currently in the "destination" projection
Optional
enforceAxis: booleanenforce axis ensures axis consistency relative to the final projection
Inverse projection from dest projection to src projection
const transformer = new Transformer();
transformer.setSource('EPSG_4326');
const point = transformer.inverse({ x: 0, y: 0 });
vector point currently in the "destination" projection
Optional
enforceAxis: booleanenforce axis ensures axis consistency relative to the final projection
Set the destination projection
can be a name or a coded definition
Set the source projection
can be a name or a coded definition
PROJ4 Transformer
Description
A Transformer class contains all projections necessary for converting coordinates from one projection to another. This is a modular class that can be extended to add new projections as needed to reduce code size and improve performance. Both forward and inverse projections are default set to wgs84.
Extends the NadGridStore class to support grid lookups
Usage
Full Example
Minimal Example only adding the Hotine Oblique Mercator