Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ria/reference/ReferenceProvider

A factory class for CoordinateReference instances. This factory allows you to:

  • Use an identifier to retrieve geospatial coordinate references. See getReference The most popular identification system for geospatial coordinate references is the EPSG Geodetic Parameter dataset.
  • Add new references that can be retrieved later through an identifier. See addReference.
  • Parse Well-Known Text (WKT) strings into coordinate references. See parseWellKnownText.
  • Create your own Cartesian coordinate reference. Cartesian coordinate references are used in a non-geospatial, charting context. See createCartesianReference.

Overview

Variables

Const supportedReferenceIdentifierPatterns

supportedReferenceIdentifierPatterns: RegExp[]

An array of reference identifier patterns that are supported by this reference provider. The patterns are returned as RegExp objects.

Functions

addReference

  • Adds a CoordinateReference to this reference provider.

    From the moment a reference is added to this reference provider it can be retrieved from the getReference method and isValidReferenceIdentifier will return true for the reference's identifier.

    There are two typical scenarios where this method can be used:

      const reference = parseWellKnownText(wktString);
      if (reference && reference.identifier) {
        // Add new reference to the ReferenceProvider if not present
        if (!isValidReferenceIdentifier(reference.identifier)) {
          addReference(reference);
        }
      }
      // Later, the reference can be obtained using the identifier
      const ref = getReference(reference.identifier);
    

    Parameters

    • reference: CoordinateReference

      The reference to be added to this reference provider.

    • Optional referenceId: string

      The identifier for the given reference. If no identifier is provided the reference.identifier property will be used as identifier. If reference.identifier is not defined, an exception will be thrown.

    Returns void

createCartesianReference

getHeightAboveTerrainReference

  • Retrieves the height above terrain spatial reference corresponding to the given identifier. The vertical reference of the returned reference is defined Above Terrain Surface. This has an effect on all the z-coordinates of your shapes, which will all be interpreted as a height offset from the terrain that is present in your map.

    The terrain of your map itself is defined in an Above Mean Sea Level (AMSL) reference. As such, a height above terrain reference should be considered as an offset on top of this AMSL terrain data.

    The isValidReferenceIdentifier function can be used to test if the reference corresponding to the given identifier is available in this reference provider. To add new references to this reference provider use addReference.

    To retrieve an Above Mean Sea Level (AMSL) reference, use getReference.

    Note that it is not possible to get a non-spatial height above terrain CoordinateReference

    Parameters

    • referenceIdentifier: string

      the reference identifier

    Returns CoordinateReference

    The requested spatial reference with its vertical reference defined as an offset on top of the terrain data of the map.

getReference

  • Retrieves the spatial reference corresponding to the given identifier. The vertical reference of the returned reference is defined as Above Mean Sea Level (AMSL).

    This has an effect on all the z-coordinates of your shapes, which will all be interpreted as AMSL.

    You can use the isValidReferenceIdentifier function to test if the reference corresponding to the given identifier is available in this reference provider. To add new references to this reference provider, use addReference.

    To retrieve a height above terrain reference, use * getHeightAboveTerrainReference.

    Parameters

    • referenceIdentifier: string

      the reference identifier

    Returns CoordinateReference

    The requested spatial reference, with its vertical reference defined Above Mean Sea Level (AMSL)

isValidReferenceIdentifier

  • (referenceIdentifier: string): boolean
  • Determines if the reference corresponding to the given identifier is available in this reference provider.

    To add new references to this reference provider, use addReference.

    The references available by default are:

    • CRS:1 (Image (pixel) coordinate reference)
    • CRS:84 (WGS 84)
    • CRS:83 (NAD 83)
    • EPSG:4326 (WGS 84)
    • EPSG:4979 (WGS 84 with ellipsoidal height)
    • EPSG:4267 (NAD 27)
    • EPSG:4269 (NAD 83)
    • EPSG:4978 (WGS 84 Geocentric)
    • EPSG:32662 (World Equidistant Cylindrical (Plate Carree))
    • EPSG:32663 (World Equidistant Cylindrical (Ellipsoidal))
    • EPSG:4087 (World Equidistant Cylindrical (Ellipsoidal))
    • EPSG:3395 (Mercator)
    • EPSG:3857 (Web Mercator)
    • EPSG:900913 (Web Mercator)
    • EPSG:3995 (Arctic Polar Stereographic)
    • EPSG:3031 (Antarctic Polar Stereographic)
    • EPSG:3996 (Australian Antarctic Polar Stereographic)
    • EPSG:3306 (Maupiti 83 / UTM zone 5S)
    • EPSG:23035 (Ed50 / 6° UTM zone 35 (CM27))
    • EPSG:23036 (Ed50 / 6° UTM zone 36 (CM33))
    • EPSG:23037 (Ed50 / 6° UTM zone 37 (CM39))
    • EPSG:23038 (Ed50 / 6° UTM zone 38 (CM45))
    • EPSG:2154 (RGF93 / Lambert-93)
    • EPSG:2206 (Ed50 / 3° GK zone 9 (CM27))
    • EPSG:2207 (Ed50 / 3° GK zone 10 (CM30))
    • EPSG:2208 (Ed50 / 3° GK zone 11 (CM33))
    • EPSG:2209 (Ed50 / 3° GK zone 12 (CM36))
    • EPSG:2210 (Ed50 / 3° GK zone 13 (CM39))
    • EPSG:2211 (Ed50 / 3° GK zone 14 (CM42))
    • EPSG:2212 (Ed50 / 3° GK zone 15 (CM45))
    • EPSG:2319 (ED50 / TM27)
    • EPSG:2320 (ED50 / TM30)
    • EPSG:2321 (ED50 / TM33)
    • EPSG:2322 (ED50 / TM36)
    • EPSG:2323 (ED50 / TM39)
    • EPSG:2324 (ED50 / TM42)
    • EPSG:2325 (ED50 / TM45)
    • EPSG:5253 (TUREF / TM27)
    • EPSG:5254 (TUREF / TM30)
    • EPSG:5255 (TUREF / TM33)
    • EPSG:5256 (TUREF / TM36)
    • EPSG:5257 (TUREF / TM39)
    • EPSG:5258 (TUREF / TM42)
    • EPSG:5259 (TUREF / TM45)
    • SR-ORG:7869 (ITRF96 / UTM Zone 35N)
    • SR-ORG:7870 (ITRF96 / UTM Zone 36N)
    • SR-ORG:7871 (ITRF96 / UTM Zone 37N)
    • SR-ORG:7872 (ITRF96 / UTM Zone 38N)
    • Luciad:XYZ (non-referenced 3D cartesian reference in meters)

    Parameters

    • referenceIdentifier: string

      the reference identifier

    Returns boolean

    true if the reference corresponding to the given identifier is available; false otherwise

parseWellKnownText

  • Parses a given WKT-string into a CoordinateReference object.

    Parameters

    • wktText: string

      A reference encoded as Well-Known Text (WKT).

    • Optional authorityName: string

      The name of the authority that specified the reference. For example, EPSG. By default, this information is parsed from the authority tags in the WKT string.

    • Optional authorityCode: string

      The identifier of the reference. For example, 4326. By default, this information is parsed from the authority tags in the WKT string.

    Returns CoordinateReference

    The reference corresponding to the WKT-string. If the authority name and code were not present in the WKT string or given when calling this method, the identifier of this reference is undefined

    To be able to get this CoordinateReference when you call getReference, you need to add it to the reference provider with addReference first.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method