lawn_collectionof: Enforce expectations about types of FeatureCollection inputs

View source: R/collectionof.R

lawn_collectionofR Documentation

Enforce expectations about types of FeatureCollection inputs

Description

Enforce expectations about types of FeatureCollection inputs

Usage

lawn_collectionof(x, type, name, lint = FALSE)

Arguments

x

a data-FeatureCollection for which features will be judged. required

type

(character) expected GeoJSON type. required.

name

(character) name of calling function. required.

lint

(logical) Lint or not. Uses geojsonhint. Takes up increasing time as the object to get linted increases in size, so probably use by default for small objects, but not for large if you know they are good geojson objects. Default: FALSE

Value

nothing if no problems - error message if a problem

See Also

Other invariant: lawn_featureof(), lawn_geosjontype()

Examples

# all okay
cat(lawn_data$points_count)
lawn_collectionof(lawn_data$points_count, 'Point', 'stuff')

# error
# lawn_collectionof(lawn_data$points_count, 'Polygon', 'stuff')

ropensci/lawn documentation built on May 18, 2022, 9:58 a.m.