Skip to content

Add Vector API

API Information

  • Request Path: /analysis/task/add/vector
  • Request Method: POST
  • Content-Type: application/json

Request Headers

ParameterTypeRequiredDescription
AuthorizationStringYesUser authentication token
Content-TypeStringYesMust be set to application/json

Request Parameters

ParameterTypeRequiredDescriptionConstraints
layerStringYesLayer Name
shpStatusIntegerYesShp status, 1-LineString, 2-Polygon
elementsList<Item>Yeselement list

Item Object

FieldTypeDescription
geometryStringgeometry

Request Body Example

json
{
  "layer": "v2_aiidfzdiazedhzhfghd",
  "shpStatus": 2,
  "elements": [
    {
      "geometry": "POLYGON ((35.5368146 27.54526001, 35.53712725 27.54526001, 35.53712725 27.54559443, 35.5368146 27.54559443, 35.5368146 27.54526001))"
    }
  ]
}

Response Body Structure

CommonResponse Object

FieldTypeDescription
codeIntegerResponse status code
messageStringResponse message
dataBboxItemVector Data

BboxItem Object

FieldTypeDescription
layerNameStringLayer Name
bboxStringNew BBox
featureIdLongFeature ID

Response Examples

Success Response

json
{
  "code": 200,
  "message": "OK",
  "data": {
    "layerName": "v2_aiidfzdiazedhzhfghd",
    "bbox": "35.53393,27.541082,35.539154,27.547148",
    "featureId": 84
  }
}

Failure Response

json
{
  "code": 400,
  "message": "Invalid geometry",
  "data": null
}

Error Code Description

Error CodeDescription
200Success
400Request parameter error
401Unauthorized
500Server internal error

Usage Instructions

  1. This API is used to add new vector data to analysis tasks
  2. User authentication is required
  3. Task ID and geometry must be provided
  4. Returns the ID of the created vector

Notes

  • Task ID is required
  • Geometry must be in valid WKT format
  • Attributes and style parameters are optional
  • User authentication token must be included in request headers