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
- Enter numericFeatureId, stringifyId. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| numericFeatureId | Already-numeric supplied ID; original decimal spelling or lost precision cannot be restored. | Required. Finite number. |
| stringifyId | Stringify Id | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| idJson | Id Json | Required. Text; maximum UTF-16 length 8192. |
{
"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
Similar or alternative tools
- Feature Null Property Preservation
Construct a null-geometry GeoJSON Feature with an explicit null property or its omission.
- Healthcare Identifier Leading Zero Preservation
Preserve a decimal healthcare identifier as text and count its initial zeros.