apply_mapshaper_commands | R Documentation |
Apply a mapshaper command string to a geojson object
apply_mapshaper_commands(
data,
command,
force_FC = TRUE,
sys = FALSE,
sys_mem = getOption("mapshaper.sys_mem", default = 8),
quiet = getOption("mapshaper.sys_quiet", default = FALSE),
gj2008 = FALSE
)
data |
character containing geojson or path to geojson file. If a file
path, |
command |
valid mapshaper command string |
force_FC |
should the output be forced to be a FeatureCollection (or sf
object or Spatial*DataFrame) even if there are no attributes? Default
|
sys |
Should the system mapshaper be used instead of the bundled mapshaper? Gives better performance on large files. Requires the mapshaper node package to be installed and on the PATH. |
sys_mem |
How much memory (in GB) should be allocated if using the
system mapshaper ( |
quiet |
If |
gj2008 |
Generate output that is consistent with the pre-RFC 7946
GeoJSON spec (dating to 2008). Polygon rings are CW and holes are CCW,
which is the opposite of the default RFC 7946-compatible output. This should
be rarely needed, though may be useful when preparing data for D3-based
data visualizations (such as |
geojson
nc <- sf::read_sf(system.file("gpkg/nc.gpkg", package = "sf"))
rmapshaper::apply_mapshaper_commands(geojsonsf::sf_geojson(nc), "-clean")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.