R/onLoad.R

Defines functions .onLoad

.onLoad <- function(libname, pkgname) { # nocov start

  if (requireNamespace("sf", quietly = TRUE)) {
    setMethod("as.geojson", "sf", function(x) {
      as.geojson(sf::as_Spatial(x))
    })
  }
} # nocov end

Try the geojson package in your browser

Any scripts or data that you put into this service are public.

geojson documentation built on Aug. 8, 2023, 5:11 p.m.