Sélectionner vos préférences de cookies

Nous utilisons des cookies essentiels et des outils similaires qui sont nécessaires au fonctionnement de notre site et à la fourniture de nos services. Nous utilisons des cookies de performance pour collecter des statistiques anonymes afin de comprendre comment les clients utilisent notre site et d’apporter des améliorations. Les cookies essentiels ne peuvent pas être désactivés, mais vous pouvez cliquer sur « Personnaliser » ou « Refuser » pour refuser les cookies de performance.

Si vous êtes d’accord, AWS et les tiers approuvés utiliseront également des cookies pour fournir des fonctionnalités utiles au site, mémoriser vos préférences et afficher du contenu pertinent, y compris des publicités pertinentes. Pour accepter ou refuser tous les cookies non essentiels, cliquez sur « Accepter » ou « Refuser ». Pour effectuer des choix plus détaillés, cliquez sur « Personnaliser ».

ForecastGeofenceEvents

Mode de mise au point
ForecastGeofenceEvents - Amazon Location Service
Cette page n'a pas été traduite dans votre langue. Demande de traduction

This action forecasts future geofence events that are likely to occur within a specified time horizon if a device continues moving at its current speed. Each forecasted event is associated with a geofence from a provided geofence collection. A forecast event can have one of the following states:

ENTER: The device position is outside the referenced geofence, but the device may cross into the geofence during the forecasting time horizon if it maintains its current speed.

EXIT: The device position is inside the referenced geofence, but the device may leave the geofence during the forecasted time horizon if the device maintains it's current speed.

IDLE:The device is inside the geofence, and it will remain inside the geofence through the end of the time horizon if the device maintains it's current speed.

Note

Heading direction is not considered in the current version. The API takes a conservative approach and includes events that can occur for any heading.

Request Syntax

POST /geofencing/v0/collections/CollectionName/forecast-geofence-events HTTP/1.1 Content-type: application/json { "DeviceState": { "Position": [ number ], "Speed": number }, "DistanceUnit": "string", "MaxResults": number, "NextToken": "string", "SpeedUnit": "string", "TimeHorizonMinutes": number }

URI Request Parameters

The request uses the following URI parameters.

CollectionName

The name of the geofence collection.

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: [-._\w]+

Required: Yes

Request Body

The request accepts the following data in JSON format.

DeviceState

Represents the device's state, including its current position and speed. When speed is omitted, this API performs a containment check. The containment check operation returns IDLE events for geofences where the device is currently inside of, but no other events.

Type: ForecastGeofenceEventsDeviceState object

Required: Yes

DistanceUnit

The distance unit used for the NearestDistance property returned in a forecasted event. The measurement system must match for DistanceUnit and SpeedUnit; if Kilometers is specified for DistanceUnit, then SpeedUnit must be KilometersPerHour.

Default Value: Kilometers

Type: String

Valid Values: Kilometers | Miles

Required: No

MaxResults

An optional limit for the number of resources returned in a single call.

Default value: 20

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 20.

Required: No

NextToken

The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.

Default value: null

Type: String

Length Constraints: Minimum length of 1. Maximum length of 60000.

Required: No

SpeedUnit

The speed unit for the device captured by the device state. The measurement system must match for DistanceUnit and SpeedUnit; if Kilometers is specified for DistanceUnit, then SpeedUnit must be KilometersPerHour.

Default Value: KilometersPerHour.

Type: String

Valid Values: KilometersPerHour | MilesPerHour

Required: No

TimeHorizonMinutes

The forward-looking time window for forecasting, specified in minutes. The API only returns events that are predicted to occur within this time horizon. When no value is specified, this API performs a containment check. The containment check operation returns IDLE events for geofences where the device is currently inside of, but no other events.

Type: Double

Valid Range: Minimum value of 0.

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "DistanceUnit": "string", "ForecastedEvents": [ { "EventId": "string", "EventType": "string", "ForecastedBreachTime": "string", "GeofenceId": "string", "GeofenceProperties": { "string" : "string" }, "IsDeviceInGeofence": boolean, "NearestDistance": number } ], "NextToken": "string", "SpeedUnit": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

DistanceUnit

The distance unit for the forecasted events.

Type: String

Valid Values: Kilometers | Miles

ForecastedEvents

The list of forecasted events.

Type: Array of ForecastedEvent objects

NextToken

The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 60000.

SpeedUnit

The speed unit for the forecasted events.

Type: String

Valid Values: KilometersPerHour | MilesPerHour

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

HTTP Status Code: 403

InternalServerException

HTTP Status Code: 500

ResourceNotFoundException

HTTP Status Code: 404

ThrottlingException

HTTP Status Code: 429

ValidationException

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

Rubrique suivante :

GetGeofence

Rubrique précédente :

DescribeGeofenceCollection
ConfidentialitéConditions d'utilisation du sitePréférences de cookies
© 2025, Amazon Web Services, Inc. ou ses affiliés. Tous droits réservés.