dms2dec, dec2dms

dms2dec(dms)
  dec2dms(dec)

The dms2dec and dec2dms functions are for changing back and forth between the deprecated Texis/Vortex "degrees minutes seconds" (DMS) format (west-positive) and "decimal degree" format for latitude and longitude coordinates. All SQL geographical functions expect decimal degree parameters (the Vortex <code2geo> and <geo2code> Vortex functions expect Texis/Vortex DMS).

Texis/Vortex DMS values are of the format DDDMMSS. For example, 35°15' would be represented as 351500.

In decimal degrees, a degree is a whole digit, and minutes & seconds are represented as fractions of a degree. Therefore, 35°15' would be 35.25 in decimal degrees.

Note that the Texis/Vortex DMS format has west-positive longitudes (unlike ISO 6709 DMS format), and decimal degrees have east-positive longitudes. It is up to the caller to flip the sign of longitudes where needed.


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.