Skip to content

Main content

Feature Position Total Count Tool

Count numeric positions in one supplied Feature’s declared geometry structure, including repeated closing positions; not full GeoJSON validation.

Loading tool…

Description

Return zero and the null flag for null geometry; otherwise recursively traverse recognized geometry types and collection children to depth 32, counting each finite numeric position with at least two ordinates.

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.

Return zero and the null flag for null geometry; otherwise recursively traverse recognized geometry types and collection children to depth 32, counting each finite numeric position with at least two ordinates.

When to use this tool

Use Feature Position Total Count when you need one explicit GeoJSON object-shape or container operation.

How to use the tool and how it works

  1. Enter featureJson. 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 positionCount, nullGeometry. Inspect nullGeometry before interpreting the associated values.

Require a Feature object. Return zero and the null flag for null geometry; otherwise recursively traverse recognized geometry types and collection children to depth 32, counting each finite numeric position with at least two ordinates.1

Input fieldMeaning and unitsAccepted input
featureJsonFeature JsonRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
positionCountPosition CountRequired. Safe integer.
nullGeometryNull GeometryRequired. Boolean.
json
{
  "input": {
    "featureJson": "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[0,0],[1,0],[0,1],[0,0]]]},\"properties\":{}}"
  },
  "output": {
    "positionCount": 4,
    "nullGeometry": false
  }
}

Limitations and assumptions

  • Positions are counted by occurrence, including repeated ring closure positions. Longitude and latitude bounds, ring size and winding are not validated; empty higher-level arrays can contribute zero, while an empty Point position fails.
  • 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/feature-position-total-count — tool.io

Similar or alternative tools