Skip to content

Main content

Geometry Type Coordinate Depth Record Tool

Calculate geometry type coordinate depth record from explicit caller-supplied inputs.

Loading tool…

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

  1. Enter type. 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 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 fieldMeaning and unitsAccepted input
typeLiteral 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 fieldInterpretationReturned shape
depthCoordinate array nesting including the position; zero sentinel for GeometryCollection.Required. Safe integer.
collectionCollectionRequired. Boolean.
json
{
  "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

  1. Calculation and input contract: geojson/geometry-type-coordinate-depth-record — tool.io

  2. RFC 7946: geometry objects — IETF

Similar or alternative tools