Interface TransformServiceInterface

Provide access to coordinate reference systems and to transforms between them.

For convenience, this service provides a transform from WGS 84 to local Cartesian coordinates, as well as the inverse transform. The local coordinate system will be relocated occasionally. Subscribe to the related signals to get notified when that occurs and recompute all local coordinates.

interface TransformServiceInterface {
    crsGlobal: ReferenceSystemInterface;
    crsLocal: ReferenceSystemInterface;
    globalToLocal: TransformInterface;
    localReferenceSystemReady: Promise<void>;
    localToGlobal: TransformInterface;
    onAfterLocalReferenceSystemChange: Signal<(() => void)>;
    onBeforeLocalReferenceSystemChange: Signal<(() => void)>;
    referenceSystems: ReferenceSystemInterface[];
    downloadProj4Definition(epsgName: string): Promise<void>;
    getReferenceSystem(name: string): ReferenceSystemInterface;
    getTransform(source: ReferenceSystemInterface, target: ReferenceSystemInterface): TransformInterface;
}

Properties

WGS 84 coordinate reference system (EPSG:4326)

Local working coordinate reference system (NAVVIS:LOCAL)

globalToLocal: TransformInterface

Transform from WGS 84 to the local working coordinate system

localReferenceSystemReady: Promise<void>

Promise that resolves when the local reference system has been set

localToGlobal: TransformInterface

Transform from local working coordinate system to WGS 84

onAfterLocalReferenceSystemChange: Signal<(() => void)>

Signal that is emitted after the local reference system has been changed

onBeforeLocalReferenceSystemChange: Signal<(() => void)>

Signal that is emitted before the local reference system is changed

referenceSystems: ReferenceSystemInterface[]

List of registered reference systems

Methods

  • Download the Proj.4 definition for the provided EPSG coordinate reference system and add it to Proj4js' definitions.

    Parameters

    • epsgName: string

      Name of the system, e.g. "EPSG:31468".

    Returns Promise<void>

    Promise that resolves when the download has completed.

  • Get a coordinate reference system by name (e.g. "EPSG:4326" or "NAVVIS:LOCAL").

    Throws a .ReferenceSystemNotFoundException if the reference system cannot be found.

    Parameters

    • name: string

      Reference system name (AUTHORITY:ID)

    Returns ReferenceSystemInterface