toTopoJSON: Transform one or several SpatialPolygonsDataFrame into a...

Description Usage Arguments Value References

Description

toTopoJSON takes one or several SpatialPolygonsDataFrame objects and creates a topojson file, multi-layered if needed. This functions needs the topojson CLI utility to be installed (see https://github.com/mbostock/topojson/wiki/Installation).

Usage

1
2
3
toTopoJSON(SPDF, path = getwd(), filename = NULL, simplification = 1,
  quantisation = "1e4", width = 800, height = 400, properties = NULL,
  id = NULL)

Arguments

SPDF

a named list of SpatialPolygonsDataFrame objects. The names of the list elements need to be the same as the names of the SPDF objects.

path

the path where the topojson file should be registered. By default, the working directory.

filename

the name of the topojson file, without extension. By default, the name of the first SPDF object.

simplification

the geometry simplification factor. A numeric between 0 and 1, 0 being the maximum simplification, 1 retaining all the subtleties of the geometries. See https://github.com/mbostock/topojson/wiki/Command-Line-Reference for more details.

quantisation

maximum number of differentiable points along either dimension.

width

width of the desired output (in pixels)

height

height of the desired output (in pixels)

properties

the names of the properties of the SPDFs to be exported to the topojson file. A vector of character strings. If NULL (the default), all columns of the SPDFs dataframes. If "", no properties are included in the TopoJSON file.

id

the name of the SPDF column used as ID. By default, no ID.

Value

Nothing. As a side effect, a topojson file is created.

References

Mike Bostock's wiki: https://github.com/mbostock/topojson/wiki.


joelgombin/toTopoJSON documentation built on May 19, 2019, 3 p.m.