Publish to an Interactive Map Layer

To publish data to an interactive map layer, use the interactive REST API.

  1. Obtain an authorization token to use with your HTTP requests. For instructions, see the Authentication and Authorization API Guide.
  2. Use the API Lookup service to get the base URL for the interactive API for the catalog you want to write to. For instructions on how to use the API Lookup service, see the API Lookup Developer's Guide.
  3. Send your data to the layer using the POST or PUT requests of the 'interactive' API.

Add data

There are two ways of adding features to your layer. The only difference is the way the existing data in your layer is handled: Use POST, and any pre-existing data is retained; use PUT, and the only data that is left in your layer is the data uploaded with the PUT request.

Using POST

POST /<Base path for the interactive API from the API Lookup Service>/layers/<Layer ID>/features

and the body

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "featureclass": "River"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            ...
          ], ... [
              ...
          ]
        ]
      }
    }
  ]
}

yields the response

{
  "features": [
    {
      "geometry": {
        "type": "LineString",
       "coordinates": [
          [
            ...
          ], ... [
              ...
          ]
       ]
      },
      "id": "NTvvEciZlE",
      "type": "Feature",
      "properties": {
        "featureclass": "River",
        "@ns:com:here:xyz": {
          "createdAt": 1528461230706,
          "updatedAt": 1528461230706
        }
      },
      "bbox": [
        44.41260826914623,
        31.5295270854107,
        45.66944420664623,
        32.563421942181535
      ]
    }
  ],
  "type": "FeatureCollection"
}

Using PUT

You receive the same response with the following PUT request

PUT /<Base path for the interactive API from the API Lookup Service>/layers/<Layer ID>/features

with the same body

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "featureclass": "River"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            ...
          ], ... [
              ...
          ]
        ]
      }
    }
  ]
}

will give you

{
  "features": [
    {
      "geometry": {
        "type": "LineString",
       "coordinates": [
          [
            ...
          ], ... [
              ...
          ]
       ]
      },
      "id": "NTvvEciZlE",
      "type": "Feature",
      "properties": {
        "featureclass": "River",
        "@ns:com:here:xyz": {
          "createdAt": 1528461230706,
          "updatedAt": 1528461230706
        }
      },
      "bbox": [
        44.41260826914623,
        31.5295270854107,
        45.66944420664623,
        32.563421942181535
      ]
    }
  ],
  "type": "FeatureCollection"
}

In this case all other features will have been deleted.

results matching ""

    No results matching ""