gis-tools-ts
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
195 lines (179 loc) • 7.56 kB
TypeScript
import { CoordOperation } from '.';
import { GridDescription, PJ_TYPE, pjIoUnits } from '../constants';
import type { DatumParams } from '../../readers/wkt';
import type { ProjectionTransform } from '.';
import type { VectorPoint } from '../../geometry';
/** Define the projection with all it's variable components */
export interface ProjectionParams {
todo?: string;
}
/** Base class for all projections */
export declare class ProjectionBase implements ProjectionTransform {
shortName: string;
static names: string[];
descr: string;
params: ProjectionParams;
/** Parent PJ of pipeline steps - undefined if not a pipeline step */
parent?: ProjectionTransform;
/*************************************************************************************
E L L I P S O I D P A R A M E T E R S
**************************************************************************************
Despite YAGNI, we add a large number of ellipsoidal shape parameters,
which are not yet set up in pj_init. They are, however, inexpensive to
compute, compared to the overall time taken for setting up the complex PJ
object (cf. e.g. https://en.wikipedia.org/wiki/Angular_eccentricity).
But during single point projections it will often be a useful thing to
have these readily available without having to recompute at every pj_fwd /
pj_inv call.
With this wide selection, we should be ready for quite a number of
geodetic algorithms, without having to incur further ABI breakage.
**************************************************************************************/
/** The linear parameters */
/** (F64) semimajor axis (radius if eccentricity==0) */
a: number;
/** (F64) semiminor axis */
b: number;
/** (F64) 1 / a */
ra: number;
/** (F64) 1 / b */
rb: number;
/** The eccentricities */
/** (F64) angular eccentricity */
alpha: number;
/** (F64) first eccentricity */
e: number;
/** (F64) first eccentricity squared */
es: number;
/** (F64) second eccentricity */
e2: number;
/** (F64) second eccentricity squared */
e2s: number;
/** (F64) third eccentricity */
e3: number;
/** (F64) third eccentricity squared */
e3s: number;
/** (F64) 1 - e^2 */
oneEs: number;
/** (F64) 1 / oneEs */
roneEs: number;
/** The flattenings */
/** (F64) first flattening */
f: number;
/** (F64) second flattening */
f2: number;
/** (F64) third flattening */
n: number;
/** (F64) 1 / f */
rf: number;
/** (F64) 1 / f2 */
rf2: number;
/** (F64) 1 / n */
rn: number;
/** This one's for GRS80 */
/** (F64) "Dynamic form factor" */
J: number;
/** (F64) es and a before any +proj related adjustment */
esOrig: number;
/** (F64) semimajor axis before any +proj related adjustment */
aOrig: number;
/*************************************************************************************
C O O R D I N A T E H A N D L I N G
**************************************************************************************/
/** (I32) Over-range flag */
over: number;
/** (I32) Geocentric latitude flag */
geoc: number;
/** (I32) proj=latlong ... not really a projection at all */
is_latlong: number;
/** (I32) proj=geocent ... not really a projection at all */
is_geocent: number;
/** (I32) 0 for operations that are purely cartesian */
need_ellps: number;
/** (I32) Whether to skip forward prepare */
skip_fwd_prepare: number;
/** (I32) Whether to skip forward finalize */
skip_fwd_finalize: number;
/** (I32) Whether to skip inverse prepare */
skip_inv_prepare: number;
/** (I32) Whether to skip inverse finalize */
skip_inv_finalize: number;
/** Flags for input/output coordinate types */
left: pjIoUnits;
right: pjIoUnits;
/** These PJs are used for implementing cs2cs style coordinate handling in the 4D API */
/*************************************************************************************
C A R T O G R A P H I C O F F S E T S
**************************************************************************************/
/** (F64) central meridian */
lam0: number;
/** (F64) central parallel */
phi0: number;
/** (F64) false easting */
x0: number;
/** (F64) false northing */
y0: number;
/** (F64) height origin */
z0: number;
/** (F64) time origin */
t0: number;
/*************************************************************************************
S C A L I N G
**************************************************************************************/
/** (F64) General scaling factor - e.g. the 0.9996 of UTM */
k0: number;
/** (F64) Plane coordinate scaling. Internal unit [m] */
to_meter: number;
/** (F64) Plane coordinate scaling. Internal unit [m] */
fr_meter: number;
/** (F64) Vertical scaling. Internal unit [m] */
vto_meter: number;
/** (F64) Vertical scaling. Internal unit [m] */
vfr_meter: number;
/*************************************************************************************
D A T U M S A N D H E I G H T S Y S T E M S
**************************************************************************************
It may be possible, and meaningful, to move the list parts of this up to
the PJ_CONTEXT level.
**************************************************************************************/
datum_type: number;
datum_params: DatumParams;
has_geoid_vgrids: number;
from_greenwich: number;
long_wrap_center: number;
is_long_wrap_set: number;
axis: [number, number, number, number];
/*************************************************************************************
ISO-19111 interface
**************************************************************************************/
iso_obj?: Record<string, unknown>;
iso_obj_is_coordinate_operation: boolean;
coordinateEpoch: number;
hasCoordinateEpoch: boolean;
lastWKT?: string;
lastPROJString?: string;
lastJSONString?: string;
gridsNeededAsked: boolean;
gridsNeeded: GridDescription[];
type: PJ_TYPE;
/*************************************************************************************
proj_create_crs_to_crs() alternative coordinate operations
**************************************************************************************/
alternativeCoordinateOperations?: CoordOperation[];
iCurCoordOp: number;
errorIfBestTransformationNotAvailable: boolean;
warnIfBestTransformationNotAvailable: boolean;
skipNonInstantiable: boolean;
/** @param params - projection specific parameters */
constructor(params?: ProjectionParams);
/**
* Forward projection from x-y to lon-lat. In this case, radians to degrees
* @param p - Vector Point. This is a placeholder for a lon-lat WGS84 point
*/
forward(p: VectorPoint): void;
/**
* Inverse projection from lon-lat to x-y. In this case, degrees to radians
* @param p - Vector Point. This is a placeholder for a lon-lat WGS84 point
*/
inverse(p: VectorPoint): void;
}
//# sourceMappingURL=base.d.ts.map