CreateLocationDateClusteringTask

Updated at:

Creates a spatiotemporal clustering task. It classifies files such as images and videos that are indexed in a dataset and contain capture time and location information based on time and geographic location. These clusters can represent content captured during a trip or at different living and working places. By analyzing the locations and time ranges of these clusters, you can classify and select media files, and generate photo and video stories.

Operation description

  • Before you call this operation, make sure that you fully understand the billing methods and pricing of Intelligent Media Management.

    Important The completion time of asynchronous tasks is not guaranteed.

  • Before you call this operation, make sure that you have indexed files into a dataset by using the binding method (CreateBinding) or the active indexing method (IndexFileMeta or BatchIndexFileMeta).

  • Each time you call this operation, the files in the dataset are processed incrementally. You can call this operation on a regular basis to process new files based on the newly added files.

  • After the clustering is complete, you can call the QueryLocationDateClusters operation to obtain the clustering results.

  • Deleting files from a dataset does not change the spatiotemporal clusters. To delete existing spatiotemporal clusters, call the DeleteLocationDateCluster operation.

  • This operation is asynchronous. After the task starts, the task information is retained for only 7 days. You cannot obtain the task information after 7 days. Call the GetTask or ListTasks operation to obtain the returned TaskId and view the task information. You can also set the Notification parameter to obtain the task information through message notifications.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

imm:CreateLocationDateClusteringTask

create

*Dataset

acs:imm:{#regionId}:{#accountId}:project/{#ProjectName}/dataset/{#DatasetName}

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectName

string

Yes

The name of the project. For more information about how to obtain the project name, see Create a project.

test-project

DatasetName

string

Yes

The name of the dataset. For more information about how to obtain the dataset name, see Create a dataset.

test-dataset

UserData

string

No

The custom user information. This information is returned in asynchronous message notifications to help you associate and process message notifications in your system. The maximum length is 2,048 bytes.

test-data

Tags

object

No

The custom tags used to search for and filter asynchronous tasks.

{ "User": "Jane" }

DateOptions

object

Yes

The date clustering settings.

Important Adjusting these settings also affects existing spatiotemporal clusters in your dataset.

GapDays

integer

Yes

The maximum allowed interval in days within a single spatiotemporal cluster. Valid values: 0 to 99999.

For example, a user has photos taken on March 4 to 5 and March 7, but no photos on March 6. If you assume that March 4 to 7 should belong to the same trip, set this field to 1. This allows a 1-day gap such as March 6 to be classified into the same spatiotemporal cluster.

Recommended values: 0 to 3.

1

MinDays

integer

Yes

The minimum number of days contained in a single spatiotemporal cluster. Valid values: 1 to 99999. Clusters with fewer days than this value are not detected or stored.

For example, if you do not want the generated clusters to include one-day trips, set this parameter to 2.

1

MaxDays

integer

Yes

The maximum number of days contained in a single spatiotemporal cluster. Valid values: 1 to 99999. Clusters with more days than this value are not detected or stored.

For example, if a user takes photos in a place for more than 15 consecutive days, the place is likely a residence rather than a travel destination. If you do not want this period and location to be included in the spatiotemporal clusters, set this parameter to 15.

15

LocationOptions

object

Yes

The location clustering settings.

Important Adjusting these settings also affects existing spatiotemporal clusters in your dataset.

LocationDateClusterLevels

array

Yes

The list of administrative levels for clustering. Multiple values are supported.

For example, a user uploads photos taken in Hangzhou from March 3 to March 5 and photos taken in Jiaxing from March 6 to March 8. If this parameter is set to ["city", "province"], the generated spatiotemporal clusters include:

  • March 3 to March 5, Hangzhou

  • March 6 to March 8, Jiaxing

  • March 3 to March 8, Zhejiang

string

Yes

The administrative level for clustering.

Valid values:

  • country :

    Country or region.

  • province :

    Province.

  • city :

    City.

  • district :

    District.

  • township :

    Township.

province

Notification Notification

No

The message notification configuration. For more information, see Notification. For more information about the format of asynchronous notification messages, see Asynchronous notification message format.

Response elements

Element

Type

Description

Example

object

The spatiotemporal clustering task information.

RequestId

string

The request ID.

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

TaskId

string

The task ID.

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

EventId

string

The event ID.

25B-1W2ChgujA3Q8MbBY6mSp2mh****

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.