geoknife/ 0000755 0001762 0000144 00000000000 14154614552 012050 5 ustar ligges users geoknife/NAMESPACE 0000644 0001762 0000144 00000003552 14152453214 013266 0 ustar ligges users # Generated by roxygen2: do not edit by hand
export("algorithm<-")
export("attribute<-")
export("geom<-")
export("id<-")
export("inputs<-")
export("times<-")
export("url<-")
export("values<-")
export("variables<-")
export("version<-")
export("xml<-")
export(XML)
export(abstract)
export(algorithm)
export(attribute)
export(bufferPoint)
export(cancel)
export(check)
export(datagroup)
export(download)
export(email)
export(error)
export(gconfig)
export(geojob)
export(geoknife)
export(geom)
export(id)
export(inputs)
export(parseCategorical)
export(parseTimeseries)
export(query)
export(result)
export(running)
export(simplegeom)
export(start)
export(successful)
export(times)
export(times_query)
export(title)
export(url)
export(values)
export(variables)
export(variables_query)
export(version)
export(wait)
export(webdata)
export(webgeom)
export(webprocess)
export(xml)
exportClasses(simplegeom)
exportClasses(webgeom)
exportClasses(webprocess)
exportMethods("variables<-")
exportMethods(XML)
exportMethods(cancel)
exportMethods(email)
exportMethods(start)
exportMethods(times_query)
exportMethods(variables)
exportMethods(variables_query)
import(methods)
importClassesFrom(sp,SpatialPolygons)
importFrom(curl,curl_version)
importFrom(httr,GET)
importFrom(httr,HEAD)
importFrom(httr,POST)
importFrom(httr,add_headers)
importFrom(httr,content_type_xml)
importFrom(httr,headers)
importFrom(httr,http_error)
importFrom(httr,progress)
importFrom(httr,verbose)
importFrom(httr,write_disk)
importFrom(progress,progress_bar)
importFrom(sp,CRS)
importFrom(sp,Polygon)
importFrom(sp,Polygons)
importFrom(sp,SpatialPolygons)
importFrom(sp,coordinates)
importFrom(sp,proj4string)
importFrom(utils,lsf.str)
importFrom(utils,packageName)
importFrom(utils,packageVersion)
importFrom(utils,read.table)
importFrom(utils,tail)
geoknife/demo/ 0000755 0001762 0000144 00000000000 14036051075 012766 5 ustar ligges users geoknife/demo/iclus_categorical.R 0000644 0001762 0000144 00000001347 14036051075 016572 0 ustar ligges users library(geoknife)
stencil <- webgeom('ecoregion::Colorado Plateaus,Driftless Area,Wyoming Basin')
stencil
#see what other ecoregions are available:
query(stencil, 'values')
fabric <- webdata(url = 'https://cida.usgs.gov/thredds/dodsC/iclus/hc') #, variables =
#see what variables are available:
query(fabric, 'variables')
variables(fabric) <- c('housing_classes_iclus_a1_2010', 'housing_classes_iclus_a1_2100')
knife <- webprocess(algorithm = list('Categorical Coverage Fraction'="gov.usgs.cida.gdp.wps.algorithm.FeatureCategoricalGridCoverageAlgorithm"))
job <- geoknife(stencil, fabric, knife, email = 'your.email.here@gardenmail.com')
check(job)
# wait, or check your email inbox for the result when it has finished geoknife/demo/prism_summary.R 0000644 0001762 0000144 00000001301 14036051075 016013 0 ustar ligges users library(geoknife)
fabric <- webdata('prism')
fabric
#see what times are avaiable:
query(fabric, 'times')
#set times to a different value:
times(fabric)[2] <- '1900-01-01'
stencil <- webgeom('state::Oregon,Colorado,Connecticut')
stencil
#see what other states are available:
query(stencil, 'values')
job <- geoknife(stencil, fabric, wait = TRUE)
prism_data <- result(job)
plot(x = prism_data[,1], y = prism_data[['Oregon']], col = 'red', pch = 15, ylab = variables(fabric), xlab = '')
points(x = prism_data[,1], y = prism_data[['Colorado']], col = 'dodgerblue', pch = 4, lwd = 2)
points(x = prism_data[,1], y = prism_data[['Connecticut']], col = 'green', pch = 2, lwd = 2)
geoknife/demo/00Index 0000644 0001762 0000144 00000000353 14036051075 014121 0 ustar ligges users prism_summary time series precipitation summaries for states from PRISM dataset
iclus_categorical fractional cover for ICLUS dataset and 3 ecoregions
prism_subset Subset prism dataset for time range and spatial area
geoknife/demo/prism_subset.R 0000644 0001762 0000144 00000001647 14036051075 015640 0 ustar ligges users library(geoknife)
fabric <- webdata(url = 'https://cida.usgs.gov/thredds/dodsC/prism')
fabric
query(fabric, 'variables')
variables(fabric) <- 'ppt'
query(fabric, 'times')
times(fabric) <- as.POSIXct(c("1985-01-01","1992-01-01"))
# use ALL variables
variables(fabric) <- query(fabric, 'variables')
stencil <- simplegeom(data.frame('point1'=c(-89, 46), 'point2'=c(-78.6, 42.2)))
knife = webprocess(algorithm = list('OPeNDAP Subset'="gov.usgs.cida.gdp.wps.algorithm.FeatureCoverageOPeNDAPIntersectionAlgorithm"))
job <- geoknife(stencil,fabric, knife, wait = TRUE, OUTPUT_TYPE="netcdf")
file <- download(job, destination = '../prism_data.nc')
knife = webprocess(algorithm = list('OPeNDAP Subset'="gov.usgs.cida.gdp.wps.algorithm.FeatureCoverageOPeNDAPIntersectionAlgorithm"))
job <- geoknife(stencil,fabric, knife, wait = TRUE, OUTPUT_TYPE="geotiff")
file <- download(job, destination = '../prism_data.zip')
geoknife/man/ 0000755 0001762 0000144 00000000000 14036051075 012615 5 ustar ligges users geoknife/man/webprocess-methods.Rd 0000644 0001762 0000144 00000001525 14036051075 016724 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/04-webprocess-obj.R
\name{webprocess}
\alias{webprocess}
\alias{webprocess,missing-method}
\alias{webprocess,character-method}
\alias{webprocess,ANY-method}
\title{create webprocess object}
\usage{
webprocess(.Object, ...)
\S4method{webprocess}{missing}(.Object, ...)
\S4method{webprocess}{character}(
.Object = c("summary", "unweighted summary", "coverage summary", "subset",
"coverage subset"),
...
)
\S4method{webprocess}{ANY}(.Object, ...)
}
\arguments{
\item{.Object}{any object that can be coerced into \linkS4class{webprocess}}
\item{...}{additional arguments passed initialize method (e.g., \code{url}, \code{version})}
}
\value{
the webprocess object
}
\description{
create webprocess object
}
\author{
Jordan S Read
}
geoknife/man/times-webdata.Rd 0000644 0001762 0000144 00000001315 14036051075 015632 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/times-webdata.R
\name{times}
\alias{times}
\alias{times<-}
\alias{times<-,webdata-method}
\alias{times,webdata-method}
\title{the times of an webdata object}
\usage{
times(.Object)
times(.Object) <- value
\S4method{times}{webdata}(.Object) <- value
\S4method{times}{webdata}(.Object)
}
\arguments{
\item{.Object}{a \code{\link{webdata}} object}
\item{value}{a POSIXct vector}
}
\description{
Functions to get or set the times of a \code{\link{webdata}} object
}
\examples{
wd <- webdata('prism')
times(wd) <- as.POSIXct(c("2012-11-04", "2012-11-12"))
times(wd)[1] <- as.POSIXct("2012-11-04")
times(wd)
}
geoknife/man/webgeom-methods.Rd 0000644 0001762 0000144 00000005343 14036051075 016177 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/02-webgeom-obj.R
\name{webgeom}
\alias{webgeom}
\alias{webgeom,missing-method}
\alias{webgeom,ANY-method}
\title{create webgeom object}
\usage{
webgeom(.Object, ...)
\S4method{webgeom}{missing}(.Object, ...)
\S4method{webgeom}{ANY}(.Object, ...)
}
\arguments{
\item{.Object}{any object that can be coerced into \linkS4class{webgeom}}
\item{\dots}{additional arguments passed initialize method (e.g., \code{\link{url}}). See
the named slots above for arguments for \dots}
}
\value{
the webgeom object representing a dataset and parameters
}
\description{
A class representing a web available feature geometry.
}
\details{
slots can be accessed or set with methods of the same names
(e.g., url(webgeom()))
}
\section{Slots}{
\describe{
\item{\code{url}}{value of type \code{"character"}, the web location for the web feature service}
\item{\code{geom}}{value of type \code{"character"}, the feature for webgeom}
\item{\code{attribute}}{the attribute (e.g., "State")}
\item{\code{values}}{the values of the attribute, (e.g., "Wisconsin") or NA (all)}
}}
\examples{
wg <- webgeom(geom = "sample:CONUS_states",
attribute = "STATE",
values = "New Hampshire")
#-- use available state datasets:
wg <- webgeom('state::New Hampshire')
wg <- webgeom('state::New Hampshire,Wisconsin,Alabama')
#-- use available Level III Ecoregion datasets:
wg <- webgeom('ecoregion::Colorado Plateaus,Driftless Area')
#-- use available simplified HUC8s:
wg <- webgeom('HUC8::09020306,14060009')
wg <- webgeom()
\dontrun{
## Steps to find data on Howard County in Texas:
#1) locate the \code{geom} for counties by looking at the options for geoms
query(webgeom(), 'geoms') # discover sample:Counties
#2) locate the \code{attribute} for county names by looking at the options for attributes
query(webgeom(geom='sample:Counties'), 'attributes') # discover FIPS
#3) find the appropriate fip code for the county:
howard.fips <- maps::county.fips \%>\%
dplyr::filter(polyname == 'texas,howard') \%>\% .$fips \%>\% as.character
#4) create a webgeom for the Howard County in Texas
stencil <- webgeom(geom='sample:Counties', attribute='FIPS', values=howard.fips)
#5) get data for Howard County
fabric <- webdata(url = 'https://cida.usgs.gov/thredds/dodsC/stageiv_combined',
variables = "Total_precipitation_surface_1_Hour_Accumulation",
times = c(as.POSIXct("2016-06-06 05:00:00"),
as.POSIXct("2016-06-07 05:00:00")))
job <- geoknife(stencil, fabric, wait = TRUE)
precipData <- result(job)
head(precipData)
}
}
\seealso{
\code{\link{url}}, \code{\link{geom}}, \code{\link{attribute}}, \code{\link{values}}
}
\author{
Jordan S Read
}
geoknife/man/webgeom-class.Rd 0000644 0001762 0000144 00000003355 14036051075 015642 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/02-webgeom-obj.R
\docType{class}
\name{webgeom-class}
\alias{webgeom-class}
\title{webgeom class}
\description{
The \code{webgeom} class represents a web feature service (WFS) dataset.
WFS is an open geospatial consortium standard for spatial data on the web. WFS supports
filtering of spatial elements and this object can support many of those filters.
}
\section{Slots}{
\describe{
\item{\code{url}}{URL of web feature service endpoint.
Can be set or accessed using \code{\link[geoknife]{url}}}
\item{\code{geom}}{character for geometric feature name.
Can be set or accessed using \code{\link[geoknife]{geom}}}
\item{\code{attribute}}{character for feature attribute (used for filtering and naming in output)
Can be set or accessed using \code{\link[geoknife]{attribute}}}
\item{\code{values}}{character vector of attribute values to be used in processing (a subset, or all if NA)
Can be set or accessed using \code{\link[geoknife]{values}}}
\item{\code{version}}{a character that specifies the web feature service (WFS) version to use.
Can be set or accessed using \code{\link[geoknife]{version}}}
\item{\code{GML_IDs}}{(_private) IDs that correspond to \code{values}. Used internally for processing.}
\item{\code{WFS_NAMESPACE}}{(_private) web location of web feature service namespace}
\item{\code{GML_NAMESPACE}}{(_private) web location of GML namespace}
\item{\code{GML_SCHEMA_LOCATION}}{(_private) web location of GML schema location}
}}
\seealso{
\code{\link{webgeom}}, \code{\link[geoknife]{url}}, \code{\link[geoknife]{geom}},
\code{\link[geoknife]{attribute}}, \code{\link[geoknife]{values}}, \code{\link[geoknife]{version}}
}
geoknife/man/geoknife-methods.Rd 0000644 0001762 0000144 00000005446 14036051075 016345 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoknife-generic.R
\docType{methods}
\name{geoknife}
\alias{geoknife}
\title{geoknife}
\usage{
geoknife(stencil, fabric, knife = webprocess(...), ...)
}
\arguments{
\item{stencil}{a \code{\link{webgeom}}, \code{\link{simplegeom}}, or any type
that can be coerced into \code{\link{simplegeom}}.}
\item{fabric}{a dataset. A \code{\link{webdata}} or any type that
can be coerced into \code{\link{webdata}}}
\item{knife}{(optional) a \code{\link{webprocess}} object}
\item{...}{additional arguments passed to \code{new} \code{\link{webprocess}}.
Can also be used to modify the \code{knife} argument, if it is supplied.}
}
\value{
and object of class \linkS4class{geojob}
}
\description{
Creates the processing job and allows specifying the processing details.
}
\details{
The \code{stencil} argument is akin to cookie cutter(s), which specify how the dataset is
to be sub-sampled spatially. Supported types are all geometric in nature, be they collections
of points or polygons. Because geoprocessing operations require a non-zero area for \code{stencil},
if points are used (i.e., the different point collections that can be used in \code{\link{simplegeom}}),
there is a negligible automatic point buffer applied to each point to result in a non-zero area.
Naming of the components of the \code{stencil} will impact the formatting of the result returned by
the geoknife processing job (the \code{\link{geojob}})
geoknife will check the class of the stencil argument, and if stencil's class is not
\code{\link{webgeom}}, it will attempt to coerce the object into a \code{\link{simplegeom}}.
If no coercion method exists, geoknife will fail.
The \code{fabric} argument is akin to the dough or fabric that will be subset with the \code{stencil}
argument. At present, this is a web-available gridded dataset that meets a variety of formatting restrictions.
Several quick start methods for creating a \code{\link{webdata}} object (only \code{\link{webdata}} or
an type that can be coerced into \code{\link{webdata}} are valid arguments for \code{fabric}).
Making concurrent requests to the Geo Data Portal will NOT result in faster overall execution times.
The data backing the system is on high performance storage, but that storage is not meant to support
parallelized random access and can be significantly slower under these conditions. Read more:
https://my.usgs.gov/confluence/display/GeoDataPortal/Geo+Data+Portal+Scalability+Guidelines
}
\examples{
\dontrun{
job <- geoknife(stencil = c(-89,42), fabric = 'prism')
check(job)
#-- set up geoknife to email user when the process is complete
job <- geoknife(webgeom("state::Wisconsin"), fabric = 'prism', email = 'fake.email@gmail.com')
}
}
geoknife/man/canStart.Rd 0000644 0001762 0000144 00000000515 14036051075 014664 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/setJobState.R
\name{canStart}
\alias{canStart}
\title{can start a new job?}
\usage{
canStart()
}
\value{
TRUE or FALSE
}
\description{
checks package job state and returns a boolean for whether a new job can be started
}
\keyword{internal}
geoknife/man/gcontent.Rd 0000644 0001762 0000144 00000000504 14036051075 014724 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoknifeUtils.R
\name{gcontent}
\alias{gcontent}
\title{xml2 version of gcontent}
\usage{
gcontent(response)
}
\arguments{
\item{response}{the result of httr::GET(url)}
}
\description{
xml2 version of gcontent
}
\keyword{internal}
geoknife/man/result-methods.Rd 0000644 0001762 0000144 00000002053 14036051075 016063 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/result.R
\docType{methods}
\name{result}
\alias{result}
\alias{result,geojob-method}
\alias{result,character-method}
\title{parse process output into R environment}
\usage{
result(.Object, ...)
\S4method{result}{geojob}(.Object, ...)
\S4method{result}{character}(.Object, ...)
}
\arguments{
\item{.Object}{a \code{\link{geojob}} object with a successful processID,
or a \code{character} URL of a completed job.
(See \code{\link{check}}).}
\item{...}{additional arguments passed to parsers (e.g., with.units = TRUE)}
}
\value{
data.frame of timeseries values.
}
\description{
a \code{geojob} method for loading data into R from a completed processing request
}
\examples{
\dontrun{
job <- geoknife(stencil = c(-89,42), fabric = 'prism', wait = TRUE)
result(job, with.units = TRUE) # load and print output
# or use the job id:
id <- id(job)
result(id, with.units = TRUE) # load and print output
}
}
\author{
Jordan S. Read
}
\keyword{methods}
geoknife/man/inputs-webprocess.Rd 0000644 0001762 0000144 00000003606 14036051075 016605 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/inputs-webprocess.R
\name{inputs<-}
\alias{inputs<-}
\alias{inputs}
\alias{inputs,webprocess-method}
\alias{inputs,xml_document-method}
\alias{inputs<-,webprocess,missing-method}
\alias{inputs<-,webprocess,character-method}
\alias{inputs<-,webprocess,list-method}
\title{inputs of webprocess}
\usage{
inputs(.Object, ...) <- value
inputs(.Object, ..., value)
\S4method{inputs}{webprocess}(.Object, ..., value)
\S4method{inputs}{xml_document}(.Object, ..., value)
\S4method{inputs}{webprocess,missing}(.Object, ...) <- value
\S4method{inputs}{webprocess,character}(.Object, ...) <- value
\S4method{inputs}{webprocess,list}(.Object, ...) <- value
}
\arguments{
\item{.Object}{a webprocessing object}
\item{\dots}{arguments matching fields in .Object's processInputs slot}
\item{value}{a field pair for .Object processInputs}
\item{...}{arguments matching fields in .Object's processInputs slot}
}
\description{
The webprocess inputs are a list of parameter names and their associated values.
These inputs are specific to an individual \code{algorithm} used by the webprocess,
and are pulled in from the web with defaults. An NA value in an input field means that
this parameter will be left out of the web processing request. NULL values are required fields
for the post and must be populated. For some values, there are defaults used if NULL (e.g.,
the mean for 'STATISTIC' is "mean"). Only characters can be used in input fields, but
booleans are changed to characters as 'true' and 'false'.
access or set the inputs of a webprocess
}
\examples{
\dontrun{
wp <- webprocess(DELIMITER = 'TAB')
inputs(wp)
inputs(wp) <- list(DELIMITER = 'COMMA', SUMMARIZE_FEATURE_ATTRIBUTE = 'false')
inputs(wp)
inputs(wp, "DELIMITER")
inputs(wp, "DELIMITER") <- "TAB"
}
}
\keyword{internal}
geoknife/man/datagroup-methods.Rd 0000644 0001762 0000144 00000001626 14036051075 016540 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/07-datagroup-obj.R
\name{datagroup}
\alias{datagroup}
\alias{datagroup,ANY-method}
\alias{datagroup,datagroup-methods}
\alias{length,datagroup-method}
\alias{[,datagroup-method}
\alias{[[,datagroup,ANY,ANY-method}
\title{create datagroup object}
\usage{
datagroup(...)
\S4method{datagroup}{ANY}(...)
\S4method{length}{datagroup}(x)
\S4method{[}{datagroup}(x, i, j, ..., drop = TRUE)
\S4method{[[}{datagroup,ANY,ANY}(x, i, j, ..., drop = TRUE)
}
\arguments{
\item{...}{additional arguments passed to initialize method}
\item{x}{a datagroup object}
\item{i}{index specifying elements to extract or replace.}
\item{j}{not implemented}
\item{drop}{not implemented}
}
\value{
the datagroup object
}
\description{
A class representing a geoknife job (\code{datagroup}).
}
\author{
Jordan S Read
}
geoknife/man/query.Rd 0000644 0001762 0000144 00000003014 14036051075 014247 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/query-webdata.R, R/query-webgeom.R,
% R/query-webprocess.R
\name{query}
\alias{query}
\alias{query,webdata-method}
\alias{query,webdata,character-method}
\alias{query,webdata,missing-method}
\alias{query,character,missing-method}
\alias{query,webgeom,character-method}
\alias{query,webgeom-method}
\alias{query,webprocess,character-method}
\alias{query,webprocess-method}
\title{query webdata for various fields}
\usage{
query(.Object, field, ...)
\S4method{query}{webdata,character}(.Object, field, ...)
\S4method{query}{webdata,missing}(.Object, field, ...)
\S4method{query}{character,missing}(.Object, field, ...)
\S4method{query}{webgeom,character}(.Object, field, ...)
\S4method{query}{webprocess,character}(.Object, field, ...)
}
\arguments{
\item{.Object}{a \code{webdata}, \code{webgeom}, or \code{webprocess} object.}
\item{field}{a plural parameter name for fields in .Object (e.g., 'variables', 'times')}
\item{...}{additional arguments passed to methods}
}
\value{
a character vector of values corresponding to the query field specified
}
\description{
a method for finding possible values for a given field
}
\examples{
\dontrun{
fabric <- webdata('prism')
query(fabric, 'variables')
wg <- webgeom()
query(wg, 'geoms')
geom(wg) <- "sample:CONUS_states"
query(wg, 'attributes')
attribute(wg) <- 'STATE'
query(wg, 'values', rm.duplicates = TRUE)
}
}
\author{
Jordan S. Read
}
\keyword{methods}
geoknife/man/email-method.Rd 0000644 0001762 0000144 00000000772 14036051075 015457 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/email-geojob.R
\name{email}
\alias{email}
\alias{email,geojob-method}
\alias{email,geojob,webprocess-method}
\title{email user when processing job is complete}
\usage{
email(geojob, knife)
\S4method{email}{geojob,webprocess}(geojob, knife)
}
\arguments{
\item{email}{a character for email address to use}
}
\description{
configure job to send an email when complete (success or failure)
}
\keyword{internal}
geoknife/man/variables-webdata.Rd 0000644 0001762 0000144 00000001220 14036051075 016454 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/variables-webdata.R
\docType{methods}
\name{variables}
\alias{variables}
\alias{variables<-}
\alias{variables,webdata-method}
\alias{variables<-,webdata-method}
\title{the variables of a webdata object}
\usage{
variables(.Object)
variables(.Object) <- value
variables(.Object) <- value
\S4method{variables}{webdata}(.Object)
\S4method{variables}{webdata}(.Object) <- value
}
\arguments{
\item{.Object}{a \code{\link{webdata}} object}
\item{value}{a character vector for variables}
}
\description{
access or set the variables of a webdata object
}
geoknife/man/url.Rd 0000644 0001762 0000144 00000001777 14036051075 013722 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/url-generic.R
\name{url<-}
\alias{url<-}
\alias{url}
\alias{url<-,ANY-method}
\alias{url<-,webprocess-method}
\alias{url,character-method}
\alias{url,missing-method}
\alias{url,datagroup-method}
\alias{url,ANY-method}
\title{the url of an object}
\usage{
url(.Object) <- value
url(.Object, ...)
\S4method{url}{ANY}(.Object) <- value
\S4method{url}{webprocess}(.Object) <- value
\S4method{url}{character}(.Object, ...)
\S4method{url}{missing}(.Object, ...)
\S4method{url}{datagroup}(.Object, ...)
\S4method{url}{ANY}(.Object, ...)
}
\arguments{
\item{.Object}{a \linkS4class{webgeom}, \linkS4class{webdata},}
\item{value}{a url}
\item{\dots}{additional arguments that would be passed to the masked base::url function.
These are only used when the .Object argument is character or missing
\linkS4class{geojob}, or \linkS4class{webprocess} object}
}
\description{
get or set the url of an object
}
geoknife/man/algorithm-webprocess.Rd 0000644 0001762 0000144 00000001666 14036051075 017255 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/algorithm-webprocess.R
\name{algorithm}
\alias{algorithm}
\alias{algorithm<-}
\alias{algorithm,webprocess-method}
\alias{algorithm<-,webprocess-method}
\alias{algorithm,xml_document-method}
\title{the algorithm of a webprocess object}
\usage{
algorithm(.Object)
algorithm(.Object) <- value
\S4method{algorithm}{webprocess}(.Object)
\S4method{algorithm}{webprocess}(.Object) <- value
\S4method{algorithm}{xml_document}(.Object)
}
\arguments{
\item{.Object}{a \linkS4class{webprocess} object}
\item{value}{a list with name of algorithm and relative url endpoint}
}
\description{
Functions to get or set the algorithm of a \linkS4class{webprocess} object.
The algorithm is the type of process that will be used, and can be accessed
or modified using the algorithm method.
}
\examples{
\dontrun{
wp <- webprocess()
algorithm(wp)
}
}
geoknife/man/values.Rd 0000644 0001762 0000144 00000001553 14036051075 014407 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/values-webgeom.R
\name{values<-}
\alias{values<-}
\alias{values}
\alias{values<-,webgeom-method}
\alias{values,webgeom-method}
\title{the values of a webgeom}
\usage{
values(.Object) <- value
values(.Object)
\S4method{values}{webgeom}(.Object) <- value
\S4method{values}{webgeom}(.Object)
}
\arguments{
\item{.Object}{a \linkS4class{webgeom} object}
\item{value}{a values}
}
\description{
The values of a webgeom are the values of the attributes used in the geometries.
For example, if the webgeom's "geom" field is a feature collection containing states
and counties, and the "attributes" are the states, then the values would be the
specific states.
}
\examples{
wg <- webgeom('state::Wisconsin')
values(wg)
values(wg) <- c('Wisconsin','New Hampshire')
}
geoknife/man/setJobState.Rd 0000644 0001762 0000144 00000001240 14036051075 015330 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/setJobState.R
\name{setJobState}
\alias{setJobState}
\title{set job state at package level for outgoing requests}
\usage{
setJobState(state = "none")
}
\arguments{
\item{state}{the state (as a character) to set \code{jobState} to.}
}
\value{
invisible return of \code{jobState} package variable
}
\description{
this function keeps the package from rifling off multiple requests
while another is still pending. Package variable \code{jobState} is set with
direct calls to this private function, or as part of any \code{status} type
method for geojob
}
\keyword{internal}
geoknife/man/start-methods.Rd 0000644 0001762 0000144 00000001473 14036051075 015707 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/start-geojob.R
\docType{methods}
\name{start}
\alias{start}
\alias{start,geojob-method}
\title{Submit a GDP web processing request}
\usage{
start(.Object)
\S4method{start}{geojob}(.Object)
}
\arguments{
\item{.Object}{a \linkS4class{geojob} object}
}
\value{
A \linkS4class{geojob} object with an active GDP process request.
}
\description{
Start process for \code{\link{geojob}}
}
\details{
start a geo-web processing request
start is a method for submitting a geo-web processing request.
}
\examples{
wd <- webdata('prism')
wg <- webgeom('state::New Hampshire')
wp <- webprocess()
gj <- geojob()
\dontrun{
xml(gj) <- XML(wg, wd, wp)
url(gj) <- url(wp)
gj <- start(gj)
}
}
\seealso{
\code{\link{check}}
}
geoknife/man/times_query-method.Rd 0000644 0001762 0000144 00000001023 14036051075 016724 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/query-webdata-times.R
\name{times_query}
\alias{times_query}
\alias{times_query,webdata-method}
\alias{times_query,webdata,missing-method}
\alias{times_query,webdata,webprocess-method}
\title{times query}
\usage{
times_query(fabric, knife)
\S4method{times_query}{webdata,missing}(fabric, knife)
\S4method{times_query}{webdata,webprocess}(fabric, knife)
}
\description{
query a webdata object for the time range
}
\keyword{internal}
geoknife/man/attribute.Rd 0000644 0001762 0000144 00000001114 14036051075 015104 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/attribute-webgeom.R
\name{attribute<-}
\alias{attribute<-}
\alias{attribute}
\alias{attribute<-,webgeom-method}
\alias{attribute,webgeom-method}
\title{the attribute of an webgeom object}
\usage{
attribute(.Object) <- value
attribute(.Object)
\S4method{attribute}{webgeom}(.Object) <- value
\S4method{attribute}{webgeom}(.Object)
}
\arguments{
\item{.Object}{a \linkS4class{webgeom} object}
\item{value}{a attribute}
}
\description{
get or set the attribute of a webgeom object.
}
geoknife/man/simplegeom-class.Rd 0000644 0001762 0000144 00000002447 14036051075 016357 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/06-simplegeom-obj.R
\docType{class}
\name{simplegeom-class}
\alias{simplegeom-class}
\title{simplegeom class}
\description{
The \code{simplegeom} class represents geometries that can
be coerced into polygon features. This is one of two \code{stencil} types
accepted by \code{\link{geoknife}} (the other being \linkS4class{webgeom}).
}
\details{
The difference between \linkS4class{webgeom} and \linkS4class{simplegeom}
is both in the permanence and the location of the data. \linkS4class{webgeom} is
located on a web server that offers geometries using the web feature service (WFS)
specification. \linkS4class{simplegeom} are typically local data that can be accessed
within an R session. Within reason, anything that can be represented as a
\linkS4class{webgeom} (or WFS) can also be represented by a \linkS4class{simplegeom}
For example, a state or watershed can be read in as \code{\link[sp]{SpatialPolygons}}
object and turned into a \linkS4class{simplegeom}.
}
\section{Slots}{
\describe{
\item{\code{sp}}{a \code{\link[sp]{SpatialPolygons}} object}
\item{\code{DRAW_NAMESPACE}}{(_private) web location of draw namespace}
\item{\code{DRAW_SCHEMA}}{(_private) web location of draw schema}
}}
geoknife/man/simplegeom-methods.Rd 0000644 0001762 0000144 00000002361 14036051075 016710 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/06-simplegeom-obj.R
\name{simplegeom}
\alias{simplegeom}
\alias{simplegeom,missing-method}
\alias{simplegeom,ANY-method}
\title{Create simplegeom object}
\usage{
simplegeom(.Object, ...)
\S4method{simplegeom}{missing}(.Object, ...)
\S4method{simplegeom}{ANY}(.Object, ...)
}
\arguments{
\item{.Object}{any object that can be coerced into \linkS4class{simplegeom}}
\item{...}{additional arguments passed to SpatialPolygonsDataFrame}
}
\value{
the simplegeom object
}
\description{
A simple geom is a simple set of geometries specified locally. See
\code{\link{webgeom}} for web features.
}
\examples{
simplegeom(c(-88.6, 45.2))
\dontrun{
library(sp)
Sr1 <- Polygon(cbind(c(-89.0001,-89,-88.9999,-89,-89.0001),c(46,46.0001,46,45.9999,46)))
Sr2 <- Polygon(cbind(c(-88.6,-88.5999,-88.5999,-88.6,-88.6),c(45.2,45.2,45.1999,45.1999,45.2)))
Srs1 <- Polygons(list(Sr1), "s1")
Srs2 <- Polygons(list(Sr2), "s2")
SP <- SpatialPolygons(list(Srs1,Srs2), proj4string = CRS("+proj=longlat +datum=WGS84"))
result(geoknife(simplegeom(SP), 'prism', wait=TRUE))
}
simplegeom(data.frame('point1'=c(-89, 46), 'point2'=c(-88.6, 45.2)))
}
\author{
Jordan S Read
}
geoknife/man/webdata-class.Rd 0000644 0001762 0000144 00000001135 14036051075 015616 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/03-webdata-obj.R
\docType{class}
\name{webdata-class}
\alias{webdata-class}
\title{webdata class}
\description{
a class for specifying details of web datasets (webdata!). These datasets have to be
accessible through the OPeNDAP protocol or as WCS (web coverage services).
}
\section{Slots}{
\describe{
\item{\code{times}}{vector of POSIXct dates (specifying start and end time of processing)}
\item{\code{url}}{URL of web data}
\item{\code{variables}}{variable(s) used for processing from dataset}
}}
geoknife/man/download.Rd 0000644 0001762 0000144 00000002110 14036051075 014705 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/download-geojob.R
\name{download}
\alias{download}
\alias{download,geojob,missing-method}
\alias{download,character,missing-method}
\alias{download,geojob,character-method}
\alias{download,character,character-method}
\title{download output from geojob}
\usage{
download(.Object, destination, ...)
\S4method{download}{geojob,missing}(.Object, destination, ...)
\S4method{download}{character,missing}(.Object, destination, ...)
\S4method{download}{geojob,character}(.Object, destination, ...)
\S4method{download}{character,character}(.Object, destination, ...)
}
\arguments{
\item{.Object}{a \code{\link{geojob}} or job id that has completed}
\item{destination}{a file destination. If missing, a temp directory will be used}
\item{...}{additional arguments passed to \code{\link[httr]{write_disk}}, such as overwrite = TRUE}
}
\value{
the location of the downloaded file
}
\description{
download the result of a processing job to a local destination.
}
\author{
Jordan S Read
}
geoknife/man/parseTimeseries.Rd 0000644 0001762 0000144 00000001742 14036051075 016254 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/parseTimeseries.R
\name{parseTimeseries}
\alias{parseTimeseries}
\title{parse timeseries file into R environment}
\usage{
parseTimeseries(file, delim, with.units = FALSE)
}
\arguments{
\item{file}{a \linkS4class{geojob} timeseries processing result file location
(See \code{\link{download}}).}
\item{delim}{the file delimiter}
\item{with.units}{boolean for including a units column in returned data.frame (default = \code{FALSE})}
}
\value{
a data.frame of timeseries values.
}
\description{
a function for loading data into R from a file (or URL) from a completed processing request
}
\examples{
local_file <- system.file('extdata','tsv_linear_ring.tsv', package = 'geoknife')
output <- parseTimeseries(local_file, delim = '\t')
}
\seealso{
\code{\link{check}}, \code{\link{download}}, \code{\link{parseCategorical}}
}
\author{
Luke A. Winslow, Jordan S. Read
}
\keyword{methods}
geoknife/man/parseCategorical.Rd 0000644 0001762 0000144 00000001551 14036051075 016356 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/parseCategorical.R
\name{parseCategorical}
\alias{parseCategorical}
\title{parse categorical coverage file into R environment}
\usage{
parseCategorical(file, delim)
}
\arguments{
\item{file}{a \linkS4class{geojob} categorical processing result file location
(See \code{\link{download}}).}
\item{delim}{the file delimiter}
}
\value{
a data.frame of categorical fraction (and/or count) values.
}
\description{
a function for loading data into R from a file (or URL) from a completed processing request
}
\examples{
local.file <- system.file('extdata','csv_categorical_multifeature.csv', package = 'geoknife')
output <- parseCategorical(local.file, delim = ',')
}
\seealso{
\code{\link{check}}, \code{\link{download}}, \code{\link{parseTimeseries}}
}
\keyword{methods}
geoknife/man/webprocess-class.Rd 0000644 0001762 0000144 00000003776 14036051075 016400 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/04-webprocess-obj.R
\docType{class}
\name{webprocess-class}
\alias{webprocess-class}
\title{webprocess class}
\description{
A class representing geoknife web processing specifications
}
\section{Slots}{
\describe{
\item{\code{url}}{URL for webprocessing service.
Can be set or accessed using \code{\link[geoknife]{url}}}
\item{\code{algorithm}}{a list for algorithm used.
Can be set or accessed using \code{\link[geoknife]{algorithm}}}
\item{\code{version}}{a character specifying the wep processing service version to use.
Can be set or accessed using \code{\link[geoknife]{version}}}
\item{\code{email}}{an email to send finished process alert to}
\item{\code{wait}}{boolean for wait until complete (hold up R until processing is complete)}
\item{\code{sleep.time}}{numeric for time to wait in between calls to \code{\link{check}}. Only used if \code{wait=TRUE}}
\item{\code{processInputs}}{(_private) a list of required and options process inputs, and their
default values (if specified). This is populated (or repopulated) whenever \code{algorithm} is set.}
\item{\code{WPS_SCHEMA_LOCATION}}{(_private) location for web processing service schema}
\item{\code{WPS_NAMESPACE}}{(_private) location for web processing service namespace}
\item{\code{OWS_NAMESPACE}}{(_private) namespace web location}
\item{\code{XSI_SCHEMA_LOCATION}}{(_private) schema web location}
\item{\code{XSI_NAMESPACE}}{(_private) namespace web location}
\item{\code{XLINK_NAMESPACE}}{(_private) namespace web location}
\item{\code{UTILITY_URL}}{(_private) web processing service utility url. Uses same base url as
public slot \code{url}}
\item{\code{OGC_NAMESPACE}}{(_private) namespace web location}
\item{\code{emailK}}{(_private) relative url for email when complete utility.}
}}
\seealso{
\code{\link{webprocess}}, \code{\link[geoknife]{url}},
\code{\link[geoknife]{algorithm}}, \code{\link[geoknife]{version}}
}
geoknife/man/abstract-datagroup.Rd 0000644 0001762 0000144 00000001004 14036051075 016666 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/07-datagroup-obj.R
\name{abstract}
\alias{abstract}
\alias{title}
\alias{abstract,datagroup-method}
\alias{title,datagroup-method}
\title{get abstract from a datagroup}
\usage{
abstract(.Object)
\S4method{abstract}{datagroup}(.Object)
title(.Object)
\S4method{title}{datagroup}(.Object)
}
\arguments{
\item{.Object}{a datagroup object}
}
\description{
extracts the abstract information from a datagroup object
}
geoknife/man/geom.Rd 0000644 0001762 0000144 00000001345 14036051075 014036 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geom-webgeom.R
\name{geom<-}
\alias{geom<-}
\alias{geom}
\alias{geom<-,webgeom-method}
\alias{geom,webgeom-method}
\title{the geom of an object}
\usage{
geom(.Object) <- value
geom(.Object)
\S4method{geom}{webgeom}(.Object) <- value
\S4method{geom}{webgeom}(.Object)
}
\arguments{
\item{.Object}{a \linkS4class{webgeom} object}
\item{value}{a geom}
}
\description{
The "feature" of a webgeom. This is the key mapping to the web resource
that is used as the spatial feature of reference. Other details specified in
\code{\link{attribute}} and \code{\link{values}}.
}
\seealso{
\code{\link{attribute}} and \code{\link{values}}
}
geoknife/man/XML-method.Rd 0000644 0001762 0000144 00000001541 14036051075 015023 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/processInputsToXML.R
\name{XML}
\alias{XML}
\alias{XML,webgeom-method}
\alias{XML,ANY,webdata,webprocess-method}
\title{XML from set of objects}
\usage{
XML(stencil, fabric, knife)
\S4method{XML}{ANY,webdata,webprocess}(stencil, fabric, knife)
}
\arguments{
\item{stencil}{a \code{\link{webdata}} OR \code{\link{simplegeom}} object}
\item{fabric}{a \code{\link{webdata}} object}
\item{knife}{a \code{\link{webprocess}} object}
}
\value{
XML as ?string?
}
\description{
Extract important parts of stencil, fabric, and knife into POST XML
}
\examples{
wd <- webdata('prism',times = as.POSIXct(c('2001-01-01','2002-02-05')))
wg <- webgeom('state::Wisconsin')
\dontrun{
XML(wg, wd, webprocess())
sg <- simplegeom(c(-89,45))
XML(sg, wd, webprocess())
}
}
geoknife/man/cancel-methods.Rd 0000644 0001762 0000144 00000001675 14152451501 016000 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cancel-geojob.R
\docType{methods}
\name{cancel}
\alias{cancel}
\alias{cancel,geojob-method}
\alias{cancel,missing-method}
\title{cancel a geo-web processing request}
\usage{
cancel(.Object)
\S4method{cancel}{geojob}(.Object)
\S4method{cancel}{missing}(.Object)
}
\arguments{
\item{.Object}{a \linkS4class{geojob} object with an active geo-web processing request.}
}
\value{
A \linkS4class{geojob} object with no active job
}
\description{
Cancel process for \code{geojob}
}
\details{
cancel is a method for cancelling a geo-web processing request.
}
\examples{
wd <- webdata('prism')
wg <- webgeom('state::New Hampshire')
wp <- webprocess()
if(!is.null(wp)) {
gj <- geojob()
xml(gj) <- XML(wg, wd, wp)
url(gj) <- url(wp)
}
\dontrun{
gj <- start(gj)
gj <- cancel(gj)
}
}
\seealso{
\code{check}, \code{start}
}
\keyword{methods}
geoknife/man/geojob-methods.Rd 0000644 0001762 0000144 00000002600 14036051075 016010 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/01-geojob-obj.R
\name{geojob}
\alias{geojob}
\alias{geojob,missing-method}
\alias{geojob,geojob-method}
\alias{geojob,xml_document-method}
\alias{geojob,character-method}
\alias{xml<-}
\alias{xml<-,geojob-method}
\alias{xml}
\alias{xml,geojob-method}
\alias{id<-}
\alias{id,geojob-method}
\alias{id}
\alias{id<-,geojob-method}
\alias{id,character-method}
\title{create geojob object}
\usage{
geojob(xml, ...)
\S4method{geojob}{missing}(xml, ...)
\S4method{geojob}{xml_document}(xml, ...)
\S4method{geojob}{character}(xml, ...)
xml(.Object) <- value
xml(.Object)
id(.Object)
id(.Object) <- value
id(.Object)
\S4method{id}{geojob}(.Object) <- value
\S4method{id}{geojob}(.Object)
\S4method{id}{character}(.Object)
}
\arguments{
\item{xml}{location of xml (URL or local path)}
\item{...}{additional arguments passed to initialize method}
\item{.Object}{a \code{\link{geojob}} object}
\item{value}{a character string of xml}
}
\value{
the geojob object
}
\description{
A class representing a geoknife job (\code{geojob}).
}
\examples{
xml <- " text "
gj <- geojob()
xml(gj) <- xml
xml(gj)
xml <- " text "
gj <- geojob(xml = xml)
xml(gj)
id(gj)
}
\author{
Jordan S Read
}
geoknife/man/webdata-methods.Rd 0000644 0001762 0000144 00000003077 14036051075 016163 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/03-webdata-obj.R
\docType{methods}
\name{webdata}
\alias{webdata}
\alias{webdata,missing-method}
\alias{webdata,character-method}
\alias{webdata,geojob-method}
\alias{webdata,ANY-method}
\title{create webdata object}
\usage{
webdata(.Object, ...)
\S4method{webdata}{missing}(.Object, ...)
\S4method{webdata}{character}(
.Object = c("prism", "iclus", "daymet", "gldas", "nldas", "topowx", "solar",
"metobs"),
...
)
\S4method{webdata}{geojob}(.Object, ...)
\S4method{webdata}{ANY}(.Object, ...)
}
\arguments{
\item{.Object}{any object that can be coerced into \linkS4class{webdata}
(currently \code{character}, \code{webdata}, and \code{list})}
\item{...}{additional arguments passed initialize method (e.g., times, or any other
in the \linkS4class{webdata} object.}
}
\value{
the webdata object representing a dataset and parameters
}
\description{
A class representing a web dataset.
}
\section{Slots}{
\describe{
\item{\code{times}}{value of type \code{"POSIXct"}, start and stop dates for data}
\item{\code{url}}{value of type \code{"character"}, the web location for the dataset}
\item{\code{variable}}{value of type \code{"character"}, the variable(s) for data}
}}
\examples{
webdata('prism')
webdata('prism', times=as.POSIXct(c('1990-01-01', '1995-01-01')))
webdata(list(times = as.POSIXct(c('1895-01-01 00:00:00','1899-01-01 00:00:00')),
url = 'https://cida.usgs.gov/thredds/dodsC/prism',
variables = 'ppt'))
}
\author{
Jordan S Read
}
geoknife/man/version.Rd 0000644 0001762 0000144 00000001063 14036051075 014571 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/version-generic.R
\name{version<-}
\alias{version<-}
\alias{version}
\alias{version<-,ANY-method}
\alias{version,ANY-method}
\title{the version of an object}
\usage{
version(.Object) <- value
version(.Object)
\S4method{version}{ANY}(.Object) <- value
\S4method{version}{ANY}(.Object)
}
\arguments{
\item{.Object}{a \linkS4class{webgeom} or \linkS4class{webprocess} object}
\item{value}{a version}
}
\description{
get the version of webgeom or webprocess
}
geoknife/man/defaultProcessInputs.Rd 0000644 0001762 0000144 00000001125 14036051075 017271 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/initializeProcessInputs.R
\name{defaultProcessInputs}
\alias{defaultProcessInputs}
\title{Default Process Inputs}
\usage{
defaultProcessInputs(algorithm, wps_url, wps_version)
}
\arguments{
\item{algorithm}{the WPS algorithm to get process inputs for}
\item{wps_url}{the service base URL for the WPS}
\item{wps_version}{the service version to use}
}
\value{
list of default, optional, and required process inputs for use in the webprocess object.
}
\description{
parses DescribeProcess request
}
geoknife/man/geojob-class.Rd 0000644 0001762 0000144 00000001145 14036051075 015455 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/01-geojob-obj.R
\docType{class}
\name{geojob-class}
\alias{geojob-class}
\title{geojob class}
\description{
contains the information for processing the job, and the versions
of the resources used.
}
\section{Slots}{
\describe{
\item{\code{url}}{URL of web processing endpoint}
\item{\code{xml}}{XML character for post}
\item{\code{id}}{job identifier}
\item{\code{package.version}}{the version of the geoknife package}
\item{\code{algorithm.version}}{the version of the algorithm used for processing}
}}
geoknife/man/bufferPoint.Rd 0000644 0001762 0000144 00000001316 14036051075 015370 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bufferPoint.R
\name{bufferPoint}
\alias{bufferPoint}
\title{Create linear ring from point}
\usage{
bufferPoint(point)
}
\arguments{
\item{point}{A vector of longitude and latitude values}
}
\value{
A linear ring (with closure) as a numeric vector
}
\description{
Buffer ring creation from point
}
\details{
bufferPoint is a function that takes a longitude and latitude pair and creates
a buffered ring (i.e., a feature with non-zero area) centered.
}
\examples{
linearRing = bufferPoint(c(-111.48, 36.95))
}
\seealso{
\linkS4class{simplegeom}
}
\author{
Jordan S. Read
}
\keyword{internal}
\keyword{methods}
geoknife/man/check-geojob.Rd 0000644 0001762 0000144 00000002166 14036051075 015431 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/check.R
\name{check}
\alias{check}
\alias{check,geojob-method}
\alias{check,character-method}
\title{Check status of processing request}
\usage{
check(.Object)
\S4method{check}{geojob}(.Object)
\S4method{check}{character}(.Object)
}
\arguments{
\item{.Object}{a \linkS4class{geojob} object with an active GDP process request,
or a \code{character} URL of an existing job}
}
\value{
\code{process}, a list containing
\code{status} and \code{URL}.
}
\description{
Check status of processing request
}
\details{
check is a method for checking the process status of an active (executed)
\linkS4class{geojob} object. The method returns \code{process}, which is a list containing
two fields: \code{status} and \code{URL}. If the \linkS4class{geojob} object has not been executed
(see \code{\link{start}}), this method returns \code{status}='none' and \code{URL}=NULL.
}
\examples{
gj <- geojob() # create geojob object
check(gj) # no process for empty geojob object
}
\seealso{
\code{\link{start}}
}
\author{
Jordan S. Read
}
geoknife/man/retryVERB.Rd 0000644 0001762 0000144 00000001023 14036051075 014724 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoknifeUtils.R
\name{retryVERB}
\alias{retryVERB}
\title{simple retry for httr VERBs}
\usage{
retryVERB(VERB, url, ..., retries = gconfig("retries"))
}
\arguments{
\item{VERB}{\code{httr} function}
\item{url}{a url}
\item{\dots}{additional args passed into VERB}
\item{retries}{number of times to try before failing}
}
\description{
Useful for intermittent server issues, when a retry will get the job done
}
\keyword{internal}
geoknife/man/successful-methods.Rd 0000644 0001762 0000144 00000001640 14036051075 016725 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/successful.R
\name{successful}
\alias{successful}
\alias{running}
\alias{error}
\title{Convenience function for GDP process state}
\usage{
successful(.Object, retry)
error(.Object, retry)
running(.Object, retry)
running(.Object, retry = FALSE)
error(.Object, retry = FALSE)
}
\arguments{
\item{.Object}{a \linkS4class{geojob} object or geojob ID (character)}
\item{retry}{logical, attempt to retry again if communication failed with the server}
}
\value{
TRUE/FALSE indicating if process is in the given state (error, processing, successful)
}
\description{
Simple wrapper to check process status
}
\examples{
\dontrun{
job <- geoknife(stencil = c(-89,42), fabric = 'prism')
check(job)
running(job)
error(job)
successful(job)
}
}
\seealso{
\code{\link{check}}
}
\author{
Luke Winslow, Jordan S Read
}
geoknife/man/gconfig.Rd 0000644 0001762 0000144 00000002241 14036051075 014517 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/00-gconfig.R
\name{gconfig}
\alias{gconfig}
\title{configure geoknife settings}
\usage{
gconfig(..., no.readonly = FALSE)
}
\arguments{
\item{\dots}{values for gconfig}
\item{no.readonly}{currently not implemented for \code{TRUE}}
}
\value{
Borrowed text and functionality from \code{\link[graphics]{par}}.
When parameters are set, their previous values are returned in an invisible named list.
Such a list can be passed as an argument to par to restore the parameter values. Use gconfig(no.readonly = TRUE)
for the full list of parameters that can be restored. When just one parameter is queried, the value of that
parameter is returned as (atomic) vector. When two or more parameters are queried, their values are returned
in a list, with the list names giving the parameters. Note the inconsistency: setting one parameter returns a list,
but querying one parameter returns a vector.
}
\description{
access and set defaults for geoknife configuration
}
\examples{
gconfig # all config
gconfig('wait')
gconfig('sleep.time' = 10)
gconfig('sleep.time' = 8, wait=TRUE)
}
geoknife/man/getJobState.Rd 0000644 0001762 0000144 00000000520 14036051075 015314 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/setJobState.R
\name{getJobState}
\alias{getJobState}
\title{get job state}
\usage{
getJobState()
}
\value{
\code{jobState} package variable
}
\description{
convenience function for retrieving package-level \code{jobState}
}
\keyword{internal}
geoknife/man/datagroup-class.Rd 0000644 0001762 0000144 00000000607 14036051075 016200 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/07-datagroup-obj.R
\docType{class}
\name{datagroup-class}
\alias{datagroup-class}
\title{datagroup class}
\description{
contains collections of webdata that can be processed with
\code{\link{geoknife}}
}
\section{Slots}{
\describe{
\item{\code{group}}{a list of webdata compatible elements}
}}
geoknife/man/wait.Rd 0000644 0001762 0000144 00000002030 14036051075 014043 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/waitUntilFinished.R
\name{wait}
\alias{wait}
\alias{wait,geojob,numeric-method}
\alias{wait,geojob,missing-method}
\alias{wait,character,numeric-method}
\alias{wait,character,missing-method}
\title{hold up R while GDP is processing}
\usage{
wait(.Object, sleep.time)
\S4method{wait}{geojob,numeric}(.Object, sleep.time)
\S4method{wait}{geojob,missing}(.Object, sleep.time)
\S4method{wait}{character,numeric}(.Object, sleep.time)
\S4method{wait}{character,missing}(.Object, sleep.time)
}
\arguments{
\item{.Object}{a geojob}
\item{sleep.time}{a number of seconds to wait in between checking the process}
}
\value{
invisible return of .Object, unaltered
}
\description{
keeps R in a loop while GDP works on the request. Checks \code{\link{running}}.
Will drop out of loop whenever !running(geojob)
}
\examples{
\dontrun{
job <- geoknife(stencil = c(-89,42), fabric = 'prism')
2+2
wait(job)
check(job) # should be complete
}
}
geoknife/man/variables_query-method.Rd 0000644 0001762 0000144 00000001142 14036051075 017555 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/query-webdata-variables.R
\name{variables_query}
\alias{variables_query}
\alias{variables_query,webdata-method}
\alias{variables_query,webdata,missing-method}
\alias{variables_query,webdata,webprocess-method}
\title{variables query}
\usage{
variables_query(fabric, knife)
\S4method{variables_query}{webdata,missing}(fabric, knife)
\S4method{variables_query}{webdata,webprocess}(fabric, knife)
}
\arguments{
\item{variables}{}
}
\description{
find possible variables in a webdata dataset
}
\keyword{internal}
geoknife/DESCRIPTION 0000644 0001762 0000144 00000004171 14154614552 013561 0 ustar ligges users Package: geoknife
Type: Package
Title: Web-Processing of Large Gridded Datasets
Version: 1.6.6
Date: 2021-12-09
Authors@R: c( person("Jordan", "Read", role = c("aut"),
email = "jread@usgs.gov"),
person("Jordan", "Walker", role = c("aut"),
email = "jiwalker@usgs.gov"),
person("Alison", "Appling", role = c("aut"),
email = "aappling@usgs.gov"),
person("David", "Blodgett", role = c("aut", "cre"),
email = "dblodgett@usgs.gov"),
person("Emily", "Read", role = c("aut"),
email = "eread@usgs.gov"),
person("Luke", "Winslow", role = c("aut"),
email = "lwinslow@usgs.gov"),
person("Lindsay", "Carr", role = c("aut"),
email = "lcarr@usgs.gov"),
person("David", "Watkins", role = c("aut"),
email = "wwatkins@usgs.gov"))
Description: Processes gridded datasets found on the U.S. Geological Survey
Geo Data Portal web application or elsewhere, using a web-enabled workflow
that eliminates the need to download and store large datasets that are reliably
hosted on the Internet. The package provides access to several data subset and
summarization algorithms that are available on remote web processing servers (Read et al. (2015) ).
License: CC0
URL: https://github.com/USGS-R/geoknife
BugReports: https://github.com/USGS-R/geoknife/issues
Copyright: This software is in the public domain because it contains
materials that originally came from the United States
Geological Survey, an agency of the United States Department of
Interior.
Depends: R (>= 3.5)
Imports: whisker, xml2, methods, httr (>= 1.0.0), curl, sp, utils,
progress (>= 1.1.2)
Suggests: testthat, xtable, knitr, rmarkdown, ggmap, dplyr, rasterVis,
ggplot2, rgdal, maps
VignetteBuilder: knitr
RoxygenNote: 7.1.2
NeedsCompilation: no
Packaged: 2021-12-10 01:14:29 UTC; dblodgett
Author: Jordan Read [aut],
Jordan Walker [aut],
Alison Appling [aut],
David Blodgett [aut, cre],
Emily Read [aut],
Luke Winslow [aut],
Lindsay Carr [aut],
David Watkins [aut]
Maintainer: David Blodgett
Repository: CRAN
Date/Publication: 2021-12-10 09:10:02 UTC
geoknife/build/ 0000755 0001762 0000144 00000000000 14154524764 013154 5 ustar ligges users geoknife/build/vignette.rds 0000644 0001762 0000144 00000000461 14154524764 015514 0 ustar ligges users Rn0tx
jTQ?r饪7!V #lz돷t!$DH=xѾF!qK,άO~+eDL@ɪ߳廄C.b~͊T -%_6J ݚ-SFhw eѳ,[6ɢ,4DQ]UWV,E}z|- AP6!s7 yWXaݜe\8FY~}jϑfG
+e hR7ͦ4DaʔȐ^k geoknife/tests/ 0000755 0001762 0000144 00000000000 14036051075 013204 5 ustar ligges users geoknife/tests/testthat/ 0000755 0001762 0000144 00000000000 14154614552 015052 5 ustar ligges users geoknife/tests/testthat/test-whisker_templating.R 0000644 0001762 0000144 00000006070 14036341062 022045 0 ustar ligges users context("test email xml templating")
test_that("basic email template works", {
wp <- readRDS("data/test_email_wp.rds")
gj <- readRDS("data/test_email_gj.rds")
xml <- geoknife:::make_email_execute_xml(gj, wp)
fn <- "data/test_email.xml"
expect_equal(xml, gsub("\r", "", readChar(fn, file.info(fn)$size)))
})
context("test XML method templating")
test_that("basic XML creation works", {
wd <- readRDS("data/test_webdata_prism_year.rds")
wg <- readRDS("data/test_webgeom_WI.rds")
wp <- readRDS("data/test_webprocess_knife_prod.rds")
xml <- XML(wg, wd, wp)
fn <-"data/test_XML_wg_xml.xml"
expect_equal(xml, gsub("\r", "", readChar(fn, file.info(fn)$size)))
sg <- simplegeom(c(-89,45))
xml <- XML(sg, wd, wp)
fn <-"data/test_XML_sg_xml.xml"
expect_equal(nchar(xml), nchar(gsub("\r", "", readChar(fn, file.info(fn)$size))))
})
test_that("Execute XML creation with two points works", {
wd <- readRDS("data/test_webdata_fabric.rds")
wg <- readRDS("data/test_simplegeom_two_points.rds")
wp <- readRDS("data/test_webprocess_knife.rds")
xml <- XML(wg, wd, wp)
fn <- "data/test_XML_two_points_xml.xml"
expect_equal(nchar(xml), nchar(gsub("\r", "", readChar(fn, file.info(fn)$size))))
})
test_that("Execute XML works with no gmlids and multiple variables", {
# This examples was grabbed from the custom dataset vignette.
wd <- readRDS("data/test_XML_no_gmlid_wd.rds")
wg <- readRDS("data/test_XML_no_gmlid_wg.rds")
wp <- readRDS("data/test_webprocess_knife_prod.rds")
xml <- XML(wg, wd, wp)
fn <- "data/test_XML_no_gmlid_xml.xml"
expect_equal(xml, gsub("\r", "", readChar(fn, file.info(fn)$size)))
})
test_that("you can set TAB delimited and get back the right XML", {
wp <- readRDS("data/test_webprocess_knife_prod.rds")
inputs(wp, "DELIMITER") <- "TAB"
xml <- XML(stencil = readRDS("data/test_webgeom_WI.rds"),
fabric = readRDS("data/test_webdata_prism_year.rds"),
knife = wp)
expect_true(grepl('mimeType="text/tab-separated-values"', xml))
})
test_that("you can set output_type geotiff and get back the right XML", {
wp <- readRDS("data/test_XML_wp_opendapsubset.rds")
xml <- XML(stencil = readRDS("data/test_webgeom_WI.rds"),
fabric = readRDS("data/test_webdata_prism_year.rds"),
knife = wp)
expect_true(grepl('mimeType="application/zip"', xml))
})
test_that("execute XML for getgridtimerange works", {
wd <- readRDS("data/test_webdata_fabric.rds")
wp <- readRDS("data/test_webprocess_knife_prod.rds")
xml <- geoknife:::make_listopendapgrids_execute_xml(wd, wp)
fn <- "data/test_listopendapgrids.xml"
expect_equal(xml, gsub("\r", "", readChar(fn, file.info(fn)$size)))
})
test_that("execute XML for getgridtimerange works", {
wd <- readRDS("data/test_webdata_fabric.rds")
wp <- readRDS("data/test_webprocess_knife_prod.rds")
xml <- geoknife:::make_getgridtimerange_execute_xml(wd, wp)
fn <- "data/test_getgridtimerange.xml"
expect_equal(xml, gsub("\r", "", readChar(fn, file.info(fn)$size)))
}) geoknife/tests/testthat/test-times_webdata.R 0000644 0001762 0000144 00000002170 14036051075 020754 0 ustar ligges users context("Test time settings for inputs")
test_that("check using a POSIX, and that the tz is honored and converted", {
t <- geoknife:::geotime(as.POSIXct("2012-11-04",tz="America/Chicago"))
expect_equal(attr(t, 'tzone'), "UTC")
expect_is(t, 'POSIXct')
})
test_that("check using a POSIX w/o tz, it gets UTC", {
t <- geoknife:::geotime(as.POSIXct("2012-11-04"))
expect_equal(attr(t, 'tzone'), "UTC")
expect_is(t, 'POSIXct')
})
test_that("fails when times is more than 2 elements", {
testthat::skip_on_cran()
wd <- webdata('prism')
expect_error(times(wd) <- c("2012-11-04","2012-11-05","2012-11-06"))
})
test_that("warning with geotime class", {
expect_warning(geoknife:::geotime(3))
})
test_that("fails when start later than stop", {
testthat::skip_on_cran()
wd <- webdata('prism')
expect_error(times(wd) <- c("2012-11-04","2012-11-02"))
})
test_that("check using a string, it gets UTC", {
t <- geoknife:::geotime("2012-11-04")
expect_equal(attr(t, 'tzone'), "UTC")
expect_is(t, 'POSIXct')
expect_equal(t, geoknife:::geotime(as.POSIXct("2012-11-04")))
})
geoknife/tests/testthat/test-setJobState.R 0000644 0001762 0000144 00000001504 14036051075 020373 0 ustar ligges users context("Test set job state")
test_that("creating simple job", {
cancel()
testthat::skip_on_cran()
stencil <- webgeom('state::Wisconsin')
fabric <- webdata('prism')
expect_equal(geoknife:::getJobState(), 'none')
})
test_that("can start first job",{
testthat::skip_on_cran()
stencil <- webgeom('state::Wisconsin')
fabric <- webdata('prism')
job <- geoknife(stencil, fabric)
expect_true(geoknife:::getJobState() %in% c("ProcessStarted","Process successful"))
})
test_that("fail for second job",{
testthat::skip_on_cran()
stencil <- webgeom('state::Wisconsin')
fabric <- webdata('prism')
geoknife:::setJobState("ProcessStarted")
expect_error(geoknife(stencil, fabric)) #because is running.
cancel()
expect_is(geoknife(stencil, fabric),'geojob') #expect no error
})
geoknife/tests/testthat/test-processErrors.R 0000644 0001762 0000144 00000001206 14036051075 021016 0 ustar ligges users context("test failing request")
test_that("java stack failure", {
testthat::skip_on_cran()
cancel()
stencil <- webgeom('state::Wisconsin')
fabric <- webdata('prism', variables = 'wrong')
job <- geoknife(stencil, fabric, wait = TRUE)
expect_equal(geoknife:::getJobState(), "ProcessFailed")
})
context("testing required field as NA in webdata")
test_that("required field as NA in webdata", {
testthat::skip_on_cran()
cancel()
stencil <- webgeom('state::Wisconsin')
fabric <- webdata('prism', variables = 'wrong')
variables(fabric) <- as.character(NA)
expect_error(geoknife(stencil, fabric))
}) geoknife/tests/testthat/test-geoknife_utils.R 0000644 0001762 0000144 00000005303 14036051075 021154 0 ustar ligges users context("geoknife utils")
default.sleep <- geoknife:::gconfig('sleep.time')
geoknife:::gconfig(sleep.time=0.1)
test_that("verbose", {
testthat::skip_on_cran()
expect_null(geoknife:::gverbose())
gconfig(verbose=TRUE)
expect_is(geoknife:::gverbose(), 'request')
gconfig(verbose=FALSE)
})
test_that("error on url", {
testthat::skip_on_cran()
expect_error(geoknife:::retryVERB(httr::GET('bad.url.html')), ".*bad.url.html.*")
})
context("geoknife convienence functions for job state")
test_that("check status of empty job", {
testthat::skip_on_cran()
expect_equal(check(geojob())$status, 'none')
expect_equal(check(geojob())$statusType, 'none')
expect_equal(check(geojob())$percentComplete, 'none')
})
test_that("check status of an ID that is not valid", {
testthat::skip_on_cran()
expect_error(check(geojob(id='bad_id')), 'is not a valid geojob ID. Status cannot be checked')
})
test_that("check status of an ID that is incorrect", {
testthat::skip_on_cran()
fake.id <- 'bad_?id=asdf'
status <- check(geojob(id=fake.id))
expect_equal(status$status, "unknown")
expect_equal(status$statusType, "unknown")
})
test_that("check status of an ID that doesn't exist", {
testthat::skip_on_cran()
fake.id <- "https://cida.usgs.gov:443/gdp/process/RetrieveResultServlet?id=bad"
status <- check(geojob(id=fake.id))
expect_equal(status$status, "unknown")
expect_equal(status$statusType, "unknown")
})
test_that("check status of an ID that failed", {
testthat::skip_on_cran()
fabric <- webdata('prism', variables = 'wrong')
job <- geoknife(c(-89,43), fabric, wait = TRUE)
failed.id <- id(job)
testthat::skip_on_cran()
status <- check(failed.id)
expect_equal(status$statusType, "ProcessFailed")
expect_error(result(failed.id), "processing is incomplete or has failed. See check()")
})
# test_that("percent complete works",{
# Used to test percent complete -- Do Not Run in Continuous Integration!
# fabric <- webdata('prism')
# times(fabric)[2] <- '1990-01-01'
# job <- geoknife(c(-89,43), fabric, wait = F)
# Sys.sleep(5)
# status <- check(job)
# expect_equal(names(status)[4], "percentCompleted")
# expect_true(status$percentComplete != "100")
# Sys.sleep(10)
# status <- check(job)
# expect_true(status$percentComplete == "100")
# })
test_that("can create geojob from xml", {
xmlLoc <- system.file("extdata", "testjob.xml",
package = "geoknife")
job <- geojob(xml = xmlLoc)
expect_equal(length(job@url), 0)
expect_gt(length(job@xml), 0)
jobWithURL <- geojob(xml = xmlLoc, url = "foo")
expect_equal(jobWithURL@url, "foo")
})
geoknife:::gconfig(sleep.time=default.sleep) geoknife/tests/testthat/test-geoknife_xml_parser.R 0000644 0001762 0000144 00000000551 14036051075 022170 0 ustar ligges users context("Test xml parsing")
test_that("parseXMLnodes works for WFS responses", {
testthat::skip_on_cran()
local_file <- system.file('extdata','SB_getCapabilities.xml', package = 'geoknife')
xml <- xml2::read_xml(local_file)
output <- geoknife:::parseXMLgeoms(xml)
expect_is(output, "character")
expect_equal(output[2], "sb:WBIC_190900")
}) geoknife/tests/testthat/test-parseCategorical.R 0000644 0001762 0000144 00000002202 14036051075 021410 0 ustar ligges users context("parse categorical")
test_that("internal parsing works", {
local.file <- system.file('extdata','csv_categorical_multifeature.csv', package = 'geoknife')
output <- parseCategorical(local.file, delim = ',')
expect_equal(output[['Driftless Area']][output$category=='Sample Count' & output$variable == 'housing_classes_iclus_a1_2010'], 4735427)
expect_equal(output[['Wyoming Basin']][output$category=='3' & output$variable == 'housing_classes_iclus_a1_2100'], 0.0006708306)
expect_is(output, 'data.frame')
})
test_that('result works for categorical', {
testthat::skip_on_cran()
cancel()
knife <- webprocess(algorithm = list('Categorical Coverage Fraction'="gov.usgs.cida.gdp.wps.algorithm.FeatureCategoricalGridCoverageAlgorithm"),
wait=TRUE)
library(sp)
Sr1 = Polygon(cbind(c(-89,-89.2,-89.3,-89.2,-89),c(42,42.1,42,41.9,42)))
Srs1 = Polygons(list(Sr1), "sample.poly")
stencil <- simplegeom(Srl = list(Srs1), proj4string = CRS("+proj=longlat +datum=WGS84"))
job <- geoknife(stencil, 'iclus', knife) # SLOW!!!
expect_is(result(job), 'data.frame')
cancel(job)
}) geoknife/tests/testthat/test-gconfig.R 0000644 0001762 0000144 00000001646 14036302615 017566 0 ustar ligges users context("gconfig")
test_that("can get read.only variables", {
# expect_equal(gconfig("wps.url"), "https://cida-test.er.usgs.gov/gdp/process/WebProcessingService")
expect_equal(gconfig(no.readonly = FALSE), gconfig())
expect_false(length(gconfig(no.readonly = TRUE)) == length(gconfig()))
})
test_that("can't set read.only variables", {
expect_error(gconfig('version'='2.0.0'))
expect_error(gconfig('version'='2.0.0', 'wait'=TRUE))
})
test_that("can set !read.only variables", {
expect_false(gconfig('wait'))
gconfig('wait'=TRUE)
expect_true(gconfig('wait'))
gconfig('wait'=FALSE)
expect_false(gconfig('wait'))
})
test_that("can set !read.only variables on webprocess()", {
testthat::skip_on_cran()
gconfig('email'='none@gmail.com')
wp <<-webprocess()
expect_equal(wp@email, 'none@gmail.com')
expect_is(webprocess(), "webprocess")
expect_is(wp@processInputs, "list")
}) geoknife/tests/testthat/data/ 0000755 0001762 0000144 00000000000 14154524765 015771 5 ustar ligges users geoknife/tests/testthat/data/test_webprocess_tab.rds 0000644 0001762 0000144 00000001326 14036341177 022537 0 ustar ligges users U]S@
EhEQga,&ԙM`%xq@6KD[!a%jۉZOBcSt8^!Z="3Z Y83疇mcDw+5MyՌSG9XdwZo
#<ij︐ݲ|9%aX9 Tp2=8\Dԥ!c {!ap,c3~nL8쵉G