g_export_to_json() exports input geometries to GeoJSON strings. Interface
to OGR_G_ExportToJsonEx() in the GDAL API.
Arguments
- geom
Either a raw vector of WKB or list of raw vectors, or a character vector containing one or more WKT strings.
- srs
Optional character string specifying the spatial reference system for the geometries given in
geom. May be in WKT format or any of the formats supported bysrs_to_wkt().- options
Optional character vector of
NAME=VALEpairs. May include any of the options supported byOGR_G_ExportToJsonEx()in the GDAL API (see Details).
Details
Available options are the ones supported by OGR_G_ExportToJsonEx(). See
https://gdal.org/en/latest/api/vector_c_api.html.
If there is a SRS attached to the geometry, and the geometry is aimed at
being stored in the "place" member of JSON-FG features, then
COORDINATE_ORDER=AUTHORITY_COMPLIANT option must be set (added in GDAL
3.12.1). When a SRS is attached to the geometry, and AUTHORITY_COMPLIANT
is used, the coordinates will be emitted in the order of the official SRS
definition. When using TRADITIONAL_GIS_ORDER (the default), coordinates
are emitted in longitude/easting first, then latitude/northing second. When
no SRS is attached, coordinates are emitted in the order they are set in the
geometry.