Skip to contents

Dates within the s2cd vector are compared to the date range, inclusively. An s2_cell vector or s2_cell_union object is used to test for intersection with the s2 cells. If both a date range and s2 cell union are provided, s2cd_within() will return TRUE only if both are within.

Usage

s2cd_within(x, date_range = NULL, s2_cell = NULL)

Arguments

x

an s2_cell_dates vector

date_range

length two Date vector representing a minimum and maximum allowable date

s2_cell

a s2_cell vector, often a covering represented by many cells of different resolutions; see examples

Value

logical

Examples

# create compact representations of arbitrary polygons:
# s2::s2_covering_cell_ids_agg(
#   codec::cincy_city_geo(),
#   max_level = 12, max_cells = 100)