Skip to content

Main content

Feature ID Stringification Policy

Serialize an explicit numeric GeoJSON feature identifier as a JSON number or string under a supplied policy.

Loading tool…

Description

Serialize an already numeric GeoJSON Feature identifier as a number or string.

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.

Serialize an already numeric GeoJSON Feature identifier as a number or string.

When to use this tool

Use Feature ID Stringification Policy when checking the stated restricted GeoJSON construction, property or identifier convention.

How to use the tool and how it works

  1. Enter numericFeatureId, stringifyId. 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 idJson. Use the output convention below.

Serialize numericFeatureId as a JSON number unless stringifyId=true, in which case serialize String(numericFeatureId).1

GeoJSON Feature identifiers can be strings or numbers. Choosing a string here preserves only the value supplied, not precision already lost during numeric entry.2

Input fieldMeaning and unitsAccepted input
numericFeatureIdAlready-numeric supplied ID; original decimal spelling or lost precision cannot be restored.Required. Finite number.
stringifyIdStringify IdRequired. Boolean.
Output fieldInterpretationReturned shape
idJsonId JsonRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "numericFeatureId": 42,
    "stringifyId": true
  },
  "output": {
    "idJson": "\"42\""
  }
}

Limitations and assumptions

  • The input is already numeric; original spelling, leading zeros and any precision lost before entry cannot be recovered by stringification.
  • 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.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

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-id-stringification-policy — tool.io

  2. RFC 7946: The GeoJSON Format — IETF

Similar or alternative tools