Skip to content

Commit

Permalink
Merge pull request #149 from R-ArcGIS/doc
Browse files Browse the repository at this point in the history
Update Documentation
  • Loading branch information
JosiahParry authored Feb 16, 2024
2 parents e6707dc + 2d3a04a commit bc462e9
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 44 deletions.
2 changes: 1 addition & 1 deletion R/add_item.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ add_item <- function(
description = description,
tags = tags,
snippet = snippet,
text = jsonify::to_json(feature_collection, unbox = TRUE),
text = unclass(jsonify::to_json(feature_collection, unbox = TRUE)),
extent = extent,
spatialReference = spatial_reference,
categories = categories,
Expand Down
2 changes: 1 addition & 1 deletion R/arc-add-update-delete.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' the alias. See Details for more.
#' @param rollback_on_failure if anything errors, roll back writes.
#' Defaults to `TRUE`.
#' @param token your authorization token. By default checks the environment variable `ARCGIS_TOKEN`
#' @param token your authorization token.
#'
#' @inheritParams arc_select
#' @details
Expand Down
5 changes: 2 additions & 3 deletions R/arc-open.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
#' `r lifecycle::badge("experimental")`
#'
#' @param url The url of the remote resource. Must be of length one.
#' @param token your authorization token. By default checks the environment
#' variable `ARCGIS_TOKEN`. Set your token using `arcgisutils::set_auth_token()`.
#' @param token your authorization token.
#'
#' @seealso arc_select arc_raster
#' @export
#' @returns
#' Depending on the provided URL returns a `FeatureLayer`, `Table`, `FeatureServer`, `ImageServer`, or `MapServer`.
#' Depending on the provided URL returns a `FeatureLayer`, `Table`, `FeatureServer`, `ImageServer`, or `MapServer`. Each of these objects is a named list containing the properties of the service.
#' @examples
#'
#'if (interactive()) {
Expand Down
8 changes: 4 additions & 4 deletions R/arc-raster.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#' Retrieve Imagery
#' Read from an Image Server
#'
#' Given an `ImageServer` export an image as a `SpatRaster` from the terra package.
#' Given an `ImageServer` export an image as a terra `SpatRaster` object.
#' See [`terra::rast`].
#'
#' @param x an `ImageServer` as created with `image_server()`.
#' @param x an `ImageServer` as created with `arc_open()`.
#' @param xmin the minimum bounding longitude value.
#' @param xmax the maximum bounding longitude value.
#' @param ymin that minimum bounding latitude value.
Expand All @@ -14,7 +14,7 @@
#' @param format default `"tiff"`. Must be one of "jpgpng", "png", "png8", "png24", "jpg", "bmp", "gif", "tiff", "png32", "bip", "bsq", "lerc".
#' @param width default `NULL`. Cannot exceed `x[["maxImageWidth"]]`.
#' @param height default `NULL`. Cannot exceed `x[["maxImageHeight"]]`.
#' @param token authorization token fetched from the environment variable `ARCGIS_TOKEN`
#' @param token default `arc_token()` authorization token.
#'
#' @details
#'
Expand Down
8 changes: 4 additions & 4 deletions R/arc-read.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Read a ArcGIS FeatureLayer, Table, or ImageServer
#' Read an ArcGIS FeatureLayer, Table, or ImageServer
#'
#' [arc_read()] combines the functionality of [arc_open()] with [arc_select()]
#' or [arc_raster()] to read an ArcGIS FeatureLayer, Table, or ImageServer to a
#' `sf` object or object of class `SpatRaster`. Optionally set, check, or modify
#' or [arc_raster()] to read an ArcGIS `FeatureLayer`, `Table`, or `ImageServer` to an
#' `sf` or `SpatRaster` object. Optionally, set, check, or modify
#' names for the returned data frame or sf object using the `col_names` and
#' `name_repair` parameters.
#'
Expand All @@ -14,7 +14,7 @@
#' the number of columns in the layer, the default names are replaced with the
#' new names. If `col_names` has one fewer name than the default column names,
#' the existing sf column name is retained. If `col_names` is the string
#' `"alias"`, names are set to match the available alias names for the layer.
#' `"alias"`, names are set to match the alias names for the layer, if available.
#' @param col_select Default `NULL`. A character vector of the field names to be
#' returned. By default, all fields are returned.
#' @param n_max Defaults to 10000 or an option set with
Expand Down
8 changes: 4 additions & 4 deletions R/arc-select.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Query a Hosted Feature Service
#' Query a Feature Service
#'
#' [arc_select()] takes a `FeatureLayer`, `Table`, of `ImageServer` object and returns data from
#' the layer as an `sf` object or `tibble` respectively.
#' [arc_select()] takes a `FeatureLayer`, `Table`, of `ImageServer` object and
#' returns data from the layer as an `sf` object or `data.frame` respectively.
#'
#' @param x an object of class `FeatureLayer`, `Table`, or `ImageServer`.
#' @param fields a character vector of the field names that you wish to be
Expand All @@ -16,7 +16,7 @@
#' @inheritParams prepare_spatial_filter
#' @param n_max the maximum number of features to return. By default returns
#' every feature available. Unused at the moment.
#' @param page_size the maximum number of features to return per request. See Details.
#' @param page_size the maximum number of features to return per request. Useful when requests return a 500 error code. See Details.
#' @param ... additional query parameters passed to the API.
#' @inheritParams arc_open
#'
Expand Down
1 change: 1 addition & 0 deletions R/arcgislayers-package.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#' @keywords internal
#' @import arcgisutils
#' @noRd
"_PACKAGE"

Expand Down
4 changes: 2 additions & 2 deletions R/print-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ print.Table <- function(x, ...) {
}

#' @export
head.Table <- function(x, n = 6, token = Sys.getenv("ARCGIS_TOKEN"), ...) {
head.Table <- function(x, n = 6, token = arc_token(), ...) {
collect_layer(x, n, token)
}

Expand Down Expand Up @@ -86,7 +86,7 @@ print.FeatureLayer <- function(x, ...) {

#' @importFrom utils head
#' @export
head.FeatureLayer <- function(x, n = 6, token = Sys.getenv("ARCGIS_TOKEN"), ...) {
head.FeatureLayer <- function(x, n = 6, token = arc_token(), ...) {
collect_layer(x, n, token)
}

Expand Down
5 changes: 2 additions & 3 deletions man/arc_open.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/arc_raster.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions man/arc_read.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions man/arc_select.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/get_layer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/get_layer_estimates.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/truncate_layer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc462e9

Please sign in to comment.