Skip to content

Main content

Feature Property Null Removal Choice

Remove only top-level explicit null members from a supplied GeoJSON properties object under a caller-selected policy, preserving other values.

Loading tool…

Description

Optionally remove top-level null entries from a JSON properties object.

GeoJSON separates a Feature’s identifier, geometry and properties. Null geometry, an explicit null property and an omitted property are distinct states. Coordinate-order labels do not transform positions, and stringifying a value already entered as a number cannot restore lost identifier precision or spelling.

Optionally remove top-level null entries from a JSON properties object.

When to use this tool

Use Feature Property Null Removal Choice when checking the stated restricted GeoJSON construction, property or identifier convention.

How to use the tool and how it works

  1. Enter propertiesJson, removeNulls. 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 propertiesJson, removedNames. Use the output convention below.

Parse propertiesJson as a portable JSON object, rejecting null, arrays and invalid/nonportable values. If removeNulls=true, remove only top-level members with null values; serialize remaining members and return removedNames.1

GeoJSON properties can contain JSON values, including null. Removing top-level null entries is a caller choice rather than a requirement of the format.2

Input fieldMeaning and unitsAccepted input
propertiesJsonProperties JsonRequired. Text; maximum UTF-16 length 8192.
removeNullsRemove NullsRequired. Boolean.
Output fieldInterpretationReturned shape
propertiesJsonProperties JsonRequired. Text; maximum UTF-16 length 8192.
removedNamesTop-level explicit-null member names removed under the selected policy; nested nulls stay.Required. Array of text; maximum UTF-16 length 8192; maximum items 256.
json
{
  "input": {
    "propertiesJson": "{\"a\":null,\"b\":2}",
    "removeNulls": true
  },
  "output": {
    "propertiesJson": "{\"b\":2}",
    "removedNames": [
      "a"
    ]
  }
}

Limitations and assumptions

  • Nested nulls remain, and null differs from an absent property; no whole Feature, schema semantics or data completeness is validated.
  • 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

Validate the complete Feature against the intended GeoJSON contract and use verified longitude/latitude and datum conventions for actual geographic data exchange.

References

  1. Calculation and input contract: geojson/feature-property-null-removal-choice — tool.io

  2. RFC 7946: The GeoJSON Format — IETF

Similar or alternative tools