| 1 |
\name{DMS-class} |
| 2 |
\docType{class} |
| 3 |
\alias{DMS-class} |
| 4 |
\alias{print.DMS} |
| 5 |
\alias{show,DMS-method} |
| 6 |
\alias{coerce,DMS-method} |
| 7 |
\alias{as.double.DMS} |
| 8 |
\alias{as.numeric.DMS} |
| 9 |
\title{Class "DMS" for degree, minute, decimal second values} |
| 10 |
\description{The class provides a container for coordinates stored as degree, minute, decimal second values.} |
| 11 |
\section{Objects from the Class}{ |
| 12 |
Objects can be created by calls of the form \code{new("DMS", ...)}, converted from decimal degrees using \code{dd2dms()}, or converted from character strings using \code{char2dms()}. |
| 13 |
} |
| 14 |
\section{Slots}{ |
| 15 |
\describe{ |
| 16 |
\item{\code{WS}:}{Object of class \code{"logical"} TRUE if input value negative} |
| 17 |
\item{\code{deg}:}{Object of class \code{"numeric"} degrees} |
| 18 |
\item{\code{min}:}{Object of class \code{"numeric"} minutes} |
| 19 |
\item{\code{sec}:}{Object of class \code{"numeric"} decimal seconds} |
| 20 |
\item{\code{NS}:}{Object of class \code{"logical"} TRUE if input value is a Northing} |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
\section{Methods}{ |
| 25 |
\describe{ |
| 26 |
\item{coerce}{\code{signature(from = "DMS", to = "numeric")}: convert to decimal degrees } |
| 27 |
\item{show}{\code{signature(object = "DMS")}: print data values } |
| 28 |
} |
| 29 |
} |
| 30 |
\author{Roger Bivand \email{[email protected]} } |
| 31 |
|
| 32 |
\seealso{\code{\link{char2dms}}, \code{\link{dd2dms}}} |
| 33 |
|
| 34 |
|
| 35 |
\examples{ |
| 36 |
data(state) |
| 37 |
dd2dms(state.center$x) |
| 38 |
dd2dms(state.center$y, NS=TRUE) |
| 39 |
as.numeric(dd2dms(state.center$y)) |
| 40 |
as(dd2dms(state.center$y, NS=TRUE), "numeric") |
| 41 |
as.numeric.DMS(dd2dms(state.center$y)) |
| 42 |
state.center$y |
| 43 |
} |
| 44 |
\keyword{classes} |
| 45 |
\keyword{spatial} |