GeofencingClient class

The 12 Amazon Location geofencing operations.

Method Endpoint What for
putGeofence PUT /collections/{c}/geofences/{g} create or change a zone
batchPutGeofence POST …/put-geofences up to 10 at once
getGeofence GET …/geofences/{g} read one
listGeofences POST …/list-geofences list them
batchDeleteGeofence POST …/delete-geofences delete several
batchEvaluateGeofences POST …/positions entered or exited?
forecastGeofenceEvents POST …/forecast-geofence-events is it about to enter?
createCollection POST /collections create the collection
describeCollection GET /collections/{c} read it
updateCollection PATCH /collections/{c} change it
deleteCollection DELETE /collections/{c} delete it
listCollections POST /list-collections list them

⚠️ Three things that aren't like in Places, Routes and Maps

This family belongs to the previous generation, and it shows in three places:

  1. You have to create a resource. A geofence collection is created with createCollection or in the console. It's not like v2, where you create nothing.
  2. It doesn't accept an API key. Amazon Location keys only cover Places, Routes and Maps. Here you need SigV4 credentials — a proxy or nativ_maps_sigv4. Trying it with a key is cut off before sending, with a message that says so.
  3. The control plane goes to another host, with the cp. prefix. It's resolved automatically, but it explains why there are two values in AlsService.

What really justifies using it

forecastGeofenceEvents. It doesn't tell you where the vehicle is: it tells you where it's going to be. Warning six minutes before it leaves the allowed zone is a different operation from warning once it has left.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

batchDeleteGeofence({required String collectionName, required List<String> geofenceIds}) → Future<BatchResult>
Deletes several geofences.
batchEvaluateGeofences({required String collectionName, required List<DevicePositionUpdate> positions}) → Future<BatchResult>
Evaluates positions against the geofences in a collection.
batchPutGeofence({required String collectionName, required List<Geofence> geofences}) → Future<BatchResult>
Creates or replaces up to 10 geofences at once.
createCollection({required String collectionName, String? description, String? kmsKeyId, Map<String, String> tags = const <String, String>{}}) → Future<GeofenceCollection>
Creates a geofence collection.
deleteCollection(String collectionName) → Future<void>
Deletes a collection and all its geofences.
describeCollection(String collectionName) → Future<GeofenceCollection>
Reads a collection's data, including how many geofences it has.
forecastGeofenceEvents({required String collectionName, required LatLng position, double? speedKmh, Duration? timeHorizon, int? maxResults, String? nextToken}) → Future<ForecastGeofenceEventsResponse>
Predicts which geofences a device is going to cross.
getGeofence({required String collectionName, required String geofenceId}) → Future<Geofence>
Reads a geofence.
listCollections({int? maxResults, String? nextToken}) → Future<GeofencePage<GeofenceCollection>>
Lists the account's collections.
listGeofences({required String collectionName, int? maxResults, String? nextToken}) → Future<GeofencePage<Geofence>>
Lists the geofences in a collection.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putGeofence({required String collectionName, required String geofenceId, required GeofenceGeometry geometry, Map<String, String> properties = const <String, String>{}}) → Future<Geofence>
Creates or replaces a geofence.
toString() → String
A string representation of this object.
inherited
updateCollection({required String collectionName, String? description}) → Future<GeofenceCollection>
Changes a collection's description.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

maxGeofencesPerBatch → const int
Maximum geofences per call to batchPutGeofence.
maxPositionsPerBatch → const int
Maximum positions per call to batchEvaluateGeofences.