Skip to content

Main content

Geometry Null Versus Empty Label Tool

Distinguish null geometry from an empty declared geometry container; not a full GeoJSON topology validator.

Loading tool…

Description

Parse geometryJson as null or an object with one of the seven recognized geometry types.

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 geometryJson as null or an object with one of the seven recognized geometry types.

When to use this tool

Use Geometry Null Versus Empty Label 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 nullGeometry, emptyContainer, kind. Inspect nullGeometry, emptyContainer before interpreting the associated values.

Parse geometryJson as null or an object with one of the seven recognized geometry types. For objects, require an array geometries member for GeometryCollection or coordinates otherwise, and report whether that outer container is empty.1

Input fieldMeaning and unitsAccepted input
geometryJsonGeometry JsonRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
nullGeometryNull GeometryRequired. Boolean.
emptyContainerEmpty ContainerRequired. Boolean.
kindKindRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "geometryJson": "null"
  },
  "output": {
    "nullGeometry": true,
    "emptyContainer": false,
    "kind": "null"
  }
}

Limitations and assumptions

  • Null geometry and an empty container are distinct states. A nonempty collection of empty children is not itself an empty container; coordinate and child validity are not checked.
  • 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-null-versus-empty-label — tool.io

Similar or alternative tools