GeoJSON (Geographic JavaScript Object Notation) Writer Parameters

Writer Parameters

Output Character Set

The character set encoding in which the GeoJSON text will be written. If a character set is not specified, the GeoJSON text will be written in the UTF-8 character set.

Byte Order Marker

Specifies whether or not the GeoJSON writer should preface the JSON text with a byte order marker to indicate the endianness of the Unicode text. The default value is No.

File Structure

The value of this parameter controls the structure of the GeoJSON file produced by this writer. The options are:

  • Single FeatureCollection object containing all features – The writer will put all features into one FeatureCollection object. This will lose feature type information if the writer has more than one feature type.
  • Array of FeatureCollection objects - one per feature type – The writer will output a JSON array which contains one FeatureCollection for each feature type. Note that while each FeatureCollection is a valid GeoJSON object, the array as a whole is not a standard compliant GeoJSON value.
  • Object with feature type names as keys, FeatureCollection objects as values – The writer will output a JSON object. The keys in the object will be feature type names, and the values will be a FeatureCollection object containing the corresponding features. As with the array option, the object as a whole is not a standard compliant GeoJSON value.

Formatting Parameters

Formatting Type

The formatting of the output JSON file.

  • Linear: The entire JSON document is output on one line. This option produces the smallest possible JSON files.
  • Pretty Print: The JSON document will contain additional whitespace characters, making it much more human-readable.

Indent Size

This parameter controls the indentation style in the JSON document, and is enabled when Formatting Type is Pretty Print. The indentation style can use either tab characters, or a variable number of space characters.

Geometry

Convert Areas to Counterclockwise

  • Yes (default)  – Area and donut geometries will be converted to a "right-hand" orientation (that is, outer boundaries will be in a counterclockwise orientation and inner boundaries will be in a clockwise orientation).
  • No  – These geometries will be written out in their existing orientation.

Reproject to WGS84

By default, the GeoJSON writer will reproject all features to the WGS84/EPSG:4326 coordinate system.

Setting this parameter to No will disable this automatic reprojection, and feature geometries will be written in the coordinate system they had when arriving at the writer.

Features with no coordinate system will be assumed to already be in the WGS84 coordinate system.

JSONP

JSONP Function Name

This optional parameter specifies the JSONP JavaScript function name that the user wants to wrap the GeoJSON file with. JSONP (JSON with Padding) is developed as a standard for grabbing GeoJSON 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 GeoJSON writer will output a GeoJSON file without the JSONP padding.