Writer Directives

The suffixes shown are prefixed by <WriterKeyword> in a mapping file. By default, <WriterKeyword> for the JSON writer is JSON.

DATASET

Required/Optional: Required

The file to which the should output the JSON text. If the file does not exist it will be created.

Example:

JSON_DATASET c:\data.json

Workbench Parameter: Destination JSON File

FEATURE_TYPE_KEY

Required/Optional: Optional

This directive specifies the JSON object key whose value will contain the feature type of the FME feature represented by a JSON object. If no value is provided, then a default value of json_featuretype will be used.

If the Write Feature Type Key parameter is unchecked, no feature type will be written, regardless of the value of this parameter.

Example:

JSON_FEATURE_TYPE_KEY json_featuretype

Workbench Parameter: Feature Type key name

GEOMETRY_KEY

Required/Optional: Optional

This directive specifies the JSON object key whose value will contain the geometry of the FME feature represented by a JSON object. If no value is provided, then a default value of json_geometry is used.

Example:

JSON_GEOMETRY_KEY json_geometry

Workbench Parameter: Geometry key name

GEOMETRY_FORMAT

Required/Optional: Optional

This directive specifies the geometry format that the writer should use to populate the value of the object key specified by the GEOMETRY_KEY directive. Possible values are GeoJSON, OGC-WKT and None. If no value is provided, then a default value of GeoJSON is used.

Example:

JSON_GEOMETRY_FORMAT OGC-WKT

Workbench Parameter: Geometry format

WRITER_CHARSET

Required/Optional: Optional

The character set encoding in which the JSON text will be written. Possible values for this directive are UTF-8, UTF-16, UTF-16BE, UTF16-LE, UTF-32, UTF-32BE and UTF-32LE. If no character set is specified, the JSON text will be written in the UTF-8 character set.

Example:

JSON_WRITER_CHARSET UTF-16

Workbench Parameter: Output Character Set

WRITE_BOM

Required/Optional: Optional

The value of this directive specifies whether or not the JSON writer should preface the JSON text with a byte order marker to indicate the endianness of the Unicode text. Possible values for this directive are Yes and No. The default value is No.

Example:

JSON_WRITE_BOM Yes

Workbench Parameter: Byte Order Marker

JSONP_FUNC_NAME

Required/Optional: Optional

The value of this directive specifies the JSONP javascript function name that the user wants to wrap the JSON file with. JSONP (JSON with Padding) is developed as a standard for grabbing JSON from external domains, that works well with AJAX calls.

The default value is null. If no value is set or the default is set, then the JSON writer will output a JSON file without the JSONP padding.

Example:

JSONP_FUNC_NAME getFeatures

Workbench Parameter: JSONP function call name, if JSONP mode used