Package 'sdf'

Title: What the Package Does (One Line, Title Case)
Description: What the package does (one paragraph).
Authors: Josiah Parry [aut, cre]
Maintainer: Josiah Parry <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-09-02 02:53:33 UTC
Source: https://github.com/josiahparry/sdf

Help Index


Required Generics

Description

Required Generics

Usage

is_geometry(x)

bounding_box(x)

combine_geometry(x)

Geometry Accessor

Description

Geometry Accessor

Usage

sdf_geometry(x)

Spatial Predicate Functions Predicates are optional, but enable the use of sdf_join().

Description

Predicates should return a sparse matrix list representation. The elements the list are an integer vector indicating the features where the predicate is TRUE. The vector must be the row position.

Usage

sdf_intersects(x, y, ...)

sdf_contains(x, y, ...)

sdf_within(x, y, ...)

sdf_crosses(x, y, ...)

sdf_covers(x, y, ...)

sdf_covered_by(x, y, ...)

sdf_equals(x, y, ...)

sdf_disjoint(x, y, ...)

sdf_touches(x, y, ...)

sdf_overlaps(x, y, ...)

Left join only

Description

Left join only

Usage

sdf_join(x, y, predicate = sdf_intersects, ..., suffix = c("_x", "_y"))

Arguments

predicate

a function that returns a sparse matrix list representation


Optional Generics

Description

Optional Generics

Usage

sdf_length(x, ...)

sdf_area(x, ...)

Primary Interface

Description

These functions are optional but strongly suggested.

Usage

union_geometry(x)

simplify_geometry(x, ...)

buffer_geometry(x, distance, ...)

centroid(x)

convex_hull(x)

concave_hull(x, concavity, ...)

Templates to extend sfd

Description

These templates can be used to extend sdf by implementing a new compatible geometry vector column.

Usage

use_sdf_template_class(
  class,
  save_as = paste0("R/sdf-compat-", class, ".R"),
  open = TRUE
)

use_sdf_template_zzz(class, save_as = "R/zzz.R", open = TRUE)

Arguments

class

a scalar character of the class name of your geometry class

save_as

Path of file to create, relative to root of active project. Defaults to template

open

Open the newly created file for editing? Happens in RStudio, if applicable, or via utils::file.edit() otherwise.

Details

  • use_sdf_template_class() will create an R script with the scaffolding needed to implement your geometry class to be compatible with sdf.

  • use_sdf_template_zzz() will create a zzz.R file that will export your methods to be available to sdf.