0

I have a topojson file which represents a hexagon. A hexagon has 6 vertices, so I was expecting the arcs attribute of topojson file would contain 6 points, but it contains 7.

I wanted to know why there are 7 coordinates instead of 6, and what does that extra coordinate represent?

{   "type": "Topology",   "arcs": [
    [
      [
        0,
        1
      ],
      [
        0.5,
        0.86
      ],
      [
        0.5,
        -0.86
      ],
      [
        0,
        -1
      ],
      [
        -0.5,
        -0.86
      ],
      [
        -0.5,
        0.86
      ],
      [
        0,
        1
      ]
    ]   ],   "transform": {
    "scale": [
      1,
      0.5
    ],
    "translate": [
      0,
      0
    ]   },   "objects": {
    "state": {
      "type": "GeometryCollection",
      "geometries": [
        {
          "arcs": [
            [
              0
            ]
          ],
          "type": "Polygon",
          "id": "A&N ISLANDS"
        }
      ]
    }   } }
0

The 1st and last vertices of a closed polygon are always the same, so a triangle is defined by 4 points

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.