|
OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimDms.h>
Public Member Functions | |
| ossimDms () | |
| Default constructor. More... | |
| ossimDms (double someDegrees, bool latFlag=true) | |
| Constructor ossimDms(double, bool) More... | |
| ossimDms (const std::string &value) | |
| ` Constructor. More... | |
| ossimString | toString (const ossimString &formatString=ossimString("")) const |
| You can specify a number of different formats. More... | |
| double | getDegrees () const |
| bool | getLatFlag () const |
| bool | setDegrees (const std::string &value) |
| setDegrees(char*). More... | |
| ossimDms & | setDegrees (double degrees) |
| ossimDms & | setLatFlag (bool latFlag) |
Static Public Attributes | |
| static const ossim_uint8 | theDegreeSign = 176 |
Private Member Functions | |
| ossimString | degree_to_string (double degrees, char format[], bool lat_flag) const |
| char * function degree_to_string More... | |
| void | calc_mins_or_secs (double *dd, std::string::const_iterator &formatIter, std::string &result) const |
| int | calc_mins_or_secs (double *dd, const char *format, char *res) const |
| integer function calc_mins_or_secs * calculates minutes from degrees, seconds from minutes, based on "format", returning the resultant string in "res". More... | |
| void | setup_printf (int ival, char *fmt) const |
| function setup_printf the C library function sprintf takes as its second argument, a format specifier. More... | |
| void | set_default (char *fp, char *rp) const |
| function set_default * assigns a default format to be used as the template for the conversion of the double precision value, degrees. More... | |
| void | init_values (double d) const |
| function init_values initializes the global values used throughout the function. More... | |
| double | string_to_degree (const std::string &cdegrees) |
| double function string_to_degree More... | |
Private Attributes | |
| double | theDegrees |
| bool | theLatFlag |
| double | theDecDegs |
| bool | theAfterDot |
| bool | theDoingSeconds |
| int | theIntDegs |
| int | theSign |
| double | theWorking |
Static Private Attributes | |
| static const char * | DEFAULT_FORMAT = "ddd mm.mmC" |
| static const char * | SPACES = " " |
Definition at line 19 of file ossimDms.h.
| ossimDms::ossimDms | ( | ) |
Default constructor.
Initializes to 0.0 degrees latitude.
Definition at line 27 of file ossimDms.cpp.
| ossimDms::ossimDms | ( | double | someDegrees, |
| bool | latFlag = true |
||
| ) |
Constructor ossimDms(double, bool)
You can construct a DMS class with a decimal degree and specify if its for the lat or lon.
latFlag true its for the lat false its for the lon
Definition at line 39 of file ossimDms.cpp.
| ossimDms::ossimDms | ( | const std::string & | value | ) |
` Constructor.
You can specify the value in a formated string. Example: "45N" will set the decimal degree to 45 and will set the lat flag to true
"45W" will set the internal degree to negative and set the lat flag to false.
Definition at line 51 of file ossimDms.cpp.
References string_to_degree(), and theDegrees.
|
private |
Definition at line 615 of file ossimDms.cpp.
References theAfterDot.
Referenced by degree_to_string(), and toString().
|
private |
integer function calc_mins_or_secs * calculates minutes from degrees, seconds from minutes,
based on "format", returning the resultant string in "res".
"dd" is the part of 'degrees' that provides
the value to manipulate. the integer returned as the
value of this function is the number of places in the
format that have been parsed here, to be used in the
main function to advance the format-parsing pointer.
Definition at line 679 of file ossimDms.cpp.
References setup_printf(), and theAfterDot.
|
private |
char * function degree_to_string
requires: dts.h
input: double precision, string, integer params returns: pointer to a string
purpose: to convert a double precision number "degrees" to a character string based on the input "format" and a flag indicating whether or not the degrees are latitude. If 'lat_flag' is TRUE, then degrees are latitude, otherwise they are longitude. default format: ddd mm.mmC
returns: a pointer to a string which contains the formatted degree value.
written as part of the DIAL facility, G&G, WHOI April 1992
Christine L. Hammond
Definition at line 475 of file ossimDms.cpp.
References calc_mins_or_secs(), init_values(), set_default(), setup_printf(), theAfterDot, theDecDegs, theDegreeSign, theIntDegs, and theWorking.
|
inline |
Definition at line 71 of file ossimDms.h.
Referenced by ossimNitfBlockaTag::converLocStringToPt(), ossimStatePlaneProjectionInfo::originLat(), ossimStatePlaneProjectionInfo::originLon(), ossimStatePlaneProjectionInfo::ossimStatePlaneProjectionInfo(), and ossimNitfProjectionFactory::parseGeographicString().
|
inline |
Definition at line 72 of file ossimDms.h.
|
private |
function init_values initializes the global values used throughout the function.
see notes in header file.
Definition at line 763 of file ossimDms.cpp.
References theAfterDot, theDecDegs, theDoingSeconds, theIntDegs, theSign, and theWorking.
Referenced by degree_to_string(), and toString().
|
private |
function set_default * assigns a default format to be used as the template for
the conversion of the double precision value, degrees.
either an error was detected in parsing the format that
the user entered, or no format was entered at all.
also, clears the result string of any characters which
may have been placed therein prior to the call here.
Definition at line 750 of file ossimDms.cpp.
References DEFAULT_FORMAT, and SPACES.
Referenced by degree_to_string().
| bool ossimDms::setDegrees | ( | const std::string & | value | ) |
setDegrees(char*).
Will allow you to set the internal paramters through a string. examples:
"45 5 6" will assume degrees minutes seconds "45" will assume degrees. "-45" "45W"
Definition at line 79 of file ossimDms.cpp.
References ossimString::c_str(), status, theAfterDot, theDegrees, theDegreeSign, theLatFlag, and theSign.
Referenced by ossimNitfBlockaTag::converLocStringToPt(), and ossimNitfProjectionFactory::parseGeographicString().
| ossimDms & ossimDms::setDegrees | ( | double | degrees | ) |
|
inline |
Definition at line 89 of file ossimDms.h.
Referenced by ossimNitfProjectionFactory::parseGeographicString().
|
private |
function setup_printf the C library function sprintf takes as its second argument, a format specifier.
this function constructs that specifier based on 'ival', an integer indicating the number of d's or m's or s's seen in the group just parsed.
Definition at line 727 of file ossimDms.cpp.
Referenced by calc_mins_or_secs(), and degree_to_string().
|
private |
double function string_to_degree
requires: dts.h input: string variable parameter returns: double precision number
purpose: to calculate a double precision number, representing degrees latitude or longitude, given a string "cdegrees". valid input consists of the following characters:
+, -, N, n, S, s, E, e, W, w – direction indicators
any digit [0-9]
a decimal point, '.' – says decimal degrees follow an ascii delimiter, for example ' ', TAB, '/' to indicate that either minutes or seconds follow.
output is a double precision number, which will be either latitude or longitude degrees and decimal degree
written as part of the DIAL facility, G&G, WHOI April 1992 Christine L. Hammond
Definition at line 807 of file ossimDms.cpp.
References theAfterDot, theLatFlag, and theSign.
Referenced by ossimDms().
| ossimString ossimDms::toString | ( | const ossimString & | formatString = ossimString("") | ) | const |
You can specify a number of different formats.
special characters:
@ is replaced with a degree character. ' minutes character " seconds character d replaced with degree portion m replaced with minute portion s replaced with second portion c or C replaces with N/S or E/W
examples for format string
Definition at line 294 of file ossimDms.cpp.
References abs, ossimString::begin(), calc_mins_or_secs(), DEFAULT_FORMAT, ossimString::end(), init_values(), ossimString::length(), theAfterDot, theDecDegs, theDegrees, theDegreeSign, theDoingSeconds, theIntDegs, theLatFlag, theWorking, and ossimString::toString().
Referenced by ossimMapCompositionSource::addMeterGridLabels(), ossimNitfCommon::encodeGeographicDms(), and ossimGpt::toDmsString().
|
staticprivate |
Definition at line 93 of file ossimDms.h.
Referenced by set_default(), and toString().
|
staticprivate |
Definition at line 94 of file ossimDms.h.
Referenced by set_default().
|
mutableprivate |
Definition at line 103 of file ossimDms.h.
Referenced by calc_mins_or_secs(), degree_to_string(), init_values(), setDegrees(), string_to_degree(), and toString().
|
mutableprivate |
Definition at line 102 of file ossimDms.h.
Referenced by degree_to_string(), init_values(), and toString().
|
private |
Definition at line 96 of file ossimDms.h.
Referenced by ossimDms(), setDegrees(), and toString().
|
static |
Definition at line 90 of file ossimDms.h.
Referenced by degree_to_string(), setDegrees(), and toString().
|
mutableprivate |
Definition at line 104 of file ossimDms.h.
Referenced by init_values(), and toString().
|
mutableprivate |
Definition at line 105 of file ossimDms.h.
Referenced by degree_to_string(), init_values(), and toString().
|
private |
Definition at line 97 of file ossimDms.h.
Referenced by setDegrees(), string_to_degree(), and toString().
|
mutableprivate |
Definition at line 106 of file ossimDms.h.
Referenced by init_values(), setDegrees(), and string_to_degree().
|
mutableprivate |
Definition at line 107 of file ossimDms.h.
Referenced by degree_to_string(), init_values(), and toString().
1.8.14