Description
Map the recognized geometry type to coordinate-array depth: Point 1, MultiPoint and LineString 2, Polygon and MultiLineString 3, and MultiPolygon 4.
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.
Map the recognized geometry type to coordinate-array depth: Point 1, MultiPoint and LineString 2, Polygon and MultiLineString 3, and MultiPolygon 4.
When to use this tool
Use Geometry Type Coordinate Depth Record when you need one explicit GeoJSON object-shape or container operation.
How to use the tool and how it works
- Enter type. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read depth, collection. Inspect collection before interpreting the associated values.
Map the recognized geometry type to coordinate-array depth: Point 1, MultiPoint and LineString 2, Polygon and MultiLineString 3, and MultiPolygon 4. Return depth 0 and the collection flag for GeometryCollection.1
GeometryCollection uses geometries rather than coordinates; the returned zero depth is a tool sentinel.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| type | Literal type token or parsed-value classification under the stated vocabulary. | Required. Text; one of "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection"; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| depth | Coordinate array nesting including the position; zero sentinel for GeometryCollection. | Required. Safe integer. |
| collection | Collection | Required. Boolean. |
{
"input": {
"type": "MultiPolygon"
},
"output": {
"depth": 4,
"collection": false
}
} Limitations and assumptions
- Depth counts nesting including the position array; collection depth 0 is a sentinel because its geometries member replaces a uniform coordinates array. No actual coordinates are inspected.
- 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
Similar or alternative tools
- Geometrycollection Leaf Count
Parse a GeometryCollection object and recursively traverse its geometries arrays with a depth guard of 32.
- Geometry Null Versus Empty Label
Parse geometryJson as null or an object with one of the seven recognized geometry types.