R/drop_null_geometries.R

Defines functions drop_null_geometries.json drop_null_geometries

Documented in drop_null_geometries

#' Drop features from a \code{geo_json} FeatureCollection with null geometries
#'
#' @param x a \code{geo_json} FeatureCollection
#'
#' @return a \code{geo_json} FeatureCollection with Features with null geometries
#' removed
#' @export
drop_null_geometries <- function(x) {
  UseMethod("drop_null_geometries")
}

#' @export
drop_null_geometries.json <- function(x) {
  apply_mapshaper_commands(x, "-filter remove-empty", TRUE)
}

#' @export
drop_null_geometries.character <- drop_null_geometries.json
ateucher/rmapshaper documentation built on July 8, 2024, 7:13 p.m.