Skip to content

Main content

Geometry Collection Single Member Wrapper Tool

Compute geometry collection single member wrapper from explicit bounded inputs.

Loading tool…

Description

Parse an object with a recognized geometry type and put the entire object into a one-member geometries array in a new GeometryCollection.

GeoJSON distinguishes geometry objects, Features, FeatureCollections, and nullable Feature geometry. Type names and container structure identify these roles, but a recognized token or expected array member alone does not establish full validity.

Parse an object with a recognized geometry type and put the entire object into a one-member geometries array in a new GeometryCollection.

When to use this tool

Use Geometry Collection Single Member Wrapper when you need one explicit GeoJSON object-shape or container operation.

How to use the tool and how it works

  1. Enter geometryJson. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read collectionJson. Use the output convention below.

Parse an object with a recognized geometry type and put the entire object into a one-member geometries array in a new GeometryCollection. Return serialized JSON.1

Input fieldMeaning and unitsAccepted input
geometryJsonGeometry JsonRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
collectionJsonCollection JsonRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "geometryJson": "{\"type\":\"Point\",\"coordinates\":[1,2]}"
  },
  "output": {
    "collectionJson": "{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[1,2]}]}"
  }
}

Limitations and assumptions

  • Foreign members inside the original geometry are retained. Null is rejected, but recognized type alone does not validate coordinate content or nested children.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use a full GeoJSON validator and any needed geometric validity checks for interchange. Preserve the distinction between absence, null, empty containers, recognized type, and valid coordinates.

References

  1. Calculation and input contract: geojson/geometry-collection-single-member-wrapper — tool.io

Similar or alternative tools