Sections

Introduction

The input/output serialization of the JSON object is described here.

When read in & out, the GeoJSON object is comprised of nested generic types that conform to GeoJSON Specification (RFC 7946). This wrapper library has additional functionality & simplifies operations by having more specific types under aliases matching names used in this documentation.

Input

There are two ways to instantiate a new GeoJSON object:

  1. Provide a list of Positions/Points/coordinates

  2. Provide raw JSON.

Both forms of instantiation are achieved through static factory methods that are defined for each class.

In the case of raw JSON, it is assumed that the JSON object adheres to GeoJSON Specification (RFC 7946). Any additions/deviations will be ignored. Instantiation through this method is used for hooking a JSON object that may be shared by other services & libraries.

Output

There are 2 ways to output a GeoJSON object:

  1. Serialize the called object & all child objects into a JSON object by calling toJson or save

  2. Update the hooked raw JSON object (if present) by calling save

The serialized JSON object adheres to GeoJSON Specification (RFC 7946).