Class DecimalDegreesHelper
This class contains a static routine for converting between degree-minute-second measurement and decimal degree measurement. In essense, it is a routine for converting from a non-decimal degree unit to decimal degree unit distance.
public static class DecimalDegreesHelper- Inheritance
- 
      
      DecimalDegreesHelper
- Inherited Members
Methods
ConvertFromMgrs(string)
Convert the MGRS string to latitude and longitude
public static PointShape ConvertFromMgrs(string mgrs)Parameters
- mgrsstring
- MGRS string 
Returns
- PointShape
- The converted coordinate. 
ConvertToMgrs(double, double)
Convert the input latitude and longitude to MGRS string
public static string ConvertToMgrs(double latitude, double longitude)Parameters
Returns
- string
- The MGRS corresponding to input latitude and longitude. 
GetDecimalDegreeFromDegreesMinutesSeconds(int, int, double)
This method returns a decimal degree value based on a set of degrees, minutes, and seconds.
public static double GetDecimalDegreeFromDegreesMinutesSeconds(int degrees, int minutes, double seconds)Parameters
- degreesint
- This parameter represents the degree component of the degrees, minutes and seconds. 
- minutesint
- This parameter represents the minute component of the degrees, minutes and seconds. 
- secondsdouble
- This parameter represents the second component of the degrees, minutes and seconds. 
Returns
- double
- This method returns a decimal degree value based on a set of degrees, minutes, and seconds. 
Remarks
If you pass in 75, 21 and 28, the result passed back will be 75.2577777778.
GetDecimalDegreeFromDegreesMinutesSeconds(string)
This method returns a decimal degree value based on a string containing degrees, minutes, and seconds.
public static double GetDecimalDegreeFromDegreesMinutesSeconds(string degreesMinutesSeconds)Parameters
- degreesMinutesSecondsstring
- This parameter represents the degrees, minutes and seconds in a string. 
Returns
- double
- This method returns a decimal degree value based on a string containing degrees, minutes, and seconds. 
Remarks
If you pass in "75?21' 28''" as a string, then the result will be 75.35777777784.
GetDecimalDegreeFromDegreesMinutesSeconds(DegreesMinutesSeconds)
This method returns a decimal degree value based on a degree, minute and second structure.
public static double GetDecimalDegreeFromDegreesMinutesSeconds(DegreesMinutesSeconds degreesMinutesSeconds)Parameters
- degreesMinutesSecondsDegreesMinutesSeconds
- This structure represents the degrees, minutes and seconds. 
Returns
- double
- This method returns a decimal degree value based on a degree, minute and second structure. 
Remarks
If you pass in 75, 21 and 28, the result passed back will be 75.2577777778.
GetDegreesMinutesSecondsFromDecimalDegree(double)
This method returns a degrees, minutes and seconds structure from a decimal degree value.
public static DegreesMinutesSeconds GetDegreesMinutesSecondsFromDecimalDegree(double decimalDegreesValue)Parameters
- decimalDegreesValuedouble
- The decimal degree value you want to convert. 
Returns
- DegreesMinutesSeconds
- This method returns a degrees, minutes and seconds structure from a decimal degree value. 
Remarks
The method allows you pass in a decimal degree number and return the degree, minute, second as variables passed in on the method call.
GetDegreesMinutesSecondsStringFromDecimalDegree(double)
This method returns a string representation in degrees, minutes and seconds from a decimal degree value.
public static string GetDegreesMinutesSecondsStringFromDecimalDegree(double decimalDegreesValue)Parameters
- decimalDegreesValuedouble
- The number of decimal degrees to convert. 
Returns
- string
- This method returns a string representation in degrees, minutes and seconds from a decimal degree value. 
Remarks
Example: If you enter 75.358 as the number of decimal degrees, the result would be 75 degrees, 21 minutes, 28 seconds. Thus, the return string would be 75?21' 28".
GetDegreesMinutesSecondsStringFromDecimalDegree(double, int)
This method returns a string representation in degrees, minutes and seconds from a decimal degree value and a specified precision.
public static string GetDegreesMinutesSecondsStringFromDecimalDegree(double decimalDegreesValue, int decimals)Parameters
- decimalDegreesValuedouble
- The number of decimal degree to convert. 
- decimalsint
- The number of float decision for the second. 
Returns
- string
- This method returns a string representation in degrees, minutes and seconds from a decimal degree value. 
Remarks
Example: If you enter 75.358 as the number of decimal degree and 12 as decimals, the result would be 75 degrees, 21 minutes, 28.80000000015 seconds. Thus, the return string would be 75?21' 28.80000000015".
GetDegreesMinutesSecondsStringFromDecimalDegreePoint(Feature)
This method returns a string representation in degrees, minutes and seconds from a decimal degree value.
public static string GetDegreesMinutesSecondsStringFromDecimalDegreePoint(Feature point)Parameters
- pointFeature
- The feature whose decimal degrees to convert. 
Returns
- string
- This method returns a string representation in degrees, minutes and seconds from a decimal degree value. 
Remarks
None
GetDegreesMinutesSecondsStringFromDecimalDegreePoint(Feature, int)
This method returns a string representation in degrees, minutes and seconds from a decimal degree value.
public static string GetDegreesMinutesSecondsStringFromDecimalDegreePoint(Feature point, int decimalPlaces)Parameters
- pointFeature
- The feature whose decimal degrees to convert. 
- decimalPlacesint
- The number of decimal degree to convert. 
Returns
- string
- This method returns a string representation in degrees, minutes and seconds from a decimal degree value. 
Remarks
None
GetDegreesMinutesSecondsStringFromDecimalDegreePoint(PointShape)
This method returns a string representation in degrees, minutes and seconds from a decimal degree value.
public static string GetDegreesMinutesSecondsStringFromDecimalDegreePoint(PointShape pointShape)Parameters
- pointShapePointShape
- The point you want to convert. 
Returns
- string
- This method returns a string representation in degrees, minutes and seconds from a decimal degree value. 
Remarks
Passing in a point will return the point's location represented in degrees, minutes, and seconds. For example, if the point's location in decimal degrees is (75.358, 36.345), the actual returned string would be "75?21' 29''E 36?20' 42''N".
GetDegreesMinutesSecondsStringFromDecimalDegreePoint(PointShape, int)
This method returns a string representation in degrees, minutes and seconds from a decimal degree value.
public static string GetDegreesMinutesSecondsStringFromDecimalDegreePoint(PointShape pointShape, int decimals)Parameters
- pointShapePointShape
- The point of decimal degree to convert. 
- decimalsint
- The number of decimal degree to convert. 
Returns
- string
- This method returns a string representation in degrees, minutes and seconds from a decimal degree value. 
Remarks
None
GetDegreesMinutesStringFromDecimalDegreePoint(Feature)
This method returns a string representation in degrees and minutes from a decimal degree point.
public static string GetDegreesMinutesStringFromDecimalDegreePoint(Feature point)Parameters
- pointFeature
- The point you want to convert. 
Returns
- string
- This method returns a string representation in degrees and minutes from a decimal degree point. 
GetDegreesMinutesStringFromDecimalDegreePoint(Feature, int)
This method returns a string representation in degrees and minutes from a decimal degree point.
public static string GetDegreesMinutesStringFromDecimalDegreePoint(Feature point, int decimals)Parameters
- pointFeature
- The feature you want to convert. 
- decimalsint
- Number of decimals for the Minutes value 
Returns
- string
- This method returns a string representation in degrees and minutes from a decimal degree point. 
GetDegreesMinutesStringFromDecimalDegreePoint(PointShape)
This method returns a string representation in degrees and minutes from a decimal degree point.
public static string GetDegreesMinutesStringFromDecimalDegreePoint(PointShape pointShape)Parameters
- pointShapePointShape
Returns
- string
- This method returns a string representation in degrees and minutes from a decimal degree point. 
GetDegreesMinutesStringFromDecimalDegreePoint(PointShape, int)
This method returns a string representation in degrees and minutes from a decimal degree point.
public static string GetDegreesMinutesStringFromDecimalDegreePoint(PointShape pointShape, int decimals)Parameters
- pointShapePointShape
- decimalsint
- Number of decimals for the Minutes value 
Returns
- string
- This method returns a string representation in degrees and minutes from a decimal degree point. 
GetDistanceFromDecimalDegrees(double, double, double, double, DistanceUnit)
This method returns the distance between two decimal degree points.
public static double GetDistanceFromDecimalDegrees(double fromLatitude, double fromLongitude, double toLatitude, double toLongitude, DistanceUnit returningUnit)Parameters
- fromLatitudedouble
- This is the from latitude value. 
- fromLongitudedouble
- This is the from longitude value. 
- toLatitudedouble
- This is the to latitude value. 
- toLongitudedouble
- This is the to longitude value. 
- returningUnitDistanceUnit
- This is the distance unit you would like to use in the return value. For example, if you select miles as your returningUnit, then the distance will be returned in miles. 
Returns
- double
- This method returns the distance between two decimal degree points in the unit specified by the returningUnit parameter. 
Remarks
None
GetDistanceFromDecimalDegrees(Feature, Feature, DistanceUnit)
This method returns the distance between two decimal degree points.
public static double GetDistanceFromDecimalDegrees(Feature fromPointFeature, Feature toPointFeature, DistanceUnit returningUnit)Parameters
- fromPointFeatureFeature
- The feature you will measure from. 
- toPointFeatureFeature
- The feature you will measure to. 
- returningUnitDistanceUnit
- The unit you would like your results back in, such as miles or kilometers. 
Returns
- double
- This method returns the distance between two decimal degree points in the unit specified by the returningUnit parameter. 
Remarks
None
GetDistanceFromDecimalDegrees(PointShape, PointShape, DistanceUnit)
This method returns the distance between two decimal degree points.
public static double GetDistanceFromDecimalDegrees(PointShape fromPoint, PointShape toPoint, DistanceUnit returningUnit)Parameters
- fromPointPointShape
- The point shape you will measure from. 
- toPointPointShape
- The point shape you will measure to. 
- returningUnitDistanceUnit
- The unit you would like your results back in, such as miles or kilometers. 
Returns
- double
- This method returns the distance between two decimal degree points in the unit specified by the returningUnit parameter. 
Remarks
None
GetLatitudeDifferenceFromDistance(double, DistanceUnit)
Calculate the amount of longitude change given a certain distance and longitude.
public static double GetLatitudeDifferenceFromDistance(double distance, DistanceUnit distanceUnit)Parameters
- distancedouble
- The distance over which you would like to know the change in longitude. 
- distanceUnitDistanceUnit
- The unit the distance is in, such as miles or kilometers. 
Returns
- double
- Double representing the distance. 
Remarks
None
GetLongitudeDifferenceFromDistance(double, DistanceUnit, double)
Calculate the amount of longitude change given a certain distance and latitude.
public static double GetLongitudeDifferenceFromDistance(double distance, DistanceUnit distanceUnit, double latitude)Parameters
- distancedouble
- The distance over which you would like to know the change in longitude. 
- distanceUnitDistanceUnit
- The unit the distance is in, such as miles or kilometers. 
- latitudedouble
- The latitude on the globe that the distance is measured at. 
Returns
- double
- Double representing the distance. 
Remarks
None