Skip to contents

GeoJSON Linting

Usage

linting_opts(
  lint = FALSE,
  method = "hint",
  error = FALSE,
  suppress_pkgcheck_warnings = FALSE
)

Arguments

lint

(logical) lint geojson or not. Default: FALSE

method

(character) method to use:

error

(logical) Throw an error on parse failure? If TRUE, then function returns TRUE on success, and stop with the error message on error. Default: FALSE

suppress_pkgcheck_warnings

(logical) Suppress warning when geojsonlint is not installed? Default: FALSE

Details

if you have geojsonlint installed, we can lint your GeoJSON inputs for you. If not, we skip that step.

Note that even if you aren't linting your geojson with geojsonlint, we still do some minimal checks.

Examples

linting_opts(lint = TRUE)
#> $lint
#> [1] TRUE
#> 
#> $method
#> [1] "hint"
#> 
#> $error
#> [1] FALSE
#> 
#> $suppress_pkgcheck_warnings
#> [1] FALSE
#> 

linting_opts(lint = TRUE, method = "hint")
#> $lint
#> [1] TRUE
#> 
#> $method
#> [1] "hint"
#> 
#> $error
#> [1] FALSE
#> 
#> $suppress_pkgcheck_warnings
#> [1] FALSE
#> 
linting_opts(lint = TRUE, method = "hint", error = TRUE)
#> $lint
#> [1] TRUE
#> 
#> $method
#> [1] "hint"
#> 
#> $error
#> [1] TRUE
#> 
#> $suppress_pkgcheck_warnings
#> [1] FALSE
#> 
linting_opts(lint = TRUE, method = "lint")
#> $lint
#> [1] TRUE
#> 
#> $method
#> [1] "lint"
#> 
#> $error
#> [1] FALSE
#> 
#> $suppress_pkgcheck_warnings
#> [1] FALSE
#> 
linting_opts(lint = TRUE, method = "lint", error = TRUE)
#> $lint
#> [1] TRUE
#> 
#> $method
#> [1] "lint"
#> 
#> $error
#> [1] TRUE
#> 
#> $suppress_pkgcheck_warnings
#> [1] FALSE
#> 
linting_opts(lint = TRUE, method = "validate")
#> $lint
#> [1] TRUE
#> 
#> $method
#> [1] "validate"
#> 
#> $error
#> [1] FALSE
#> 
#> $suppress_pkgcheck_warnings
#> [1] FALSE
#> 
linting_opts(lint = TRUE, method = "validate", error = TRUE)
#> $lint
#> [1] TRUE
#> 
#> $method
#> [1] "validate"
#> 
#> $error
#> [1] TRUE
#> 
#> $suppress_pkgcheck_warnings
#> [1] FALSE
#>