ApsNadcon .NET Library

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

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

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

Parameters

latInDegNad83
the latitude (in decimal degrees) of the original coordinate in NAD83 datum
lonInDegNad83
the longitude (in decimal degrees) of the original coordinate in NAD83 datum
nadconRegion
a NADCON region
latInDegNad27
the latitude (in decimal degrees) of the result coordinate in NAD27 datum
lonInDegNad27
the longitude (in decimal degrees) of the result coordinate in NAD27 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.ConvertToNad27 method from C# code:

 double latInDegNad83 = 45.13;
 double lonInDegNad83 = -120.1313;

 ApsNadconRegion nadconRegion = ApsNadconRegion.ConterminousUS;
 
 double latInDegNad27 = Double.NaN;
 double lonInDegNad27 = Double.NaN;
 double latShiftInSec = Double.NaN;
 double lonShiftInSec = Double.NaN;
 
 string errorMessage = String.Empty;
 
 Console.WriteLine("Lat NAD83: " + latInDegNad83.ToString());
 Console.WriteLine("Lon NAD83: " + lonInDegNad83.ToString());
 
 if (!ApsNadcon.ConvertToNad27(latInDegNad83, lonInDegNad83, nadconRegion, out latInDegNad27, out lonInDegNad27, out latShiftInSec, out lonShiftInSec, out errorMessage))
 {
     Console.WriteLine("Error: " + errorMessage);
 }
 else
 {
     Console.WriteLine("Lat NAD27: " + latInDegNad27.ToString());
     Console.WriteLine("Lon NAD27: " + lonInDegNad27.ToString());
 }
 

See Also

ApsNadcon Class | ApsNadcon Namespace | ApsNadcon.ConvertToNad27 Overload List