[Proj] Revision of rtodms
Gerald I. Evenden
gerald.evenden at verizon.net
Sat Jan 28 12:26:19 EST 2006
To make libproj4 completely thread friendly it was necessary to create a new
radian to DMS formating procedure to replace "pr_rtodms." The prototype for
the replacement procedure is:
proj_rtodms_r(char *fld, size_t wf, const char *fmt,
double radian, char * sign)
where 'fld' is a character array of length 'wf', 'fmt' is a "ddf" format to be
employed. 'radian' is the value to be formated and 'sign' is a two character
array containing the optional sign suffix ("NS" or "EW").
An example of the variety of outputs for the radian value of the DMS value of
33:15:45 for various values of 'fmt' are:
Just degrees-minutes
val: 33.2625 fmt: %dd%.3f'%c output: 33d15.750'N
full DMS in proj format
val: -33.2625 fmt: %dd%d'%.3f" output: -33d15'45.000"
simple floating point output
val: -33.2625 fmt: %.8f output: -33.26250000
pretty print format for LaTeX
val: 33.2625 fmt: $%d^{\circ}%d'%.3f''$%c output: $33^{\circ}15'45.000''$N
The major restriction is that the format should be in the basic form of
'%d%d%.nf', '%d%.nf' or '%.nf'. If there is a trailing '%c' suffix sign is
used otherwise prefix +/- for the degree part. Any fillers or field values
may be used.
This procedure will replace pj_rtodms in release 3 of libproj4---soon to be
issued. However, if anyone wants a copy, email me for an email copy. It
does not require lib_proj.h if one makes their own proto.
--
Jerry and the low riders:Daisy May and Joshua
"The being cannot be termed rational or virtuous,
who obeys any authority, but that of reason."
---Mary Wollstonecraft 1792
More information about the Proj
mailing list