ApsNadcon .NET Library

ApsNadcon.ConvertToNad83(Double, Double, ApsNadconRegion, Double, Double, Double, Double, String) Method

Converts the specified geographic coordinate to NAD83 datum in the speciifed NADCON region.

public static bool ConvertToNad83(
   double latInDegNad27,
   double lonInDegNad27,
   ApsNadconRegion nadconRegion,
   out double latInDegNad83,
   out double lonInDegNad83,
   out double latShiftInSec,
   out double lonShiftInSec,
   out string errorMessage
);

Parameters

latInDegNad27
the latitude (in decimal degrees) of the original coordinate in NAD27 datum
lonInDegNad27
the longitude (in decimal degrees) of the original coordinate in NAD27 datum
nadconRegion
a NADCON region
latInDegNad83
the latitude (in decimal degrees) of the result coordinate in NAD83 datum
lonInDegNad83
the longitude (in decimal degrees) of the result coordinate in NAD83 datum
latShiftInSec
the result latitude shift in arc seconds
lonShiftInSec
the result longitude shift in arc seconds
errorMessage
an error message, passed by reference (out), that contains detailed error / warning information

Return Value

true - if the conversion succeeded, false - if it failed

Remarks

The function verifies validity of the input arguments before running the conversion. The valid latitude is a real number in the range from -90.0 (inclusive) to 90.0 (inclusive). The valid longitude is a real number in the range from -180.0 (inclusive) to -180.0 (inclusive). The function returns false, if the original geographic coordinate is outside the specified NADCON region.

Example

This sample shows how to call the ApsNadcon.ConvertToNad83 method from C# code:

double latInDegNad27 = 45.13;
double lonInDegNad27 = -120.1313;

ApsNadconRegion nadconRegion = ApsNadconRegion.ConterminousUS;

double latInDegNad83 = Double.NaN;
double lonInDegNad83 = Double.NaN;
double latShiftInSec = Double.NaN;
double lonShiftInSec = Double.NaN;

string errorMessage = String.Empty;

Console.WriteLine("Lat NAD27: " + latInDegNad27.ToString());
Console.WriteLine("Lon NAD27: " + lonInDegNad27.ToString());

if (!ApsNadcon.ConvertToNad83(latInDegNad27, lonInDegNad27, nadconRegion, out latInDegNad83, out lonInDegNad83, out latShiftInSec, out lonShiftInSec, out errorMessage))
{
    Console.WriteLine("Error: " + errorMessage);
}
else
{
    Console.WriteLine("Lat NAD83: " + latInDegNad83.ToString());
    Console.WriteLine("Lon NAD83: " + lonInDegNad83.ToString());
}

See Also

ApsNadcon Class | ApsNadcon Namespace | ApsNadcon.ConvertToNad83 Overload List