internetofwater / nldi-services

Network Linked Data Index Navigation Web Services
https://waterdata.usgs.gov/blog/nldi-intro/
Creative Commons Zero v1.0 Universal
19 stars 15 forks source link

Separate comid and featureSource/featureID endpoints #303

Closed EthanGrahn closed 2 years ago

EthanGrahn commented 2 years ago

Right now the /linked-data/{featureSource}/{featureID} also catches the /linked-data/comid/{comid} requests. With the new content negotiation, the source/ID endpoint is expected to return a Feature object. A new comid endpoint mapping should be created that returns a Comid object instead.

EthanGrahn commented 2 years ago

The new endpoint will return the same format as it previously did, except it does not include the type, name, or uri fields which were always empty strings.

Example for /linked-data/comid/13294288:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            -89.386479601,
            43.154735893
          ],
          [
            -89.3894471,
            43.1528662
          ],
          [
            -89.389817007,
            43.152884796
          ],
          [
            -89.391980104,
            43.151647694
          ],
          [
            -89.394582205,
            43.151644297
          ],
          [
            -89.395653203,
            43.152102195
          ],
          [
            -89.398427404,
            43.152242094
          ],
          [
            -89.4007238,
            43.151549995
          ],
          [
            -89.401581705,
            43.150899395
          ],
          [
            -89.401752301,
            43.150847197
          ]
        ]
      },
      "properties": {
        "source": "comid",
        "sourceName": "NHDPlus comid",
        "identifier": "13294288",
        "comid": "13294288",
        "navigation": "https://labs.waterdata.usgs.gov/api/nldi/linked-data/comid/13294288/navigation"
      }
    }
  ]
}

@dblodgett-usgs does that seem like an acceptable adjustment?

dblodgett-usgs commented 2 years ago

Looks good.