import { GcpAndDistortions, GcpTransformer, ProjectionFunction, TransformationType, TransformationTypeInputs } from '@allmaps/transform'; import { ProjectedGcpTransformerOptions, ProjectedGcpTransformOptions, Projection } from '../shared/types.js'; import type { GeoreferencedMap } from '@allmaps/annotation'; import type { Gcp, Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, Geometry, TypedLineString, TypedPolygon, TypedMultiPoint, TypedMultiLineString, TypedMultiPolygon, TypedGeometry } from '@allmaps/types'; /** * Class for Projected Ground Control Point Transformers. * * A Projected GCP Transformer can transform input geometries between 'resource' and 'projected geo' spaces. * * It does this using a transformation (of a certain type) built from * a set of Ground Control Points (with coordinates in * resource and geo space), a transformation type, * and an internal projection and projection. * * GCPs are expected in lon-lat 'EPSG:4326' (and are projected to the internal projection). * The default projection for the internal projection and projection is WebMercator 'EPSG:3857'. * * A postToGeo function is built from the internal projection to the projection (by default an identity projection). * A preToResource function is built from the projection to the internal projection (by default an identity projection). * * Like the GCP Transformer class it extends, * it has a method to transform 'toGeo' (from resource to projected geo space) * and 'toResource' (from projected geo to resource space), * * Like the GCP Transformer class it extends, * 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. * * @param internalProjection - the internal projection to which the GCPs (supplied in lon-lat 'EPSG:4326') are projected before building the transformation functions. * @param projection - the projection of the 'projected geo' space, in which the 'toGeo()' methods results its results. * @param internalProjectionToProjection - the postToGeo used to go from the internal projection to the projection. * @param projectionToInternalProjection - the preToResource function used to go from the projection to the internal projection. */ export declare class ProjectedGcpTransformer extends GcpTransformer { internalProjection: Projection; projection: Projection; internalProjectionToProjection: ProjectionFunction; projectionToInternalProjection: ProjectionFunction; lonLatToProjection: ProjectionFunction; projectionToLonLat: ProjectionFunction; /** * Create a ProjectedGcpTransformer * * @param gcps - An array of Ground Control Points (GCPs) in lon-lat 'EPSG:4326' * @param type - The transformation type * @param partialProjectedGcpTransformerOptions - Projected GCP Transformer options */ constructor(gcps: Gcp[], type?: TransformationType, partialProjectedGcpTransformerOptions?: Partial); /** * Get GCPs as they were inputed to the GCP Transformer. * * For a Projected GCP Transformer, these are the GCPs in projected coordinates. */ get gcps(): Gcp[]; /** * Get GCPs in interal projected coordinates. */ get lonlatGcps(): Gcp[]; /** * Get GCPs in interal projected coordinates. */ get interalProjectedGcps(): Gcp[]; /** * Get GCPs in projected coordinates. */ get projectedGcps(): Gcp[]; transformToGeo

(point: Point, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): P; transformToGeo

(lineString: LineString, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedLineString

; transformToGeo

(polygon: Polygon, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedPolygon

; transformToGeo

(multiPoint: MultiPoint, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedMultiPoint

; transformToGeo

(multiLineString: MultiLineString, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedMultiLineString

; transformToGeo

(multiPoint: MultiPolygon, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedMultiPolygon

; transformToGeo

(geometry: Geometry, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedGeometry

; transformToResource

(point: Point, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): P; transformToResource

(lineString: LineString, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedLineString

; transformToResource

(polygon: Polygon, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedPolygon

; transformToResource

(multiPoint: MultiPoint, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedMultiPoint

; transformToResource

(multiLineString: MultiLineString, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedMultiLineString

; transformToResource

(multiPolygon: MultiPolygon, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedMultiPolygon

; transformToResource

(geometry: Geometry, partialGcpTransformOptions?: Partial, gcpToP?: (gcp: GcpAndDistortions) => P): TypedGeometry

; /** * Create a Projected GCP Transformer from a Georeferenced Map * * @param georeferencedMap - A Georeferenced Map * @param options - Options, including Projected GCP Transformer Options, and a transformation type to overrule the type defined in the Georeferenced Map * @returns A Projected GCP Transformer */ static fromGeoreferencedMap(georeferencedMap: GeoreferencedMap, options?: Partial): ProjectedGcpTransformer; /** * Set the projection. * * To transform 'toGeo' or 'toResource' to or from a different projection * than set on a transformer's construction (but using the same internal projection) * it's possible to specify the requested projection in the transform options. * * This way we circumvent a possibly expensive recomputation * of the toGeo and/or toResource transformations. * * To do this more systematically, it's possible to set * a projected gcp transformer's projection using this method. * * Combine this with a deep clone of the transformer instance * to keep the original transformer as well. * * @returns this */ static setProjection(projectedTransformer: ProjectedGcpTransformer, projection: Projection): ProjectedGcpTransformer; }