• 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