Take single points from geographical coordinates and convert it into a geojson 'Polygon' string using st_buffer.

dataframe_to_geojson(lonlat, dist = 0.00001, nQuadSegs = 2L, ...)

Arguments

lonlat

a data.frame with geographical coordinates lonlat in that order

dist

numeric, buffer distance for all lonlat

nQuadSegs

integer, number of segments per quadrant

...

further arguments passed to sf methods

Value

An object of class 'geojson' for each row in lonlat

See also

Other utility functions: sf_to_geojson()

Examples

# \donttest{ # random geographic points within bbox(10, 12, 45, 47) library("sf")
#> Linking to GEOS 3.7.2, GDAL 2.4.2, PROJ 5.2.0
set.seed(123) lonlat <- data.frame(lon = runif(2, 10, 12), lat = runif(2, 45, 47)) gjson <- dataframe_to_geojson(lonlat) # }