Skip to content

Main content

GeoJSON: Geometry Null Vs Empty Kind Tool

Distinguish explicit null geometry from an immediate empty coordinate array in a supplied geometry object; does not validate topology or full FeatureCollections.

Loading tool…

Description

Parse geometryJson.

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.

When to use this tool

Use GeoJSON: Geometry Null Vs Empty Kind 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 result. Expand result to inspect the returned fields.

Parse geometryJson. Return null-geometry for JSON null; otherwise require an object with a string type other than GeometryCollection and an array coordinates member, and distinguish an empty outer array from nonempty coordinates.1

Input fieldMeaning and unitsAccepted input
geometryJsonGeometry JsonRequired. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultObject containing the calculated members; expand to inspect the fields below.Required. Object.
result.kindKindCalculated result member: string.
json
{
  "input": {
    "geometryJson": "null"
  },
  "output": {
    "result": {
      "kind": "null-geometry"
    }
  }
}

Limitations and assumptions

  • The string type is not checked against the recognized geometry vocabulary. Nested emptiness, positions, coordinate bounds, and full geometry validity are not checked.
  • Outputs are nested inside result. 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-vs-empty-kind — tool.io

Similar or alternative tools