Skip to content

Main content

GeoJSON: Polygon Ring Start End Pair Tool

Extract the exact first/last position pair of one nonempty candidate GeoJSON ring and report equality without repairing or claiming full ring validity.

Loading tool…

Description

Return first and last positions and exact structural equality as closed inside result.

A polygon ring is a closed sequence of coordinate positions. Closure, minimum position count, distinct vertices, winding, and self-intersection are separate properties, so a check of one cannot stand in for complete polygon validation.

Return first and last positions and exact structural equality as closed inside result.

When to use this tool

Use GeoJSON: Polygon Ring Start End Pair when you need a specific ring-shape or closure diagnostic.

How to use the tool and how it works

  1. Enter ring. 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 result. Expand result to inspect the returned fields.

Require a nonempty ring with positions of length two or three. Return first and last positions and exact structural equality as closed inside result.1

Input fieldMeaning and unitsAccepted input
ringRingRequired. Array of array of finite number. Implementation limit: 128 items.
Output fieldInterpretationReturned shape
resultObject containing the calculated members; expand to inspect the fields below.Required. Object.
result.firstFirstCalculated result member: array.
result.lastLastCalculated result member: array.
result.closedClosure or endpoint state under the documented exact comparison.Calculated result member: boolean.
json
{
  "input": {
    "ring": [
      [
        0,
        0
      ],
      [
        1,
        1
      ],
      [
        0,
        0
      ]
    ]
  },
  "output": {
    "result": {
      "first": [
        0,
        0
      ],
      "last": [
        0,
        0
      ],
      "closed": true
    }
  }
}

Limitations and assumptions

  • A single position compares equal to itself and can be closed; no minimum ring size, common intermediate dimension, longitude/latitude range, or polygon topology is validated.
  • Outputs are nested inside result. 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 complete GeoJSON and polygon validator for publication or geometric operations. Check coordinate convention, distinctness, winding, self-intersection, and hole relationships as appropriate.

References

  1. Calculation and input contract: geojson/polygon-ring-start-end-pair — tool.io

Similar or alternative tools