geoview-core
    Preparing search index...

    Class ProjectionAbstract

    Class used to handle functions for transforming projections

    Projection

    Index

    Constructors

    Properties

    CUSTOM_WKT_AND_NUM: { [wkt_num: string]: string } = {}
    CUSTOM_WKT_NUM: number = 1001
    PROJECTION_NAMES: Record<string, string> = ...

    constant used for the available projection names

    PROJECTIONS: Record<string, OLProjection> = {}

    List of supported projections and their OpenLayers projection

    Methods

    • Wrapper around OpenLayers get function that fetches a Projection object for the code specified.

      Parameters

      • projectionObj: TypeProjection | undefined

        A projection object with properties such as latestWkid, wkid, or wkt.

      Returns Projection | undefined

      — Projection object, or undefined if not in list.

    • Wrapper around OpenLayers get function that fetches a Projection object for the code specified.

      Parameters

      • projection: ProjectionLike

        A code string which is a combination of authority and identifier such as "EPSG:4326".

      Returns Projection

      Projection object, or undefined if not found.

    • Wrapper around OpenLayers get function that fetches a Projection object for the code specified.

      Parameters

      • customWKT: string

        A code string which is a combination of authority and identifier such as "EPSG:4326".

      Returns Projection

      Projection object, or undefined if not in list.

    • Reads an extent and verifies if it might be reversed (ymin,xmin,ymax,ymin) and when so puts it back in order (xmin,ymin,xmax,ymax).

      Parameters

      • projection: string

        The projection the extent is in

      • extent: Extent

        The extent to check

      Returns Extent

      The extent in order (xmin,ymin,xmax,ymax).

    • Wrapper around OpenLayers function to transforms a coordinate from one projection to another.

      Parameters

      • coordinate: Coordinate

        Longitude/latitude coordinate

      • inProjection: Projection

        Actual projection of the coordinate

      • outProjection: Projection

        Desired projection of the coordinate

      Returns Coordinate

      Coordinate as projected

    • Transforms an extent from source projection to destination projection. This returns a new extent (and does not modify the original).

      Parameters

      • extent: Extent

        The extent to transform.

      • source: Projection

        Source projection-like.

      • destination: Projection

        Destination projection-like.

      • stops: number = 25

        Optional number of stops per side used for the transform. The default value is 25.

      Returns Coordinate[]

      The densified extent transformed in the destination projection.

    • Transforms an extent from source projection to destination projection. This returns a new extent (and does not modify the original).

      Parameters

      • extent: Extent

        The extent to transform.

      • projection: TypeProjection | undefined

        An object containing a wkid or wkt property.

      • destination: Projection

        Destination projection-like.

      • Optionalstops: number

        Optional number of stops per side used for the transform. By default only the corners are used.

      Returns Extent

      The new extent transformed in the destination projection.

    • Transforms an extent from source projection to destination projection. This returns a new extent (and does not modify the original).

      Parameters

      • extent: Extent

        The extent to transform.

      • source: Projection

        Source projection-like.

      • destination: Projection

        Destination projection-like.

      • Optionalstops: number

        Optional number of stops per side used for the transform. By default only the corners are used.

      Returns Extent

      The new extent transformed in the destination projection.

    • Transforms an extent from source projection to destination projection. This returns a new extent (and does not modify the original).

      Parameters

      • extent: Extent

        The extent to transform.

      • wkid: number

        An EPSG id number.

      • destination: Projection

        Destination projection-like.

      • Optionalstops: number

        Optional number of stops per side used for the transform. By default only the corners are used.

      Returns Extent

      The new extent transformed in the destination projection.

    • Transforms an extent from source projection to destination projection. This returns a new extent (and does not modify the original).

      Parameters

      • extent: Extent

        The extent to transform.

      • customWKT: string

        A custom WKT projection.

      • destination: Projection

        Destination projection-like.

      • Optionalstops: number

        Optional number of stops per side used for the transform. By default only the corners are used.

      Returns Extent

      The new extent transformed in the destination projection.

    • Converts points from one projection to another using proj4

      Parameters

      • points: Coordinate[]

        Array of passed in points to convert

      • fromProj: string

        Projection to be converted from

      • toProj: string

        Projection to be converted to

      Returns number[][]