Skip to content

Main content

Feature ID Leading Zero String Guard Tool

Compute feature id leading zero string guard from explicit bounded inputs.

Loading tool…

Description

Parse an ID that must be a JSON string or number.

Feature properties and foreign members are JSON metadata, distinct from the geometry coordinates. Exact key operations and ID type checks can preserve useful distinctions, but do not independently authenticate records or validate an entire Feature.

Parse an ID that must be a JSON string or number.

When to use this tool

Use Feature ID Leading Zero String Guard when you need a literal GeoJSON metadata, identifier, or shallow-key operation.

How to use the tool and how it works

  1. Enter idJson. 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 stringId, losesZerosIfNumeric. Inspect stringId, losesZerosIfNumeric before interpreting the associated values.

Parse an ID that must be a JSON string or number. Report whether it is a string and whether a string matches the entire pattern 0 followed by one or more decimal digits.1

Input fieldMeaning and unitsAccepted input
idJsonId JsonRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
stringIdString IdRequired. Boolean.
losesZerosIfNumericLoses Zeros If NumericRequired. Boolean.
json
{
  "input": {
    "idJson": "\"0012\""
  },
  "output": {
    "stringId": true,
    "losesZerosIfNumeric": true
  }
}

Limitations and assumptions

  • The leading-zero flag covers this exact nonnegative digit pattern, not every spelling that numeric conversion could alter. No conversion, uniqueness check, or ID assignment occurs.
  • 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 and its intended data model after editing. Preserve identifier precision and distinguish null values, absent members, collisions, and nested properties explicitly.

References

  1. Calculation and input contract: geojson/feature-id-leading-zero-string-guard — tool.io

Similar or alternative tools