Latitude/Longitude Format Conversions

Enumerations

enum  DEGTOSTRFLAGS {
  DEGTOSTRFLAG_NoDir = 0x00000000, DEGTOSTRFLAG_Longitude = 0x00000001, DEGTOSTRFLAG_Latitude = 0x00000002, DEGTOSTRFLAG_DirLast = 0x00000010,
  DEGTOSTRFLAG_DecDegs = 0x00000020, DEGTOSTRFLAG_DegDecMin = 0x00000040, DEGTOSTRFLAG_DegMinSec = 0x00000080, DEGTOSTRFLAG_Longitude360 = 0x00000100,
  DEGTOSTRFLAG_AutoPrecision = 0x00000200
}

Functions

LIBEXPORT MISTRING ConvertDegsToString (double value, DEGTOSTRFLAGS flags)
LIBEXPORT char * ConvertDegsToString (char *string, double value, DEGTOSTRFLAGS flags)
LIBEXPORT bool ConvertStringToDegs (const char *string, double *value)
LIBEXPORT void ConvLatLonToString (double degrees, char *string, DMSTYPE desttype, CONVDMSFLAGS flags, double confidence)
LIBEXPORT void ConvLatLonToString (double degrees, char *string, DMSTYPE desttype, CONVDMSFLAGS flags)
double ConvLatLonValue (double value, DMSTYPE srctype)
LIBEXPORT double ConvLatLonValue (const void *srcbuf, DMSTYPE srctype, void *destbuf, DMSTYPE desttype, CONVDMSFLAGS flags)
LIBEXPORT double ConvStringToLatLon (const char *string, DMSTYPE srctype, CONVDMSFLAGS flags=CONVDMSFLAG_None)
LIBEXPORT const char ** GetLatLonNames (void)
LIBEXPORT DMSTYPE GetLatLonType (int index)
LIBEXPORT ERRVALUE GetLatLonTypeList (SIMPLE_ARRAY< DMSTYPEANDNAME > &types)
LIBEXPORT MISTRING GetLatLonTypeStrAbbr (DMSTYPE type, CONVDMSFLAGS flags=CONVDMSFLAG_OUT_PutSpaces)

Enumeration Type Documentation

Enumerator:
DEGTOSTRFLAG_NoDir 

Don't include hemisphere (N,S,E,W) indicator.

DEGTOSTRFLAG_Longitude 

Format as longitude with E/W hemisphere indicator.

DEGTOSTRFLAG_Latitude 

Format as latitude with N/S hemisphere indicator.

DEGTOSTRFLAG_DirLast 

Put hemisphere indicator last.

DEGTOSTRFLAG_DecDegs 

Format as decimal degrees.

DEGTOSTRFLAG_DegDecMin 

Format as degrees and decimal minutes.

DEGTOSTRFLAG_DegMinSec 

Format as degrees, minutes and decimal seconds.

DEGTOSTRFLAG_Longitude360 

Display in range of W360 to E360.

DEGTOSTRFLAG_AutoPrecision 

Automatically determine precision, not including seconds/minutes if unnecessary.


Function Documentation

LIBEXPORT MISTRING ConvertDegsToString ( double  value,
DEGTOSTRFLAGS  flags 
)

Convert Latitude or Longitude value to MISTRING.

Returns:
MISTRING containing converted value.
See also:
ConvLatLonToString, ConvertStringToDegs
Parameters:
value Value to convert in degrees
flags Flags defining format
LIBEXPORT char* ConvertDegsToString ( char *  string,
double  value,
DEGTOSTRFLAGS  flags 
)

Convert Latitude or Longitude value to char* string.

Returns:
Pointer to string
See also:
ConvLatLonToString, ConvertStringToDegs
Parameters:
string String to hold result
value Value to convert in degrees
flags Flags defining format
LIBEXPORT bool ConvertStringToDegs ( const char *  string,
double *  value 
)

Convert Latitude or Longitude string to decimal degrees.

Returns:
true if successful, false if not

This function automatically recognizes the following formats:

D ddd mm ss.sss D indicates hemisphere (N, S, E or W) D ddd mm.mmmm and can be anywhere in the string D ddd.ddddd

[-]ddd mm ss.sss Sign (+ or -) is optional [-]ddd mm.mmmm Negative values indicate West and South [-]ddd.ddddd Do not type brackets []

See also:
ConvertStringToLatLon, ConvertDegsToString
LIBEXPORT void ConvLatLonToString ( double  degrees,
char *  string,
DMSTYPE  desttype,
CONVDMSFLAGS  flags,
double  confidence 
)

Convert Latitude/Longitude value to string with precision based on confidence value.

The "confidence" parameter should be based on the accuracy at which the value can be determined. For example, if converting from screen coordinates it would be based on the difference (in degrees) between two neighboring pixel coordinates. A value of zero will be considered "unknown" and the precision will be determined from the "desttype" parameter.

See also:
ConvStringToLatLon
Parameters:
degrees Value to convert
string String to hold result
desttype Destination format
flags CONVDMS_OUT_...
confidence Confidence value in degrees for determining report precision
LIBEXPORT void ConvLatLonToString ( double  degrees,
char *  string,
DMSTYPE  desttype,
CONVDMSFLAGS  flags 
)

Convert Latitude/Longitude value to string.

See also:
ConvStringToLatLon
Parameters:
degrees Value to convert
string String to hold result
desttype Destination format
flags CONVDMS_OUT_...
double ConvLatLonValue ( double  value,
DMSTYPE  srctype 
) [inline]

Convert double-precision value to decimal degrees.

Returns:
Converted value in degrees.
Parameters:
value Value to convert
srctype Source format
LIBEXPORT double ConvLatLonValue ( const void *  srcbuf,
DMSTYPE  srctype,
void *  destbuf,
DMSTYPE  desttype,
CONVDMSFLAGS  flags 
)

Convert value to decimal degrees and/or another LatLon format.

Returns:
Converted value in degrees.
Parameters:
srcbuf Pointer to source value, flags determine data type
srctype Source format
destbuf Pointer to destination location, NULL if not needed
desttype Destination format
flags Flags for input and output type
LIBEXPORT double ConvStringToLatLon ( const char *  string,
DMSTYPE  srctype,
CONVDMSFLAGS  flags = CONVDMSFLAG_None 
)

Convert string to decimal degrees.

Returns:
Converted value in degrees.
See also:
ConvertStringToDegs, ConvLatLonToString
Parameters:
string String to convert
srctype String format
flags None presently used
LIBEXPORT const char** GetLatLonNames ( void   ) 

Retrieve list of built-in latitude-longitude string formats.

Returns:
NULL-terminated array of strings containing format names.
Deprecated:
Use GetLatLonTypeList
LIBEXPORT DMSTYPE GetLatLonType ( int  index  ) 

Get latitude-longitude format conversion type for given index.

See also:
ConvLatLonValue, ConvLatLonToString, ConvStringToLatLon
Deprecated:
Use GetLatLonTypeList
LIBEXPORT ERRVALUE GetLatLonTypeList ( SIMPLE_ARRAY< DMSTYPEANDNAME > &  types  ) 

Retrieve list of built-in latitude-longitude string formats.

See also:
ConvLatLonValue, ConvLatLonToString, ConvStringToLatLon
LIBEXPORT MISTRING GetLatLonTypeStrAbbr ( DMSTYPE  type,
CONVDMSFLAGS  flags = CONVDMSFLAG_OUT_PutSpaces 
)

Get string for showing format type.

Returns:
Abbreviation string for use in user interface

Generated on Sun Oct 7 21:33:02 2012 for TNTsdk 2012 by  doxygen 1.6.1