Skip to content

Main content

Feature Collection Single Feature Wrapper Tool

Wrap one structurally identified GeoJSON Feature in a FeatureCollection without revalidating its nested geometry.

Loading tool…

Description

Wrap the whole object as the only feature in a newly serialized FeatureCollection.

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.

Wrap the whole object as the only feature in a newly serialized FeatureCollection.

When to use this tool

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

How to use the tool and how it works

  1. Enter featureJson. 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.

Require an object whose type is Feature and which has own geometry and properties members. Wrap the whole object as the only feature in a newly serialized FeatureCollection.1

Input fieldMeaning and unitsAccepted input
featureJsonFeature JsonRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
collectionJsonCollection JsonRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "featureJson": "{\"type\":\"Feature\",\"geometry\":null,\"properties\":{}}"
  },
  "output": {
    "collectionJson": "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":null,\"properties\":{}}]}"
  }
}

Limitations and assumptions

  • Member presence does not validate their values. Original foreign members remain inside the Feature, while the outer collection is newly constructed.
  • 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/feature-collection-single-feature-wrapper — tool.io

Similar or alternative tools