Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better documentation for make_*() and unnest() functions #70

Merged
merged 2 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions R/geos-make.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

#' Create geometries from vectors of coordinates
#'
#' These functions transform raw coordinates into point, line, polygon,
#' features, or nest a vector of geometries into a MULTI* type or
#' GEOMETRYCOLLECTION. See [wk::wk_coords()], [geos_unnest()], or
#' [wk::wk_flatten()] to perform inverse operations; see [wk::xy()],
#' [wk::wk_linestring()], [wk::wk_polygon()], or [wk::wk_collection()] for
#' generic versions that work with non-GEOS types.
#'
#' @param x,y,z Vectors of coordinate values
#' @param feature_id,ring_id Vectors for which a change in sequential values
#' indicates a new feature or ring. Use [factor()] to convert from a character
Expand Down
15 changes: 13 additions & 2 deletions R/geos-unnest.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@

#' Unnest nested geometries
#'
#' Ths function flattens nested geometries (i.e., multi or
#' geometrycollection types) into a vector with the same or fewer levels of
#' nesting. See [geos_geometry_n()] to access individual geometries within a
#' collection; see [wk::wk_flatten()] for a version of this function that
#' works with non-GEOS geometries; see [geos_make_collection()] and
#' [wk::wk_collection()] for functions that perform the inverse operation.
#'
#' @inheritParams geos_read_wkt
#' @inheritParams wkutils::wkt_unnest
#' @param keep_empty If `TRUE`, EMPTY geomtries iare left as-is rather than

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo on "are"

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

#' collapsing to length 0.
#' @param keep_multi If `TRUE`, MULTI* geometries are not expanded to
#' sub-features (i.e., only GEOMETRYCOLLECTIONs are).
#' @param max_depth The maximum recursive GEOMETRYCOLLECTION depth to unnest.
#'
#' @return A [GEOS geometry vector][as_geos_geometry] with a length
#' @return A [GEOS geometry vector][as_geos_geometry], with a length
#' greater than or equal to `geom` with an attribute "lengths"
#' that can be used to map elements of the result to the
#' original item.
Expand Down
7 changes: 6 additions & 1 deletion man/geos_make_point.Rd

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

16 changes: 11 additions & 5 deletions man/geos_unnest.Rd

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