convertDatum method

dynamic convertDatum(
  1. dynamic toDatum
)

Converts the lat and long object into a new datum (i.e. from WGS84 into OSGB36 ready to be translated to an OS Grid Reference)

Implementation

convertDatum(toDatum) {
  final oldCartesian = toCartesian(); //gets the current lat long coords as cartesian coordinates
  final newCartesian = oldCartesian.convertDatum(toDatum); //converts the cartesian coordinates to the new datum
  //final newLatLon = newCartesian.toLatLong(ellipsoids[toDatum["ellipsoid"]]); //converts the new cartesian coordinates back into lat and long of the new datum
  final newLatLon = newCartesian.toLatLong(toDatum); //converts the new cartesian coordinates back into lat and long of the new datum
  return newLatLon;
}