All Products
Search
Document Center

Intelligent Media Management:CreateLocationDateClusteringTask

Last Updated:Dec 11, 2024

Creates a spatiotemporal clustering task to cluster photos and videos based on geolocation and time information. Spatiotemporal clustering allows you to group photos and videos taken during a travel or at different places by their spatial and temporal similarity. Based on spatiotemporal clustering, you can develop media capabilities such as media file categorization, photo collections, and image and video-based stories.

Operation description

  • Before you call this operation, make sure that you are familiar with the billing of Intelligent Media Management (IMM).****

    **

    Note Asynchronous processing does not guarantee timely task completion.

  • Before you call this operation, make sure that you have indexed file metadata into the dataset automatically by calling the CreateBinding operation or manually by calling the IndexFileMeta or BatchIndexFileMeta operation.

  • Each call to the operation incrementally processes metadata in the dataset.****`` You can regularly call this operation to process incremental files.

  • After a spatiotemporal clustering task is complete, you can call the QueryLocationDateClusters operation to query the spatiotemporal clustering result.

  • Removing metadata from a dataset does not affect existing spatiotemporal clusters for the dataset. To delete a spatiotemporal cluster, call the DeleteLocationDateCluster operation.

  • This operation is an asynchronous operation. After a task is executed, the task information is retained only for seven days and cannot be retrieved when the retention period elapses. You can call the GetTask or ListTasks operation to query information about the task.`` If you specify Notification , you can obtain information about the task based on notifications.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
imm:CreateLocationDateClusteringTaskcreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectNamestringYes

The name of the project.

test-project
DatasetNamestringYes

The name of the dataset.

test-dataset
UserDatastringNo

The custom information, which is returned in an asynchronous notification and facilitates notification management. The maximum length of the value is 2,048 bytes.

test-data
TagsobjectNo

The custom tags. You can search for or filter asynchronous tasks by custom tag.

{ "User": "Jane" }
DateOptionsobjectYes

The date configurations for clustering.

Note Adjusting these configurations affects existing spatiotemporal clusters for the dataset.
GapDayslongYes

The maximum number of days allowed in a gap for a single spatiotemporal cluster. Valid values: 0 to 99999.

For example, if travel photos were produced on March 4, 5, and 7, 2024, but not on Marh 6, 2024, and you set the parameter to 1, IMM considers the travel spanning the date range from March 4, 2024 to March 7, 2024 and includes photos within the data range in the same cluster.````

We recommend that you set the parameter to a value within the range from 0 to 3.

1
MinDayslongYes

The minimum number of days that a single spatiotemporal cluster can span. Valid values: 1 to 99999. IMM does not create a cluster that spans less than the minimum number of days.

For example, if you do not want a one-day tour cluster, you can set the parameter to 2.

1
MaxDayslongYes

The maximum number of days that a single spatiotemporal cluster can span. Valid values: 1 to 99999. IMM does not create a cluster that spans more than the maximum number of days.

For example, if you want to create travel photo clusters, you may want to exclude photos that were taken within 15 consecutive days in the same city, because it is likely that these photos were not taken during a travel. In this case, you can set the parameter to 15 to exclude this time range and location from the clustering task.

15
LocationOptionsobjectYes

The geolocation configurations for clustering.

Note Adjusting these configurations affects existing spatiotemporal clusters for the dataset.
LocationDateClusterLevelsarrayYes

The administrative division levels. You can specify multiple administrative division levels.

For example, you uploaded photos that were taken from March 3, 2024 to March 5, 2024 in Hangzhou and photos that were taken from March 6, 2024 to March 8, 2024 in Jiaxing. When you call the operation and set the parameter to ["city", "province"], the following spatiotemporal clusters are created from these photos:

  • March 3, 2024 to March 5, 2024, Hangzhou
  • March 6, 2024 to March 8, 2024, Jiaxing
  • March 3, 2024 to March 8, 2024, Zhejiang
stringYes

The administrative division level.

Enumerated values:

  • country: the country or region level
  • province: the provincial level
  • city: the city level
  • district: the district level
  • township: the township level
province
NotificationNotificationNo

The notification settings. For information about the asynchronous notification format, see Asynchronous message examples.

Response parameters

ParameterTypeDescriptionExample
object

The information about the spatiotemporal clustering task.

RequestIdstring

The request ID.

B121940C-9794-4EE3-8D6E-F8EC525F****
TaskIdstring

The task ID.

LocationDateClustering-c10dce07-1de7-4da7-abee-1a3aba7****
EventIdstring

The event ID.

25B-1W2ChgujA3Q8MbBY6mSp2mh****

Examples

Sample success responses

JSONformat

{
  "RequestId": "B121940C-9794-4EE3-8D6E-F8EC525F****",
  "TaskId": "LocationDateClustering-c10dce07-1de7-4da7-abee-1a3aba7****",
  "EventId": "25B-1W2ChgujA3Q8MbBY6mSp2mh****"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-04-03The request parameters of the API has changedView Change Details
2023-03-09The request parameters of the API has changedView Change Details