Closed dblodgett-usgs closed 2 years ago
apply_mapshaper_commands()
works only on geojson strings or files, not directly on sf
or Spatial*
objects. So this works:
nc <- sf::read_sf(system.file("gpkg/nc.gpkg", package = "sf"))
rmapshaper::apply_mapshaper_commands(geojsonsf::sf_geojson(nc), "-clean", force_FC = TRUE)
It would certainly be possible to make apply_mapshaper_commands
a S3 generic and write methods for sf
etc objects...
Oh interesting. OK. That makes sense. Do you mind if we put that into an example? Not sure if that would cause CRAN check issues or anything.
Sure, that's a great idea. I am in the process of converting most of the internals to using the geojsonsf
package in the geojsonsf
branch. I can create an example out of this, but if you want to do a PR for it, please do it against that branch. Thanks!
I could work on a solution given a little head start, but maybe this is an easy fix?
Created on 2022-03-09 by the reprex package (v2.0.1)