Convert many input types with spatial data to TopoJSON as a list
Convert many input types with spatial data to TopoJSON as a list
topojson_list( input, lat =NULL, lon =NULL, group =NULL, geometry ="point", type ="FeatureCollection", convert_wgs84 =FALSE, crs =NULL, object_name ="foo", quantization =0,...)
Arguments
input: Input list, data.frame, spatial class, or sf class. Inputs can also be dplyr tbl_df class since it inherits from data.frame
lat: (character) Latitude name. The default is NULL, and we attempt to guess.
lon: (character) Longitude name. The default is NULL, and we attempt to guess.
group: (character) A grouping variable to perform grouping for polygons - doesn't apply for points
geometry: (character) One of point (Default) or polygon.
type: (character) The type of collection. One of FeatureCollection (default) or GeometryCollection.
convert_wgs84: Should the input be converted to the standard CRS for GeoJSON (https://tools.ietf.org/html/rfc7946) (geographic coordinate reference system, using the WGS84 datum, with longitude and latitude units of decimal degrees; EPSG: 4326). Default is FALSE though this may change in a future package version. This will only work for sf or Spatial objects with a CRS already defined. If one is not defined but you know what it is, you may define it in the crs argument below.
crs: The CRS of the input if it is not already defined. This can be an epsg code as a four or five digit integer or a valid proj4 string. This argument will be ignored if convert_wgs84 is FALSE
or the object already has a CRS.
object_name: (character) name to give to the TopoJSON object created. Default: "foo"