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

Try the rmapshaper package in your browser

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

rmapshaper documentation built on April 11, 2023, 5:55 p.m.