to_geojson: Dataframe export as GeoJSON

View source: R/geospatial.R

to_geojsonR Documentation

Dataframe export as GeoJSON

Description

Exports a dataframe to a GeoJSON file where latitude/longitude data is available.

Usage

to_geojson(
  dataframe,
  filename,
  overwrite = FALSE,
  pretty = FALSE,
  lat = "latitude",
  lon = "longitude"
)

Arguments

dataframe

An input dataframe to convert

filename

The exported filename, relative to the current working directory. If the file already exists and overwrite is not set to TRUE, an error will be thrown

overwrite

Indicates if an existing file in the current directory should be overwritten by the new file. Defaults to FALSE.

pretty

Indicates if file is formatted with whitespace as newlines, indentations and spaces to make the JSON data more readable. Defaults to FALSE.

lat

The name of the column with latitude data. Defaults to "latitude".

lon

The name of the column with longitude data. Defaults to "longitude".


gideononline/gideon-api-r documentation built on March 19, 2022, 5:07 p.m.