astm-utm / Protocol

ASTM UTM Protocol (API and sequence diagrams)
17 stars 11 forks source link

DSS API GeoJSON Polygon Discrepancy #17

Closed jfisherge closed 4 years ago

jfisherge commented 4 years ago

The current version of the API (0.3.1) defines the coordinates member of a Polygon as an array of Points. This look like the following (forgiving the duplicate points):

{
    "type": "Polygon",
    "coordinates": [
      [
        {
          "type": "Point",
          "coordinates": [
            -122.106325,
            47.660898
          ]
        },
        {
          "type": "Point",
          "coordinates": [
            -122.106325,
            47.660898
          ]
        },
        {
          "type": "Point",
          "coordinates": [
            -122.106325,
            47.660898
          ]
        },
        {
          "type": "Point",
          "coordinates": [
            -122.106325,
            47.660898
          ]
        }
      ]
    ]
}

The GeoJSON spec says the format for the coordinates member a Polygon should be a LineString, which is an array of two or more Positions. An example of a Polygon would be:

{
    "type": "Polygon",
    "coordinates": [
      [
        [
            -122.106325,
            47.660898
        ],
        [
            -122.106325,
            47.660898
        ],
        [
            -122.106325,
            47.660898
        ],
        [
            -122.106325,
            47.660898
        ]
      ]
    ]
}

We should follow the GeoJSON spec for interoperability reasons. This will help with quicker implementation for those USSs that use standard GeoJSON libraries.

astm-utm commented 4 years ago

You're correct-- the Polygon object was referencing the wrong vertex schema. This is fixed in version 0.3.3.