import { BaseTransformation } from '../transformation-types/BaseTransformation.js'; import type { Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, Geometry, TypedLineString, TypedPolygon, TypedMultiPoint, TypedMultiLineString, TypedMultiPolygon, TypedGeometry, Bbox } from '@allmaps/types'; import type { GeneralGcp, GeneralGcpAndDistortions, TransformationType, GeneralGcpTransformOptions, GeneralGcpTransformerOptions } from '../shared/types.js'; /** * Abstract class for Ground Control Point Transformers. * * This class contains all logic to transform geometries * made available trough the GeneralGcpTransform and GcpTransform classes. * * The extending GeneralGcpTransform class handles the general case where: * - We read in Ground Control Points using the GeneralGcp type, with `source` and `destination` fields. * - We use the terms 'forward' and 'backward' for the two transformations. * - Both source and destination space are exected to be 2D cartesian spaces with the same handedness (x- and y-axes have the same orientations). * * The extending GcpTransform class handles the typical Allmaps case where: * - We read in Ground Control Points using the Gcp type, with `resource` and `geo` fields. * - We use the terms 'toGeo' for the 'forward' transformation and 'toResource' for the 'backward' transformation. * - The `differentHandedness` setting is `true` by default, since we expect the resource coordinates to identify pixels on an image, with origin in the top left and the y-axis pointing down. * */ export declare abstract class BaseGcpTransformer { protected generalGcpsInternal: GeneralGcp[]; private sourcePointsInternal; private destinationPointsInternal; readonly type: TransformationType; protected transformerOptions: GeneralGcpTransformerOptions; protected forwardTransformation?: BaseTransformation; protected backwardTransformation?: BaseTransformation; /** * Create a BaseGcpTransformer * * @param generalGcps - An array of General Ground Control Points (GCPs) * @param type - The transformation type * @param partialGeneralGcpTransformerOptions - General GCP Transformer options */ constructor(generalGcps: GeneralGcp[], type?: TransformationType, partialGeneralGcpTransformerOptions?: Partial); /** * Get the forward transformation. Create if it doesn't exist yet. */ protected getForwardTransformationInternal(): BaseTransformation; /** * Get the backward transformation. Create if it doesn't exist yet. */ protected getBackwardTransformationInternal(): BaseTransformation; /** * Create the (forward or backward) transformation. * * Results in forward transformation if source and destination points are entered as such. * Results in backward if source points are entered for destination points and vice versa. * * Results in a transformation of this instance's transformation type. * * @param sourcePoints - source points * @param destinationPoints - destination points * @returns Transformation */ private createTransformation; /** * Get the resolution of the forward transformation in source space, within a given bbox. * * This informs you in how fine the warping is, in source space. * It can be useful e.g. to create a triangulation in source space * that is fine enough for this warping. * * It is obtained by transforming forward two linestring, * namely the horizontal and vertical midlines of the given bbox. * The forward transformation will refine these lines: * it will break them in small enough pieces to obtain a near continuous result. * Returned in the length of the shortest piece, measured in source coordinates. * * @param sourceBbox - BBox in source space where the resolution is requested * @param partialGeneralGcpTransformOptions - General GCP Transform options to consider during the transformation * @returns Resolution of the forward transformation in source space */ protected getForwardTransformationResolutionInternal(sourceBbox: Bbox, partialGeneralGcpTransformOptions: Partial): number | undefined; /** * Get the resolution of the backward transformation in destination space, within a given bbox. * * This informs you in how fine the warping is, in destination space. * It can be useful e.g. to create a triangulation in destination space * that is fine enough for this warping. * * It is obtained by transforming backward two linestring, * namely the horizontal and vertical midlines of the given bbox. * The backward transformation will refine these lines: * it will break them in small enough pieces to obtain a near continuous result. * Returned in the length of the shortest piece, measured in destination coordinates. * * @param destinationBbox - BBox in destination space where the resolution is requested * @param partialGeneralGcpTransformOptions - General GCP Transform options to consider during the transformation * @returns Resolution of the backward transformation in destination space */ protected getBackwardTransformationResolutionInternal(destinationBbox: Bbox, partialGeneralGcpTransformOptions: Partial): number | undefined; protected transformForwardInternal

(point: Point, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): P; protected transformForwardInternal

(lineString: LineString, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedLineString

; protected transformForwardInternal

(polygon: Polygon, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedPolygon

; protected transformForwardInternal

(multiPoint: MultiPoint, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedMultiPoint

; protected transformForwardInternal

(multiLineString: MultiLineString, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedMultiLineString

; protected transformForwardInternal

(multiPolygon: MultiPolygon, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedMultiPolygon

; protected transformForwardInternal

(geometry: Geometry, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedGeometry

; protected transformBackwardInternal

(point: Point, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): P; protected transformBackwardInternal

(lineString: LineString, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedLineString

; protected transformBackwardInternal

(polygon: Polygon, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedPolygon

; protected transformBackwardInternal

(multiPoint: MultiPoint, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedMultiPoint

; protected transformBackwardInternal

(multiLineString: MultiLineString, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedMultiLineString

; protected transformBackwardInternal

(multiPolygon: MultiPolygon, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedMultiPolygon

; protected transformBackwardInternal

(geometry: Geometry, partialGeneralGcpTransformOptions?: Partial, generalGcpToP?: (generalGcp: GeneralGcpAndDistortions) => P): TypedGeometry

; private transformPointForwardInternal; private transformPointBackwardInternal; private transformLineStringForwardInternal; private transformLineStringBackwardInternal; private transformRingForwardInternal; private transformRingBackwardInternal; private transformPolygonForwardInternal; private transformPolygonBackwardInternal; }