JSONFG -- OGC Features and Geometries JSON
New in version 3.8.
Driver short name
Driver built-in by default
This driver is built-in by default
This driver implements read/write support for access to features encoded in OGC Features and Geometries JSON - Part 1: Core format.
JSON-FG is a set of extensions over the GeoJSON format.
The following extensions are supported:
capturing the feature type in a
featureTypeelement to affect features to separate
capturing a coordinate reference system (not necessarily WGS 84) in a
coordRefSyselement, that is the one used by geometries written in the
timeelement at Feature level
minimum support for Polyhedron geometries (with a single outer shell) and Prism with Point, LineString or Polygon base.
This driver implements a draft version of the standard.
This driver supports the
This driver supports georeferencing
This driver supports virtual I/O operations (/vsimem/, etc.)
The JSON-FG driver accepts three types of sources of data:
Plain text file with JSON-FG data, typically with a .json extension
Text passed directly and encoded in JSON-FG
The URL/filename/text might be prefixed with
JSONFG: to avoid any ambiguity with other drivers.
Feature.time.date elements are mapped to a OGR
timefield of type Date. If there is a property also called
time, the OGR field for Feature.time is called
Feature.time.timestamp elements are mapped to a OGR
timefield of type DateTime
Feature.time.interval elements are mapped to a OGR
time_endfields of type Date or DateTime. If there are properties with those names, the OGR fields for Feature.time are prefixed with
jsonfg_Unbounded intervals (
..) are mapped to a unset OGR feature field.
On writing, if fields called
time_end of type
Date or DateTime are created, their content is used to set the Feature.time
element with the reverse logic as the above explained reading side.
The field names may also be prefixed with
jsonfg_ to distinguish them from
time_end that must be written in
The following configuration options are available:
OGR_JSONFG_MAX_OBJ_SIZE=<MBytes>: Defaults to
200. size in MBytes of the maximum accepted single feature, or 0 to allow for a unlimited size (GDAL >= 3.5.2).
GEOMETRY_ELEMENT=[AUTO/PLACE/GEOMETRY]: Defaults to
AUTO. Determines which JSON element to use to create geometry from. By default when the
placeelement is set, geometries are created from its content. And when it is absent or null, the content of the
geometryelement is used. Setting this option to
PLACErestricts the reading to the
placeelements. Setting this option to
GEOMETRYrestricts the reading to the
Dataset creation options
SINGLE_LAYER=[YES/NO]: Defaults to
NO. Whether a single layer will be written. If set to YES, the
featureTypeelements can be written at the FeatureCollection level instead inside each Feature.
Layer creation options
COORDINATE_PRECISION_GEOMETRY=<integer>: Defaults to
7. Maximum number of figures after decimal separator to write in coordinates of
COORDINATE_PRECISION_PLACE=<integer>: Maximum number of figures after decimal separator to write in coordinates of
SIGNIFICANT_FIGURES=<integer>: Defaults to
17. Maximum number of significant figures when writing floating-point numbers. If explicitly specified, and
COORDINATE_PRECISION_PLACEis not, this will also apply to coordinates.
WRITE_GEOMETRY=[YES/NO]: Defaults to
YES. By default, when a non-WGS 84 CRS is assigned to the layer, the geometry is written in the
placeelement, and a reprojected version of it to WGS 84 is written in the
geometryelement. This option can be set to NO to avoid writing the
placeis written. Setting this option to NO has no effect if the layer CRS is WGS 84, in which case geometries must be written in
ID_FIELD=value: Name of the source field that must be written as the 'id' member of Feature objects.
ID_TYPE=[AUTO/String/Integer]: Type of the 'id' member of Feature objects.
ID_GENERATE=[YES/NO]: Auto-generate feature ids
VSI Virtual File System API support
The driver supports reading and writing to files managed by VSI Virtual File System API, which includes "regular" files, as well as files in the /vsizip/ (read-write), /vsigzip/ (read-write), /vsicurl/ (read-only) domains.
Writing to /dev/stdout or /vsistdout/ is also supported.