Skip to content

Latest commit

 

History

History
284 lines (219 loc) · 3.74 KB

File metadata and controls

284 lines (219 loc) · 3.74 KB

SpatiallyDB

For more information about SpatiallyDB, please visit Spatially Labs

Layers

Create layer

Request

POST https://api.spatially.com/spatialdb/layer

Headers:
  Content-Type: application/json
  Authorization: Bearer ACCESS_TOKEN_GENERATED_FROM_API

Body:
  {
    "name": "layer-name"
   }

Response

{
  "id": "...",
  "name": "layer-name"
}

Get layer

Request

GET https://api.spatially.com/spatialdb/layer/{id}

Headers:
  Content-Type: application/json
  Authorization: Bearer ACCESS_TOKEN_GENERATED_FROM_API

Response

{
  "id": "...",
  "name": "layer-name"
}

Get layers

Request

GET https://api.spatially.com/spatialdb/layers

Headers:
  Content-Type: application/json
  Authorization: Bearer ACCESS_TOKEN_GENERATED_FROM_API

Response

[
  {
    "id": "...",
    "name": "layer-name"
  }
]

Delete layer

Request

DELETE https://api.spatially.com/spatialdb/layer/{id}

Headers:
  Content-Type: application/json
  Authorization: Bearer ACCESS_TOKEN_GENERATED_FROM_API

Features

Create feature

Request

POST https://api.spatially.com/spatialdb/feature

Headers:
  Content-Type: application/json
  Authorization: Bearer ACCESS_TOKEN_GENERATED_FROM_API

Body:
  {
    "layer": "{id}",
    "feature": {
      // valid GeoJSON feature
      "type": "Feature",
      "properties": {
        "key": "value"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          -76.2890625,
          39.639537564366684
        ]
      }
    }
   }

Response

{
  "id": "..."
}

Get feature

Request

GET https://api.spatially.com/spatialdb/feature/{id}

Headers:
  Content-Type: application/json
  Authorization: Bearer ACCESS_TOKEN_GENERATED_FROM_API

Response

{
  "type": "Feature",
  "properties": {
    "key": "value"
  },
  "geometry": {
    "type": "Point",
    "coordinates": [-76.2890625, 39.639537564366684]
  }
}

Get features by layer

Request

POST https://api.spatially.com/spatialdb/features

Headers:
  Content-Type: application/json
  Authorization: Bearer ACCESS_TOKEN_GENERATED_FROM_API

Body:
  {
    "layer": "{id}"
  }

Response

[
  {
    "type": "Feature",
    "properties": {
      "key": "value"
    },
    "geometry": {
      "type": "Point",
      "coordinates": [-76.2890625, 39.639537564366684]
    }
  }
]

Get features by layer & spatial constraint

Request

POST https://api.spatially.com/spatialdb/features

Headers:
  Content-Type: application/json
  Authorization: Bearer ACCESS_TOKEN_GENERATED_FROM_API

Body:
  {
    "layer": "{id}"
    "spatialConstraint": {
      "wkt": "POLYGON (...)",
      "type": 0
    }
  }

  // Or if doing a buffer query
  {
    "layer": "{id}"
    "spatialConstraint": {
      "wkt": "POINT (...)",
      "radius": 100, // in meters
      "type": 0
    }
  }

Response

[
  {
    "type": "Feature",
    "properties": {
      "key": "value"
    },
    "geometry": {
      "type": "Point",
      "coordinates": [-76.2890625, 39.639537564366684]
    }
  }
]

Update feature

Request

PUT https://api.spatially.com/spatialdb/feature/{id}

Headers:
  Content-Type: application/json
  Authorization: Bearer ACCESS_TOKEN_GENERATED_FROM_API

Body:
  {
    "properties": {
      "key2": "value2"
    }
  }

Response

{
  "type": "Feature",
  "properties": {
    "key": "value",
    "key2": "value2"
  },
  "geometry": {
    "type": "Point",
    "coordinates": [-76.2890625, 39.639537564366684]
  }
}

Delete feature

Request

DELETE https://api.spatially.com/spatialdb/feature/{id}

Headers:
  Content-Type: application/json
  Authorization: Bearer ACCESS_TOKEN_GENERATED_FROM_API