Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

apply_mapshaper_commands

Apply a mapshaper command string to a geojson object


Description

Apply a mapshaper command string to a geojson object

Usage

apply_mapshaper_commands(data, command, force_FC, sys = FALSE)

Arguments

data

geojson object or path to geojson file. If a file path, sys must be true

command

valid mapshaper command string

force_FC

should the output be forced to be a FeatureCollection (or Spatial*DataFrame) even if there are no attributes? Default TRUE. FeatureCollections are more compatible with rgdal::readOGR and geojsonio::geojson_sp. If FALSE and there are no attributes associated with the geometries, a GeometryCollection (or Spatial object with no dataframe) will be output.

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.

Value

geojson


rmapshaper

Client for 'mapshaper' for 'Geospatial' Operations

v0.4.4
MIT + file LICENSE
Authors
Andy Teucher [aut, cre], Kenton Russell [aut] (JavaScript support), Matthew Bloch [cph] (mapshaper Javascript library)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.