geographicToDatum static method

ProjectionAdapter geographicToDatum(
  1. CoordRefSys targetCrs,
  2. Datum targetDatum
)

A projection adapter between WGS84 geographic and geographic positions on the target datum.

Use forward of the adapter to return a projection for:

  • source: lon and lat geographic coordinates (WGS 84)
  • target: lon and lat geographic coordinates on the target datum

Use inverse of the adapter to return a projection for:

  • source: lon and lat geographic coordinates on the target datum
  • target: lon and lat geographic coordinates (WGS 84)

The accuracy on conversions using other than the Datum.WGS84 datum is not guaranteed. The accuracy depends on the transformation parameter of the Helmert 7-parameter transformation used in the conversion.

Implementation

static ProjectionAdapter geographicToDatum(
  CoordRefSys targetCrs,
  Datum targetDatum,
) {
  return EllipsoidalProjectionAdapter.geographicToGeographic(
    // source is geographic coordinates in WGS 84
    sourceCrs: CoordRefSys.CRS84,
    sourceDatum: Datum.WGS84,

    // target is geographic coordinates on the target datum
    targetCrs: targetCrs,
    targetDatum: targetDatum,
  );
}