50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

yyjsonr (version 0.1.21)

read_geojson_str: Load GeoJSON as sf object

Description

Coordinate reference system is always WGS84 in accordance with GeoJSON RFC.

Usage

read_geojson_str(str, opts = list(), ..., json_opts = list())

read_geojson_file(filename, opts = list(), ..., json_opts = list())

Value

sf object

Arguments

str

Single string containing GeoJSON.

opts

Named list of GeoJSON-specific options. Usually created with opts_read_geojson(). Default: empty list() to use the default options.

...

Any extra named options override those in GeoJSON-specific options - opts

json_opts

Named list of vanilla JSON options as used by read_json_str(). This is usually created with opts_read_json(). Default value is an empty list() which means to use all the default JSON parsing options which is usually the correct thing to do when reading GeoJSON.

filename

Filename

Examples

Run this code
geojson_file <- system.file("geojson-example.json", package = 'yyjsonr')
read_geojson_file(geojson_file)

Run the code above in your browser using DataLab