Skip to content

Update AOI API

API Information

  • Request Path: /aoi/update/aoi
  • Request Method: POST
  • Content-Type: application/json

Request Headers

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

Request Body Structure

UpdateAoiReq Object

FieldTypeRequiredDescriptionConstraints
idLongYesAOI IDMust be valid AOI ID
aoiNameStringNoAOI nameOptional
geoAoiStringNoGeometry in WKT formatOptional valid WKT geometry
areaStringNoArea valueOptional
lngLatStringNoLongitude and latitude coordinatesOptional coordinate string
geometryGeometryNoPostGIS geometry objectOptional PostGIS geometry

Request Body Example

json
{
  "id": 12345,
  "aoiName": "Updated Shanghai Coastal Area",
  "geoAoi": "POLYGON((121.2 30.6, 121.8 30.6, 121.8 31.4, 121.2 31.4, 121.2 30.6))",
  "area": "11000.50",
  "lngLat": "121.5,31.0"
}

Response Body Structure

CommonResponse Object

FieldTypeDescription
codeIntegerResponse status code
messageStringResponse message
dataBooleanUpdate result, true indicates success

Response Examples

Success Response

json
{
  "code": 200,
  "message": "success",
  "data": true
}

Failure Response

json
{
  "code": 404,
  "message": "AOI not found",
  "data": false
}

Error Code Description

Error CodeDescription
200Success
400Request parameter error
401Unauthorized
404AOI not found
500Server internal error

Usage Instructions

  1. This API is used to update an existing Area of Interest (AOI)
  2. User authentication is required
  3. AOI ID is required to identify which AOI to update
  4. Only AOI owners can update their AOIs
  5. Returns boolean indicating update success

Notes

  • AOI ID is required and cannot be null
  • Only fields that are provided will be updated
  • Geometry must be in valid WKT format if provided
  • User authentication token must be included in request headers