mark-p-thomas : GeoJSON Geometry Collection

These terms adhere to RFC 7946 - The GeoJSON Format.

Sections

Definition

This represents a GeoJson Feature Collection which holds a list of Geometry objects (when serialized the geometry list becomes a JSON array). This is implemented using a Delegation Pattern.

Note that the geometry list could potentially be empty. Geometries within the list must follow the specifications defined inside the Geometry class.

A GeometryCollection has a member with the name "geometries". The value of "geometries" is a List. Each element of this list is a GeoJson Geometry object. It is possible for this list to be empty.

Unlike the other geometry types, a GeometryCollection can be a heterogeneous composition of smaller Geometry objects. For example, a Geometry object in the shape of a lowercase roman "i" can be composed of one Point and one LineString.

GeometryCollections have a different syntax from single TYPE Geometry objects (Point, LineString, and Polygon) and homogeneously typed multipart Geometry objects (MultiPoint, MultiLineString and MultiPolygon) but have no different semantics. Although a GeometryCollection object has no "coordinates" member, it does have coordinates: the coordinates of all its parts belong to the collection. The "geometries" member of a GeometryCollection describes the parts of this composition. Implementations SHOULD NOT apply any additional semantics to the "geometries" array.

To maximize interoperability, implementations SHOULD avoid nested GeometryCollections. This library will not allow it.

The following may be automated in a future release.

Furthermore, GeometryCollections composed of a single part or a number of parts of a single TYPE SHOULD be avoided when that single part or a single object of multipart TYPE (MultiPoint, MultiLineString or MultiPolygon) could be used instead.

JSON Example & Class Diagram

Raw GeoJSON

{
   "type": "GeometryCollection",
   "geometries": [{
     "type": "Point",
     "coordinates": [100.0, 0.0]
   }, {
     "type": "LineString",
     "coordinates": [
       [101.0, 0.0],
       [102.0, 1.0]
     ]
   }]
 }

Class Diagram

For complete & up to date information, see the API documentation. For a dynamic interactive diagram, see the FigJam diagram.