% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dggridR.R
\name{dgtransform}
\alias{dgtransform}
\title{Converts lat-long pairs into discrete global grid cell numbers}
\usage{
dgtransform(dggs, lat, lon)
}
\arguments{
\item{dggs}{A dggs object from dgconstruct().}

\item{lat}{A vector of latitudes. Same length at the longtiudes}

\item{lon}{A vector of longitudes. Same length as the latitudes.}
}
\value{
A vector of the same length as latitudes and longitudes 
            containing the cell id numbers of the points' cells
            in the discrete grid.
}
\description{
A discrete global grid maps lat-long points to particular cells.
         These cells are uniquely numbered, for a given resolution, from
         1 to some maximum number. Cell numbers may be reused from one
         resolution to the next.
}
\examples{
library(dggridR)
data(dgquakes)

#Construct a grid with cells about ~1000 miles wide
dggs          <- dgconstruct(spacing=1000,metric=FALSE) 
dgquakes$cell <- dgtransform(dggs,dgquakes$lat,dgquakes$lon)

}

