Skip to content

Main content

Geometry Collection Empty Member Role Tool

Distinguish an empty collection from supplied member geometries flagged empty.

Loading tool…

Description

Return indexes with true flags and set collectionEmpty only when the member list itself has length zero.

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.

Return indexes with true flags and set collectionEmpty only when the member list itself has length zero.

When to use this tool

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

How to use the tool and how it works

  1. Enter memberTypes, emptyMembers. Keep parallel arrays aligned. 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 emptyIndices, collectionEmpty. Inspect collectionEmpty before interpreting the associated values.

Require equally long recognized memberTypes and emptyMembers arrays. Return indexes with true flags and set collectionEmpty only when the member list itself has length zero.1

Input fieldMeaning and unitsAccepted input
memberTypesMember TypesRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
emptyMembersEmpty MembersRequired. Array of boolean; maximum items 256.
Output fieldInterpretationReturned shape
emptyIndicesEmpty IndicesRequired. Array of safe integer; maximum items 256.
collectionEmptyCollection EmptyRequired. Boolean.
json
{
  "input": {
    "memberTypes": [
      "Point",
      "LineString"
    ],
    "emptyMembers": [
      false,
      true
    ]
  },
  "output": {
    "emptyIndices": [
      1
    ],
    "collectionEmpty": false
  }
}

Limitations and assumptions

  • Emptiness is supplied metadata rather than derived from actual geometry. A collection with members all marked empty still has collectionEmpty false.
  • 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-empty-member-role — tool.io

Similar or alternative tools