Appearance
Add Vector API
API Information
- Request Path:
/analysis/task/add/vector - Request Method:
POST - Content-Type:
application/json
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | String | Yes | User authentication token |
| Content-Type | String | Yes | Must be set to application/json |
Request Parameters
| Parameter | Type | Required | Description | Constraints |
|---|---|---|---|---|
| layer | String | Yes | Layer Name | |
| shpStatus | Integer | Yes | Shp status, 1-LineString, 2-Polygon | |
| elements | List<Item> | Yes | element list |
Item Object
| Field | Type | Description |
|---|---|---|
| geometry | String | geometry |
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
| Field | Type | Description |
|---|---|---|
| code | Integer | Response status code |
| message | String | Response message |
| data | BboxItem | Vector Data |
BboxItem Object
| Field | Type | Description |
|---|---|---|
| layerName | String | Layer Name |
| bbox | String | New BBox |
| featureId | Long | Feature 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 Code | Description |
|---|---|
| 200 | Success |
| 400 | Request parameter error |
| 401 | Unauthorized |
| 500 | Server internal error |
Usage Instructions
- This API is used to add new vector data to analysis tasks
- User authentication is required
- Task ID and geometry must be provided
- 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