Skip to content

Commit

Permalink
clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Nov 2, 2023
1 parent 6bd0a5f commit 315df0d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Authors@R: c(
person("EcoHealth Alliance", role="cph"),
person("USAID PREDICT", role = "fnd"))
Description: Provides a drop-in replacement for rasterize() from the 'raster'
package that takes 'sf'-type objects, and is much faster. There is support
for the main options provided by the rasterize() function, including
setting the field used and background value, and options for
package that takes polygon vector or dataframe objects, and is much faster.
There is support for the main options provided by the rasterize() function,
including setting the field used and background value, and options for
aggregating multi-layer rasters. Uses the scan line algorithm attributed to
Wylie et al. (1967) <doi:10.1145/1465611.1465619>.
License: MIT + file LICENSE
Expand Down
12 changes: 8 additions & 4 deletions R/fasterize.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ make_sf <- function(x, attr = NULL) {
}


#' Rasterize an sf object of polygons
#' Rasterize a vector or dataframe object of polygons
#'
#' Rasterize set of polygons
#'
Expand All @@ -14,12 +14,16 @@ make_sf <- function(x, attr = NULL) {
#' is originally attributed to
#' Wylie et al. (1967) \doi{10.1145/1465611.1465619}.
#'
#' @param sf an [sf::sf()] object with a geometry column of POLYGON and/or
#' MULTIPOLYGON objects.
#' Note that original implementation worked only for sf dataframes of class "sf", but this
#' now works for any polygon vector (sfc, wkt, wkb, geos) or dataframe with a polygon vector
#' supported by the wk package handlers.
#'
#' @param a polygon vector or data frame object with a geometry column of POLYGON and/or
#' MULTIPOLYGON (equivalent) objects.
#' @param raster A raster object. Used as a template for the raster output.
#' Can be created with [raster::raster()].
#' The fasterize package provides a method to create a raster object from
#' an sf object.
#' an polygon dataset.
#' @param field character. The name of a column in `sf`,
#' providing a value for each of the polygons rasterized. If NULL (default),
#' all polygons will be given a value of 1.
Expand Down
5 changes: 2 additions & 3 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
## usethis namespace: end
NULL

#' Fast sf-to-raster conversion
#' Fast polygons-to-raster conversion
#'
#' Fast sf-to-raster conversion
#' Fast polygons-to-raster conversion
#'
#' @docType package
#' @name fasterize-package
NULL

Expand Down
4 changes: 2 additions & 2 deletions man/fasterize-package.Rd

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

14 changes: 9 additions & 5 deletions man/fasterize.Rd

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

0 comments on commit 315df0d

Please sign in to comment.