ArcObjects Library Reference  (System)    

ILatLonFormat.GetDMS Method

Returns the degrees, minutes, and seconds for a lat/lon number.

[Visual Basic 6.0]
Sub GetDMS(
    ByVal Value As Double, _
    degrees As Long, _
    minutes As Long, _
    seconds As Double _
)
[Visual Basic .NET]
Public Sub GetDMS ( _
    ByVal Value As Double, _
    ByRef degrees As Integer, _
    ByRef minutes As Integer, _
    ByRef seconds As Double _
)
[C#]
public void GetDMS (
    double Value,
    ref int degrees,
    ref int minutes,
    ref double seconds
);
[Java]
public void getDMS (
    double Value,
    int degrees,
    int minutes,
    double seconds
)
throws
    IOException,
    AutomationException
[C++]
HRESULT GetDMS(
  double Value,
  long* degrees,
  long* minutes,
  double* seconds
);
[C++]

Parameters

Value [in]

  Value is a parameter of type double

degrees [out]

  degrees is a parameter of type long

minutes [out]

  minutes is a parameter of type long

seconds [out]

  seconds is a parameter of type double

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The GetDMS method returns the degrees, minutes, and seconds values for a given decimal degree latitudinal or longitudinal value.

To use it you should pass in the input decimal degree value and also pass in three double values representing the output degrees, minutes, and seconds that will be populated by the method.

[Visual Basic 6.0]

Sub LatLonTest()
  Dim pLatLonFormat As ILatLonFormat
  Set pLatLonFormat = New LatLonFormat

  Dim dValue as Double
  dValue = 45.253
 
  Dim lDegrees As Long, lMinutes As Long, dSeconds As Double

  ' The GetDMS method calculates degrees, minutes and seconds
  pLatLonFormat.GetDMS dValue, lDegrees, lMinutes, dSeconds

  MsgBox lDegrees & " degrees" & vbNewLine & lMinutes & _
  "minutes" & vbNewLine & dSeconds & " seconds", , "DMS(" & dValue & ")"
End Sub

See Also

ILatLonFormat Interface | IFractionFormat Interface | AngleFormat Class | IAngleFormat Interface | IPercentageFormat Interface | ICustomNumberFormat Interface | CurrencyFormat Class | LatLonFormat Class | FractionFormat Class | IRateFormat Interface | RateFormat Class | ILatLonFormat2 Interface | NumericFormat Class | CustomNumberFormat Class | INumericFormat Interface | PercentageFormat Class | IScientificNumberFormat Interface | ILatLonFormat Interface | INumberFormat Interface | ScientificFormat Class | IDMSGridLabel.LabelType Property | esriDMSGridLabelType Constants | IDMSGridLabel Interface | ILatLonFormat2 Interface | ILatLonFormat Interface

Example

LatLonFormat Example

 


Feedback Send feedback on this page