Class: AWS.Location
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.Location
- Identifier:
- location
- API Version:
- 2020-11-19
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
"Suite of geospatial services including Maps, Places, Routes, Tracking, and Geofencing"
Sending a Request Using Location
var location = new AWS.Location();
location.associateTrackerConsumer(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the Location object uses this specific API, you can
construct the object by passing the apiVersion
option to the constructor:
var location = new AWS.Location({apiVersion: '2020-11-19'});
You can also set the API version globally in AWS.config.apiVersions
using
the location service identifier:
AWS.config.apiVersions = {
location: '2020-11-19',
// other service API versions
};
var location = new AWS.Location();
Version:
-
2020-11-19
Constructor Summary collapse
-
new AWS.Location(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary collapse
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary collapse
-
associateTrackerConsumer(params = {}, callback) ⇒ AWS.Request
Creates an association between a geofence collection and a tracker resource.
-
batchDeleteDevicePositionHistory(params = {}, callback) ⇒ AWS.Request
Deletes the position history of one or more devices from a tracker resource.
.
-
batchDeleteGeofence(params = {}, callback) ⇒ AWS.Request
Deletes a batch of geofences from a geofence collection.
Note: This operation deletes the resource permanently.- batchEvaluateGeofences(params = {}, callback) ⇒ AWS.Request
Evaluates device positions against the geofence geometries from a given geofence collection.
This operation always returns an empty response because geofences are asynchronously evaluated.
- batchGetDevicePosition(params = {}, callback) ⇒ AWS.Request
Lists the latest device positions for requested devices.
.
- batchPutGeofence(params = {}, callback) ⇒ AWS.Request
A batch request for storing geofence geometries into a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.
.
- batchUpdateDevicePosition(params = {}, callback) ⇒ AWS.Request
Uploads position update data for one or more devices to a tracker resource (up to 10 devices per batch).
- calculateRoute(params = {}, callback) ⇒ AWS.Request
Calculates a route given the following required parameters:
DeparturePosition
andDestinationPosition
.- calculateRouteMatrix(params = {}, callback) ⇒ AWS.Request
Calculates a route matrix given the following required parameters:
DeparturePositions
andDestinationPositions
.- createGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Creates a geofence collection, which manages and stores geofences.
.
- createKey(params = {}, callback) ⇒ AWS.Request
Creates an API key resource in your Amazon Web Services account, which lets you grant actions for Amazon Location resources to the API key bearer.
Note: For more information, see Using API keys.- createMap(params = {}, callback) ⇒ AWS.Request
Creates a map resource in your Amazon Web Services account, which provides map tiles of different styles sourced from global location data providers.
Note: If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider.- createPlaceIndex(params = {}, callback) ⇒ AWS.Request
Creates a place index resource in your Amazon Web Services account.
- createRouteCalculator(params = {}, callback) ⇒ AWS.Request
Creates a route calculator resource in your Amazon Web Services account.
You can send requests to a route calculator resource to estimate travel time, distance, and get directions.
- createTracker(params = {}, callback) ⇒ AWS.Request
Creates a tracker resource in your Amazon Web Services account, which lets you retrieve current and historical location of devices.
.
- deleteGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Deletes a geofence collection from your Amazon Web Services account.
Note: This operation deletes the resource permanently.- deleteKey(params = {}, callback) ⇒ AWS.Request
Deletes the specified API key.
- deleteMap(params = {}, callback) ⇒ AWS.Request
Deletes a map resource from your Amazon Web Services account.
Note: This operation deletes the resource permanently.- deletePlaceIndex(params = {}, callback) ⇒ AWS.Request
Deletes a place index resource from your Amazon Web Services account.
Note: This operation deletes the resource permanently.- deleteRouteCalculator(params = {}, callback) ⇒ AWS.Request
Deletes a route calculator resource from your Amazon Web Services account.
Note: This operation deletes the resource permanently.- deleteTracker(params = {}, callback) ⇒ AWS.Request
Deletes a tracker resource from your Amazon Web Services account.
Note: This operation deletes the resource permanently.- describeGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Retrieves the geofence collection details.
.
- describeKey(params = {}, callback) ⇒ AWS.Request
Retrieves the API key resource details.
.
- describeMap(params = {}, callback) ⇒ AWS.Request
Retrieves the map resource details.
.
- describePlaceIndex(params = {}, callback) ⇒ AWS.Request
Retrieves the place index resource details.
.
- describeRouteCalculator(params = {}, callback) ⇒ AWS.Request
Retrieves the route calculator resource details.
.
- describeTracker(params = {}, callback) ⇒ AWS.Request
Retrieves the tracker resource details.
.
- disassociateTrackerConsumer(params = {}, callback) ⇒ AWS.Request
Removes the association between a tracker resource and a geofence collection.
Note: Once you unlink a tracker resource from a geofence collection, the tracker positions will no longer be automatically evaluated against geofences.- forecastGeofenceEvents(params = {}, callback) ⇒ AWS.Request
Evaluates device positions against geofence geometries from a given geofence collection.
- getDevicePosition(params = {}, callback) ⇒ AWS.Request
Retrieves a device's most recent position according to its sample time.
Note: Device positions are deleted after 30 days.- getDevicePositionHistory(params = {}, callback) ⇒ AWS.Request
Retrieves the device position history from a tracker resource within a specified range of time.
Note: Device positions are deleted after 30 days.- getGeofence(params = {}, callback) ⇒ AWS.Request
Retrieves the geofence details from a geofence collection.
Note: The returned geometry will always match the geometry format used when the geofence was created.- getMapGlyphs(params = {}, callback) ⇒ AWS.Request
Retrieves glyphs used to display labels on a map.
.
- getMapSprites(params = {}, callback) ⇒ AWS.Request
Retrieves the sprite sheet corresponding to a map resource.
- getMapStyleDescriptor(params = {}, callback) ⇒ AWS.Request
Retrieves the map style descriptor from a map resource.
- getMapTile(params = {}, callback) ⇒ AWS.Request
Retrieves a vector data tile from the map resource.
- getPlace(params = {}, callback) ⇒ AWS.Request
Finds a place by its unique ID.
- listDevicePositions(params = {}, callback) ⇒ AWS.Request
A batch request to retrieve all device positions.
.
- listGeofenceCollections(params = {}, callback) ⇒ AWS.Request
Lists geofence collections in your Amazon Web Services account.
.
- listGeofences(params = {}, callback) ⇒ AWS.Request
Lists geofences stored in a given geofence collection.
.
- listKeys(params = {}, callback) ⇒ AWS.Request
Lists API key resources in your Amazon Web Services account.
.
- listMaps(params = {}, callback) ⇒ AWS.Request
Lists map resources in your Amazon Web Services account.
.
- listPlaceIndexes(params = {}, callback) ⇒ AWS.Request
Lists place index resources in your Amazon Web Services account.
.
- listRouteCalculators(params = {}, callback) ⇒ AWS.Request
Lists route calculator resources in your Amazon Web Services account.
.
- listTagsForResource(params = {}, callback) ⇒ AWS.Request
Returns a list of tags that are applied to the specified Amazon Location resource.
.
- listTrackerConsumers(params = {}, callback) ⇒ AWS.Request
Lists geofence collections currently associated to the given tracker resource.
.
- listTrackers(params = {}, callback) ⇒ AWS.Request
Lists tracker resources in your Amazon Web Services account.
.
- putGeofence(params = {}, callback) ⇒ AWS.Request
Stores a geofence geometry in a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.
- searchPlaceIndexForPosition(params = {}, callback) ⇒ AWS.Request
Reverse geocodes a given coordinate and returns a legible address.
- searchPlaceIndexForSuggestions(params = {}, callback) ⇒ AWS.Request
Generates suggestions for addresses and points of interest based on partial or misspelled free-form text.
- searchPlaceIndexForText(params = {}, callback) ⇒ AWS.Request
Geocodes free-form text, such as an address, name, city, or region to allow you to search for Places or points of interest.
- tagResource(params = {}, callback) ⇒ AWS.Request
Assigns one or more tags (key-value pairs) to the specified Amazon Location Service resource.
Tags can help you organize and categorize your resources.
- untagResource(params = {}, callback) ⇒ AWS.Request
Removes one or more tags from the specified Amazon Location resource.
.
- updateGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Updates the specified properties of a given geofence collection.
.
- updateKey(params = {}, callback) ⇒ AWS.Request
Updates the specified properties of a given API key resource.
.
- updateMap(params = {}, callback) ⇒ AWS.Request
Updates the specified properties of a given map resource.
.
- updatePlaceIndex(params = {}, callback) ⇒ AWS.Request
Updates the specified properties of a given place index resource.
.
- updateRouteCalculator(params = {}, callback) ⇒ AWS.Request
Updates the specified properties for a given route calculator resource.
.
- updateTracker(params = {}, callback) ⇒ AWS.Request
Updates the specified properties of a given tracker resource.
.
- verifyDevicePosition(params = {}, callback) ⇒ AWS.Request
Verifies the integrity of the device's position by determining if it was reported behind a proxy, and by comparing it to an inferred position estimated based on the device's state.
.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService
Constructor Details
new AWS.Location(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Examples:
Constructing a Location object
var location = new AWS.Location({apiVersion: '2020-11-19'});
Options Hash (options):
-
params
(map)
—
An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.
-
endpoint
(String|AWS.Endpoint)
—
The endpoint URI to send requests to. The default endpoint is built from the configured
region
. The endpoint should be a string like'https://{service}.{region}.amazonaws.com'
or an Endpoint object. -
accessKeyId
(String)
—
your AWS access key ID.
-
secretAccessKey
(String)
—
your AWS secret access key.
-
sessionToken
(AWS.Credentials)
—
the optional AWS session token to sign requests with.
-
credentials
(AWS.Credentials)
—
the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.
-
credentialProvider
(AWS.CredentialProviderChain)
—
the provider chain used to resolve credentials if no static
credentials
property is set. -
region
(String)
—
the region to send service requests to. See AWS.Location.region for more information.
-
maxRetries
(Integer)
—
the maximum amount of retries to attempt with a request. See AWS.Location.maxRetries for more information.
-
maxRedirects
(Integer)
—
the maximum amount of redirects to follow with a request. See AWS.Location.maxRedirects for more information.
-
sslEnabled
(Boolean)
—
whether to enable SSL for requests.
-
paramValidation
(Boolean|map)
—
whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
true
. - max [Boolean] — Validates that a value meets the max constraint.
- pattern [Boolean] — Validates that a string value matches a regular expression.
- enum [Boolean] — Validates that a string value matches one of the allowable enum values.
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
-
computeChecksums
(Boolean)
—
whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)
-
convertResponseTypes
(Boolean)
—
whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to
true
. -
correctClockSkew
(Boolean)
—
whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to
false
. -
s3ForcePathStyle
(Boolean)
—
whether to force path style URLs for S3 objects.
-
s3BucketEndpoint
(Boolean)
—
whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an
endpoint
to be provided explicitly to the service constructor. -
s3DisableBodySigning
(Boolean)
—
whether S3 body signing should be disabled when using signature version
v4
. Body signing can only be disabled when using https. Defaults totrue
. -
s3UsEast1RegionalEndpoint
('legacy'|'regional')
—
when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to
legacy
-
s3UseArnRegion
(Boolean)
—
whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to
true
-
retryDelayOptions
(map)
—
A set of options to configure the retry delay on retryable errors. Currently supported options are:
- base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
- customBackoff [function] — A custom function that accepts a
retry count and error and returns the amount of time to delay in
milliseconds. If the result is a non-zero negative value, no further
retry attempts will be made. The
base
option will be ignored if this option is supplied. The function is only called for retryable errors.
-
httpOptions
(map)
—
A set of options to pass to the low-level HTTP request. Currently supported options are:
- proxy [String] — the URL to proxy requests through
- agent [http.Agent, https.Agent] — the Agent object to perform
HTTP requests with. Used for connection pooling. Defaults to the global
agent (
http.globalAgent
) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment. - connectTimeout [Integer] — Sets the socket to timeout after
failing to establish a connection with the server after
connectTimeout
milliseconds. This timeout has no effect once a socket connection has been established. - timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
- xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
- xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
-
apiVersion
(String, Date)
—
a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by
apiVersions
). Specify 'latest' to use the latest possible version. -
apiVersions
(map<String, String|Date>)
—
a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.
-
logger
(#write, #log)
—
an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests
-
systemClockOffset
(Number)
—
an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global
AWS.config
object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds. -
signatureVersion
(String)
—
the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.
-
signatureCache
(Boolean)
—
whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to
true
. -
dynamoDbCrc32
(Boolean)
—
whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default:
true
. -
useAccelerateEndpoint
(Boolean)
—
Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default:
false
. -
clientSideMonitoring
(Boolean)
—
whether to collect and publish this client's performance metrics of all its API requests.
-
endpointDiscoveryEnabled
(Boolean|undefined)
—
whether to call operations with endpoints given by service dynamically. Setting this
-
endpointCacheSize
(Number)
—
the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000
-
hostPrefixEnabled
(Boolean)
—
whether to marshal request parameters to the prefix of hostname. Defaults to
true
. -
stsRegionalEndpoints
('legacy'|'regional')
—
whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.
-
useFipsEndpoint
(Boolean)
—
Enables FIPS compatible endpoints. Defaults to
false
. -
useDualstackEndpoint
(Boolean)
—
Enables IPv6 dualstack endpoint. Defaults to
false
.
Property Details
Method Details
associateTrackerConsumer(params = {}, callback) ⇒ AWS.Request
Creates an association between a geofence collection and a tracker resource. This allows the tracker resource to communicate location data to the linked geofence collection.
You can associate up to five geofence collections to each tracker resource.
Note: Currently not supported — Cross-account configurations, such as creating associations between a tracker resource in one account and a geofence collection in another account.Service Reference:
Examples:
Calling the associateTrackerConsumer operation
var params = { ConsumerArn: 'STRING_VALUE', /* required */ TrackerName: 'STRING_VALUE' /* required */ }; location.associateTrackerConsumer(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The name of the tracker resource to be associated with a geofence collection.
ConsumerArn
— (String
)The Amazon Resource Name (ARN) for the geofence collection to be associated to tracker resource. Used when you need to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollectionConsumer
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
batchDeleteDevicePositionHistory(params = {}, callback) ⇒ AWS.Request
Deletes the position history of one or more devices from a tracker resource.
Service Reference:
Examples:
Calling the batchDeleteDevicePositionHistory operation
var params = { DeviceIds: [ /* required */ 'STRING_VALUE', /* more items */ ], TrackerName: 'STRING_VALUE' /* required */ }; location.batchDeleteDevicePositionHistory(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The name of the tracker resource to delete the device position history from.
DeviceIds
— (Array<String>
)Devices whose position history you want to delete.
-
For example, for two devices:
“DeviceIds” : [DeviceId1,DeviceId2]
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Errors
— (Array<map>
)Contains error details for each device history that failed to delete.
DeviceId
— required — (String
)The ID of the device for this position.
Error
— required — (map
)Contains the batch request error details associated with the request.
Code
— (String
)The error code associated with the batch request error.
Possible values include:"AccessDeniedError"
"ConflictError"
"InternalServerError"
"ResourceNotFoundError"
"ThrottlingError"
"ValidationError"
Message
— (String
)A message with the reason for the batch request error.
-
(AWS.Response)
—
Returns:
batchDeleteGeofence(params = {}, callback) ⇒ AWS.Request
Deletes a batch of geofences from a geofence collection.
Note: This operation deletes the resource permanently.Service Reference:
Examples:
Calling the batchDeleteGeofence operation
var params = { CollectionName: 'STRING_VALUE', /* required */ GeofenceIds: [ /* required */ 'STRING_VALUE', /* more items */ ] }; location.batchDeleteGeofence(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)The geofence collection storing the geofences to be deleted.
GeofenceIds
— (Array<String>
)The batch of geofences to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Errors
— (Array<map>
)Contains error details for each geofence that failed to delete.
GeofenceId
— required — (String
)The geofence associated with the error message.
Error
— required — (map
)Contains details associated to the batch error.
Code
— (String
)The error code associated with the batch request error.
Possible values include:"AccessDeniedError"
"ConflictError"
"InternalServerError"
"ResourceNotFoundError"
"ThrottlingError"
"ValidationError"
Message
— (String
)A message with the reason for the batch request error.
-
(AWS.Response)
—
Returns:
batchEvaluateGeofences(params = {}, callback) ⇒ AWS.Request
Evaluates device positions against the geofence geometries from a given geofence collection.
This operation always returns an empty response because geofences are asynchronously evaluated. The evaluation determines if the device has entered or exited a geofenced area, and then publishes one of the following events to Amazon EventBridge:
-
ENTER
if Amazon Location determines that the tracked device has entered a geofenced area. -
EXIT
if Amazon Location determines that the tracked device has exited a geofenced area.
Note: The last geofence that a device was observed within is tracked for 30 days after the most recent device position update.Note: Geofence evaluation uses the given device position. It does not account for the optionalAccuracy
of aDevicePositionUpdate
.Note: TheDeviceID
is used as a string to represent the device. You do not need to have aTracker
associated with theDeviceID
.Service Reference:
Examples:
Calling the batchEvaluateGeofences operation
var params = { CollectionName: 'STRING_VALUE', /* required */ DevicePositionUpdates: [ /* required */ { DeviceId: 'STRING_VALUE', /* required */ Position: [ /* required */ 'NUMBER_VALUE', /* more items */ ], SampleTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */ Accuracy: { Horizontal: 'NUMBER_VALUE' /* required */ }, PositionProperties: { '<PropertyMapKeyString>': 'STRING_VALUE', /* '<PropertyMapKeyString>': ... */ } }, /* more items */ ] }; location.batchEvaluateGeofences(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)The geofence collection used in evaluating the position of devices against its geofences.
DevicePositionUpdates
— (Array<map>
)Contains device details for each device to be evaluated against the given geofence collection.
DeviceId
— required — (String
)The device associated to the position update.
SampleTime
— required — (Date
)The timestamp at which the device's position was determined. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
Position
— required — (Array<Float>
)The latest device position defined in WGS 84 format:
[X or longitude, Y or latitude]
.Accuracy
— (map
)The accuracy of the device position.
Horizontal
— required — (Float
)Estimated maximum distance, in meters, between the measured position and the true position of a device, along the Earth's surface.
PositionProperties
— (map<String>
)Associates one of more properties with the position update. A property is a key-value pair stored with the position update and added to any geofence event the update may trigger.
Format:
"key" : "value"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Errors
— (Array<map>
)Contains error details for each device that failed to evaluate its position against the given geofence collection.
DeviceId
— required — (String
)The device associated with the position evaluation error.
SampleTime
— required — (Date
)Specifies a timestamp for when the error occurred in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
Error
— required — (map
)Contains details associated to the batch error.
Code
— (String
)The error code associated with the batch request error.
Possible values include:"AccessDeniedError"
"ConflictError"
"InternalServerError"
"ResourceNotFoundError"
"ThrottlingError"
"ValidationError"
Message
— (String
)A message with the reason for the batch request error.
-
(AWS.Response)
—
Returns:
batchGetDevicePosition(params = {}, callback) ⇒ AWS.Request
Lists the latest device positions for requested devices.
Service Reference:
Examples:
Calling the batchGetDevicePosition operation
var params = { DeviceIds: [ /* required */ 'STRING_VALUE', /* more items */ ], TrackerName: 'STRING_VALUE' /* required */ }; location.batchGetDevicePosition(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The tracker resource retrieving the device position.
DeviceIds
— (Array<String>
)Devices whose position you want to retrieve.
-
For example, for two devices:
device-ids=DeviceId1&device-ids=DeviceId2
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Errors
— (Array<map>
)Contains error details for each device that failed to send its position to the tracker resource.
DeviceId
— required — (String
)The ID of the device that didn't return a position.
Error
— required — (map
)Contains details related to the error code.
Code
— (String
)The error code associated with the batch request error.
Possible values include:"AccessDeniedError"
"ConflictError"
"InternalServerError"
"ResourceNotFoundError"
"ThrottlingError"
"ValidationError"
Message
— (String
)A message with the reason for the batch request error.
DevicePositions
— (Array<map>
)Contains device position details such as the device ID, position, and timestamps for when the position was received and sampled.
DeviceId
— (String
)The device whose position you retrieved.
SampleTime
— required — (Date
)The timestamp at which the device's position was determined. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.ReceivedTime
— required — (Date
)The timestamp for when the tracker resource received the device position in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.Position
— required — (Array<Float>
)The last known device position.
Accuracy
— (map
)The accuracy of the device position.
Horizontal
— required — (Float
)Estimated maximum distance, in meters, between the measured position and the true position of a device, along the Earth's surface.
PositionProperties
— (map<String>
)The properties associated with the position.
-
(AWS.Response)
—
Returns:
batchPutGeofence(params = {}, callback) ⇒ AWS.Request
A batch request for storing geofence geometries into a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.
Service Reference:
Examples:
Calling the batchPutGeofence operation
var params = { CollectionName: 'STRING_VALUE', /* required */ Entries: [ /* required */ { GeofenceId: 'STRING_VALUE', /* required */ Geometry: { /* required */ Circle: { Center: [ /* required */ 'NUMBER_VALUE', /* more items */ ], Radius: 'NUMBER_VALUE' /* required */ }, Geobuf: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, Polygon: [ [ [ 'NUMBER_VALUE', /* more items */ ], /* more items */ ], /* more items */ ] }, GeofenceProperties: { '<PropertyMapKeyString>': 'STRING_VALUE', /* '<PropertyMapKeyString>': ... */ } }, /* more items */ ] }; location.batchPutGeofence(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)The geofence collection storing the geofences.
Entries
— (Array<map>
)The batch of geofences to be stored in a geofence collection.
GeofenceId
— required — (String
)The identifier for the geofence to be stored in a given geofence collection.
Geometry
— required — (map
)Contains the details to specify the position of the geofence. Can be a polygon, a circle or a polygon encoded in Geobuf format. Including multiple selections will return a validation error.
Note: The geofence polygon format supports a maximum of 1,000 vertices. The Geofence geobuf format supports a maximum of 100,000 vertices.Polygon
— (Array<Array<Array<Float>>>
)A polygon is a list of linear rings which are each made up of a list of vertices.
Each vertex is a 2-dimensional point of the form:
[longitude, latitude]
. This is represented as an array of doubles of length 2 (so[double, double]
).An array of 4 or more vertices, where the first and last vertex are the same (to form a closed boundary), is called a linear ring. The linear ring vertices must be listed in counter-clockwise order around the ring’s interior. The linear ring is represented as an array of vertices, or an array of arrays of doubles (
[[double, double], ...]
).A geofence consists of a single linear ring. To allow for future expansion, the Polygon parameter takes an array of linear rings, which is represented as an array of arrays of arrays of doubles (
[[[double, double], ...], ...]
).A linear ring for use in geofences can consist of between 4 and 1,000 vertices.
Circle
— (map
)A circle on the earth, as defined by a center point and a radius.
Center
— required — (Array<Float>
)A single point geometry, specifying the center of the circle, using WGS 84 coordinates, in the form
[longitude, latitude]
.Radius
— required — (Float
)The radius of the circle in meters. Must be greater than zero and no larger than 100,000 (100 kilometers).
Geobuf
— (Buffer, Typed Array, Blob, String
)Geobuf is a compact binary encoding for geographic data that provides lossless compression of GeoJSON polygons. The Geobuf must be Base64-encoded.
A polygon in Geobuf format can have up to 100,000 vertices.
GeofenceProperties
— (map<String>
)Associates one of more properties with the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.
Format:
"key" : "value"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Successes
— (Array<map>
)Contains each geofence that was successfully stored in a geofence collection.
GeofenceId
— required — (String
)The geofence successfully stored in a geofence collection.
CreateTime
— required — (Date
)The timestamp for when the geofence was stored in a geofence collection in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
UpdateTime
— required — (Date
)The timestamp for when the geofence was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
Errors
— (Array<map>
)Contains additional error details for each geofence that failed to be stored in a geofence collection.
GeofenceId
— required — (String
)The geofence associated with the error message.
Error
— required — (map
)Contains details associated to the batch error.
Code
— (String
)The error code associated with the batch request error.
Possible values include:"AccessDeniedError"
"ConflictError"
"InternalServerError"
"ResourceNotFoundError"
"ThrottlingError"
"ValidationError"
Message
— (String
)A message with the reason for the batch request error.
-
(AWS.Response)
—
Returns:
batchUpdateDevicePosition(params = {}, callback) ⇒ AWS.Request
Uploads position update data for one or more devices to a tracker resource (up to 10 devices per batch). Amazon Location uses the data when it reports the last known device position and position history. Amazon Location retains location data for 30 days.
Note: Position updates are handled based on thePositionFiltering
property of the tracker. WhenPositionFiltering
is set toTimeBased
, updates are evaluated against linked geofence collections, and location data is stored at a maximum of one position per 30 second interval. If your update frequency is more often than every 30 seconds, only one update per 30 seconds is stored for each unique device ID. WhenPositionFiltering
is set toDistanceBased
filtering, location data is stored and evaluated against linked geofence collections only if the device has moved more than 30 m (98.4 ft). WhenPositionFiltering
is set toAccuracyBased
filtering, location data is stored and evaluated against linked geofence collections only if the device has moved more than the measured accuracy. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is neither stored or evaluated if the device has moved less than 15 m. IfPositionFiltering
is set toAccuracyBased
filtering, Amazon Location uses the default value{ "Horizontal": 0}
when accuracy is not provided on aDevicePositionUpdate
.Service Reference:
Examples:
Calling the batchUpdateDevicePosition operation
var params = { TrackerName: 'STRING_VALUE', /* required */ Updates: [ /* required */ { DeviceId: 'STRING_VALUE', /* required */ Position: [ /* required */ 'NUMBER_VALUE', /* more items */ ], SampleTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */ Accuracy: { Horizontal: 'NUMBER_VALUE' /* required */ }, PositionProperties: { '<PropertyMapKeyString>': 'STRING_VALUE', /* '<PropertyMapKeyString>': ... */ } }, /* more items */ ] }; location.batchUpdateDevicePosition(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The name of the tracker resource to update.
Updates
— (Array<map>
)Contains the position update details for each device, up to 10 devices.
DeviceId
— required — (String
)The device associated to the position update.
SampleTime
— required — (Date
)The timestamp at which the device's position was determined. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
Position
— required — (Array<Float>
)The latest device position defined in WGS 84 format:
[X or longitude, Y or latitude]
.Accuracy
— (map
)The accuracy of the device position.
Horizontal
— required — (Float
)Estimated maximum distance, in meters, between the measured position and the true position of a device, along the Earth's surface.
PositionProperties
— (map<String>
)Associates one of more properties with the position update. A property is a key-value pair stored with the position update and added to any geofence event the update may trigger.
Format:
"key" : "value"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Errors
— (Array<map>
)Contains error details for each device that failed to update its position.
DeviceId
— required — (String
)The device associated with the failed location update.
SampleTime
— required — (Date
)The timestamp at which the device position was determined. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.Error
— required — (map
)Contains details related to the error code such as the error code and error message.
Code
— (String
)The error code associated with the batch request error.
Possible values include:"AccessDeniedError"
"ConflictError"
"InternalServerError"
"ResourceNotFoundError"
"ThrottlingError"
"ValidationError"
Message
— (String
)A message with the reason for the batch request error.
-
(AWS.Response)
—
Returns:
calculateRoute(params = {}, callback) ⇒ AWS.Request
Calculates a route given the following required parameters:
DeparturePosition
andDestinationPosition
. Requires that you first create a route calculator resource.By default, a request that doesn't specify a departure time uses the best time of day to travel with the best traffic conditions when calculating the route.
Additional options include:
-
Specifying a departure time using either
DepartureTime
orDepartNow
. This calculates a route based on predictive traffic data at the given time.Note: You can't specify bothDepartureTime
andDepartNow
in a single request. Specifying both parameters returns a validation error. -
Specifying a travel mode using TravelMode sets the transportation mode used to calculate the routes. This also lets you specify additional route preferences in
CarModeOptions
if traveling byCar
, orTruckModeOptions
if traveling byTruck
.Note: If you specifywalking
for the travel mode and your data provider is Esri, the start and destination must be within 40km.
Service Reference:
Examples:
Calling the calculateRoute operation
var params = { CalculatorName: 'STRING_VALUE', /* required */ DeparturePosition: [ /* required */ 'NUMBER_VALUE', /* more items */ ], DestinationPosition: [ /* required */ 'NUMBER_VALUE', /* more items */ ], ArrivalTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, CarModeOptions: { AvoidFerries: true || false, AvoidTolls: true || false }, DepartNow: true || false, DepartureTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, DistanceUnit: Kilometers | Miles, IncludeLegGeometry: true || false, Key: 'STRING_VALUE', OptimizeFor: FastestRoute | ShortestRoute, TravelMode: Car | Truck | Walking | Bicycle | Motorcycle, TruckModeOptions: { AvoidFerries: true || false, AvoidTolls: true || false, Dimensions: { Height: 'NUMBER_VALUE', Length: 'NUMBER_VALUE', Unit: Meters | Feet, Width: 'NUMBER_VALUE' }, Weight: { Total: 'NUMBER_VALUE', Unit: Kilograms | Pounds } }, WaypointPositions: [ [ 'NUMBER_VALUE', /* more items */ ], /* more items */ ] }; location.calculateRoute(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CalculatorName
— (String
)The name of the route calculator resource that you want to use to calculate the route.
DeparturePosition
— (Array<Float>
)The start position for the route. Defined in World Geodetic System (WGS 84) format:
[longitude, latitude]
.-
For example,
[-123.115, 49.285]
Note: If you specify a departure that's not located on a road, Amazon Location moves the position to the nearest road. If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a400 RoutesValidationException
error.Valid Values:
[-180 to 180,-90 to 90]
-
DestinationPosition
— (Array<Float>
)The finish position for the route. Defined in World Geodetic System (WGS 84) format:
[longitude, latitude]
.-
For example,
[-122.339, 47.615]
Note: If you specify a destination that's not located on a road, Amazon Location moves the position to the nearest road.Valid Values:
[-180 to 180,-90 to 90]
-
WaypointPositions
— (Array<Array<Float>>
)Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.
-
For example, from the
DeparturePosition
[-123.115, 49.285]
, the route follows the order that the waypoint positions are given[[-122.757, 49.0021],[-122.349, 47.620]]
Note: If you specify a waypoint position that's not located on a road, Amazon Location moves the position to the nearest road. Specifying more than 23 waypoints returns a400 ValidationException
error. If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a400 RoutesValidationException
error.Valid Values:
[-180 to 180,-90 to 90]
-
TravelMode
— (String
)Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility. You can choose
Car
,Truck
,Walking
,Bicycle
orMotorcycle
as options for theTravelMode
.Note:Bicycle
andMotorcycle
are only valid when using Grab as a data provider, and only within Southeast Asia.Truck
is not available for Grab. For more details on the using Grab for routing, including areas of coverage, see GrabMaps in the Amazon Location Service Developer Guide.The
TravelMode
you specify also determines how you specify route preferences:-
If traveling by
Car
use theCarModeOptions
parameter. -
If traveling by
Truck
use theTruckModeOptions
parameter.
Default Value:
Possible values include:Car
"Car"
"Truck"
"Walking"
"Bicycle"
"Motorcycle"
-
DepartureTime
— (Date
)Specifies the desired time of departure. Uses the given time to calculate the route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.
-
In ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
. For example,2020–07-2T12:15:20.000Z+01:00
-
DepartNow
— (Boolean
)Sets the time of departure as the current time. Uses the current time to calculate a route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.
Default Value:
false
Valid Values:
false
|true
DistanceUnit
— (String
)Set the unit system to specify the distance.
Default Value:
Possible values include:Kilometers
"Kilometers"
"Miles"
IncludeLegGeometry
— (Boolean
)Set to include the geometry details in the result for each path between a pair of positions.
Default Value:
false
Valid Values:
false
|true
CarModeOptions
— (map
)Specifies route preferences when traveling by
Car
, such as avoiding routes that use ferries or tolls.Requirements:
TravelMode
must be specified asCar
.AvoidFerries
— (Boolean
)Avoids ferries when calculating routes.
Default Value:
false
Valid Values:
false
|true
AvoidTolls
— (Boolean
)Avoids tolls when calculating routes.
Default Value:
false
Valid Values:
false
|true
TruckModeOptions
— (map
)Specifies route preferences when traveling by
Truck
, such as avoiding routes that use ferries or tolls, and truck specifications to consider when choosing an optimal road.Requirements:
TravelMode
must be specified asTruck
.AvoidFerries
— (Boolean
)Avoids ferries when calculating routes.
Default Value:
false
Valid Values:
false
|true
AvoidTolls
— (Boolean
)Avoids tolls when calculating routes.
Default Value:
false
Valid Values:
false
|true
Dimensions
— (map
)Specifies the truck's dimension specifications including length, height, width, and unit of measurement. Used to avoid roads that can't support the truck's dimensions.
Length
— (Float
)The length of the truck.
-
For example,
15.5
.
Note: For routes calculated with a HERE resource, this value must be between 0 and 300 meters.-
Height
— (Float
)The height of the truck.
-
For example,
4.5
.
Note: For routes calculated with a HERE resource, this value must be between 0 and 50 meters.-
Width
— (Float
)The width of the truck.
-
For example,
4.5
.
Note: For routes calculated with a HERE resource, this value must be between 0 and 50 meters.-
Unit
— (String
)Specifies the unit of measurement for the truck dimensions.
Default Value:
Possible values include:Meters
"Meters"
"Feet"
Weight
— (map
)Specifies the truck's weight specifications including total weight and unit of measurement. Used to avoid roads that can't support the truck's weight.
Total
— (Float
)The total weight of the truck.
-
For example,
3500
.
-
Unit
— (String
)The unit of measurement to use for the truck weight.
Default Value:
Possible values include:Kilograms
"Kilograms"
"Pounds"
ArrivalTime
— (Date
)Specifies the desired time of arrival. Uses the given time to calculate the route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.
Note: ArrivalTime is not supported Esri.OptimizeFor
— (String
)Specifies the distance to optimize for when calculating a route.
Possible values include:"FastestRoute"
"ShortestRoute"
Key
— (String
)The optional API key to authorize the request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Legs
— (Array<map>
)Contains details about each path between a pair of positions included along a route such as:
StartPosition
,EndPosition
,Distance
,DurationSeconds
,Geometry
, andSteps
. The number of legs returned corresponds to one fewer than the total number of positions in the request.For example, a route with a departure position and destination position returns one leg with the positions snapped to a nearby road:
-
The
StartPosition
is the departure position. -
The
EndPosition
is the destination position.
A route with a waypoint between the departure and destination position returns two legs with the positions snapped to a nearby road:
-
Leg 1: The
StartPosition
is the departure position . TheEndPosition
is the waypoint positon. -
Leg 2: The
StartPosition
is the waypoint position. TheEndPosition
is the destination position.
StartPosition
— required — (Array<Float>
)The starting position of the leg. Follows the format
[longitude,latitude]
.Note: If theStartPosition
isn't located on a road, it's snapped to a nearby road.EndPosition
— required — (Array<Float>
)The terminating position of the leg. Follows the format
[longitude,latitude]
.Note: If theEndPosition
isn't located on a road, it's snapped to a nearby road.Distance
— required — (Float
)The distance between the leg's
StartPosition
andEndPosition
along a calculated route.-
The default measurement is
Kilometers
unless the request specifies aDistanceUnit
ofMiles
.
-
DurationSeconds
— required — (Float
)The estimated travel time between the leg's
StartPosition
andEndPosition
. The travel mode and departure time that you specify in the request determines the calculated time.Geometry
— (map
)Contains the calculated route's path as a linestring geometry.
LineString
— (Array<Array<Float>>
)An ordered list of positions used to plot a route on a map.
The first position is closest to the start position for the leg, and the last position is the closest to the end position for the leg.
-
For example,
[[-123.117, 49.284],[-123.115, 49.285],[-123.115, 49.285]]
-
Steps
— required — (Array<map>
)Contains a list of steps, which represent subsections of a leg. Each step provides instructions for how to move to the next step in the leg such as the step's start position, end position, travel distance, travel duration, and geometry offset.
StartPosition
— required — (Array<Float>
)The starting position of a step. If the position is the first step in the leg, this position is the same as the start position of the leg.
EndPosition
— required — (Array<Float>
)The end position of a step. If the position the last step in the leg, this position is the same as the end position of the leg.
Distance
— required — (Float
)The travel distance between the step's
StartPosition
andEndPosition
.DurationSeconds
— required — (Float
)The estimated travel time, in seconds, from the step's
StartPosition
to theEndPosition
. . The travel mode and departure time that you specify in the request determines the calculated time.GeometryOffset
— (Integer
)Represents the start position, or index, in a sequence of steps within the leg's line string geometry. For example, the index of the first step in a leg geometry is
0
.Included in the response for queries that set
IncludeLegGeometry
toTrue
.
-
Summary
— (map
)Contains information about the whole route, such as:
RouteBBox
,DataSource
,Distance
,DistanceUnit
, andDurationSeconds
.RouteBBox
— required — (Array<Float>
)Specifies a geographical box surrounding a route. Used to zoom into a route when displaying it in a map. For example,
[min x, min y, max x, max y]
.The first 2
bbox
parameters describe the lower southwest corner:-
The first
bbox
position is the X coordinate or longitude of the lower southwest corner. -
The second
bbox
position is the Y coordinate or latitude of the lower southwest corner.
The next 2
bbox
parameters describe the upper northeast corner:-
The third
bbox
position is the X coordinate, or longitude of the upper northeast corner. -
The fourth
bbox
position is the Y coordinate, or latitude of the upper northeast corner.
-
DataSource
— required — (String
)The data provider of traffic and road network data used to calculate the route. Indicates one of the available providers:
-
Esri
-
Grab
-
Here
For more information about data providers, see Amazon Location Service data providers.
-
Distance
— required — (Float
)The total distance covered by the route. The sum of the distance travelled between every stop on the route.
Note: If Esri is the data source for the route calculator, the route distance can’t be greater than 400 km. If the route exceeds 400 km, the response is a400 RoutesValidationException
error.DurationSeconds
— required — (Float
)The total travel time for the route measured in seconds. The sum of the travel time between every stop on the route.
DistanceUnit
— required — (String
)The unit of measurement for route distances.
Possible values include:"Kilometers"
"Miles"
-
(AWS.Response)
—
Returns:
calculateRouteMatrix(params = {}, callback) ⇒ AWS.Request
Calculates a route matrix given the following required parameters:
DeparturePositions
andDestinationPositions
.CalculateRouteMatrix
calculates routes and returns the travel time and travel distance from each departure position to each destination position in the request. For example, given departure positions A and B, and destination positions X and Y,CalculateRouteMatrix
will return time and distance for routes from A to X, A to Y, B to X, and B to Y (in that order). The number of results returned (and routes calculated) will be the number ofDeparturePositions
times the number ofDestinationPositions
.Note: Your account is charged for each route calculated, not the number of requests.Requires that you first create a route calculator resource.
By default, a request that doesn't specify a departure time uses the best time of day to travel with the best traffic conditions when calculating routes.
Additional options include:
-
Specifying a departure time using either
DepartureTime
orDepartNow
. This calculates routes based on predictive traffic data at the given time.Note: You can't specify bothDepartureTime
andDepartNow
in a single request. Specifying both parameters returns a validation error. -
Specifying a travel mode using TravelMode sets the transportation mode used to calculate the routes. This also lets you specify additional route preferences in
CarModeOptions
if traveling byCar
, orTruckModeOptions
if traveling byTruck
.
Service Reference:
Examples:
Calling the calculateRouteMatrix operation
var params = { CalculatorName: 'STRING_VALUE', /* required */ DeparturePositions: [ /* required */ [ 'NUMBER_VALUE', /* more items */ ], /* more items */ ], DestinationPositions: [ /* required */ [ 'NUMBER_VALUE', /* more items */ ], /* more items */ ], CarModeOptions: { AvoidFerries: true || false, AvoidTolls: true || false }, DepartNow: true || false, DepartureTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, DistanceUnit: Kilometers | Miles, Key: 'STRING_VALUE', TravelMode: Car | Truck | Walking | Bicycle | Motorcycle, TruckModeOptions: { AvoidFerries: true || false, AvoidTolls: true || false, Dimensions: { Height: 'NUMBER_VALUE', Length: 'NUMBER_VALUE', Unit: Meters | Feet, Width: 'NUMBER_VALUE' }, Weight: { Total: 'NUMBER_VALUE', Unit: Kilograms | Pounds } } }; location.calculateRouteMatrix(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CalculatorName
— (String
)The name of the route calculator resource that you want to use to calculate the route matrix.
DeparturePositions
— (Array<Array<Float>>
)The list of departure (origin) positions for the route matrix. An array of points, each of which is itself a 2-value array defined in WGS 84 format:
[longitude, latitude]
. For example,[-123.115, 49.285]
.Depending on the data provider selected in the route calculator resource there may be additional restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide.
Note: For route calculators that use Esri as the data provider, if you specify a departure that's not located on a road, Amazon Location moves the position to the nearest road. The snapped value is available in the result inSnappedDeparturePositions
.Valid Values:
[-180 to 180,-90 to 90]
DestinationPositions
— (Array<Array<Float>>
)The list of destination positions for the route matrix. An array of points, each of which is itself a 2-value array defined in WGS 84 format:
[longitude, latitude]
. For example,[-122.339, 47.615]
Depending on the data provider selected in the route calculator resource there may be additional restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide.
Note: For route calculators that use Esri as the data provider, if you specify a destination that's not located on a road, Amazon Location moves the position to the nearest road. The snapped value is available in the result inSnappedDestinationPositions
.Valid Values:
[-180 to 180,-90 to 90]
TravelMode
— (String
)Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.
The
TravelMode
you specify also determines how you specify route preferences:-
If traveling by
Car
use theCarModeOptions
parameter. -
If traveling by
Truck
use theTruckModeOptions
parameter.
Note:Bicycle
orMotorcycle
are only valid when usingGrab
as a data provider, and only within Southeast Asia.Truck
is not available for Grab. For more information about using Grab as a data provider, see GrabMaps in the Amazon Location Service Developer Guide.Default Value:
Possible values include:Car
"Car"
"Truck"
"Walking"
"Bicycle"
"Motorcycle"
-
DepartureTime
— (Date
)Specifies the desired time of departure. Uses the given time to calculate the route matrix. You can't set both
DepartureTime
andDepartNow
. If neither is set, the best time of day to travel with the best traffic conditions is used to calculate the route matrix.Note: Setting a departure time in the past returns a400 ValidationException
error.-
In ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
. For example,2020–07-2T12:15:20.000Z+01:00
-
DepartNow
— (Boolean
)Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You can't set both
DepartureTime
andDepartNow
. If neither is set, the best time of day to travel with the best traffic conditions is used to calculate the route matrix.Default Value:
false
Valid Values:
false
|true
DistanceUnit
— (String
)Set the unit system to specify the distance.
Default Value:
Possible values include:Kilometers
"Kilometers"
"Miles"
CarModeOptions
— (map
)Specifies route preferences when traveling by
Car
, such as avoiding routes that use ferries or tolls.Requirements:
TravelMode
must be specified asCar
.AvoidFerries
— (Boolean
)Avoids ferries when calculating routes.
Default Value:
false
Valid Values:
false
|true
AvoidTolls
— (Boolean
)Avoids tolls when calculating routes.
Default Value:
false
Valid Values:
false
|true
TruckModeOptions
— (map
)Specifies route preferences when traveling by
Truck
, such as avoiding routes that use ferries or tolls, and truck specifications to consider when choosing an optimal road.Requirements:
TravelMode
must be specified asTruck
.AvoidFerries
— (Boolean
)Avoids ferries when calculating routes.
Default Value:
false
Valid Values:
false
|true
AvoidTolls
— (Boolean
)Avoids tolls when calculating routes.
Default Value:
false
Valid Values:
false
|true
Dimensions
— (map
)Specifies the truck's dimension specifications including length, height, width, and unit of measurement. Used to avoid roads that can't support the truck's dimensions.
Length
— (Float
)The length of the truck.
-
For example,
15.5
.
Note: For routes calculated with a HERE resource, this value must be between 0 and 300 meters.-
Height
— (Float
)The height of the truck.
-
For example,
4.5
.
Note: For routes calculated with a HERE resource, this value must be between 0 and 50 meters.-
Width
— (Float
)The width of the truck.
-
For example,
4.5
.
Note: For routes calculated with a HERE resource, this value must be between 0 and 50 meters.-
Unit
— (String
)Specifies the unit of measurement for the truck dimensions.
Default Value:
Possible values include:Meters
"Meters"
"Feet"
Weight
— (map
)Specifies the truck's weight specifications including total weight and unit of measurement. Used to avoid roads that can't support the truck's weight.
Total
— (Float
)The total weight of the truck.
-
For example,
3500
.
-
Unit
— (String
)The unit of measurement to use for the truck weight.
Default Value:
Possible values include:Kilograms
"Kilograms"
"Pounds"
Key
— (String
)The optional API key to authorize the request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:RouteMatrix
— (Array<Array<map>>
)The calculated route matrix containing the results for all pairs of
DeparturePositions
toDestinationPositions
. Each row corresponds to one entry inDeparturePositions
. Each entry in the row corresponds to the route from that entry inDeparturePositions
to an entry inDestinationPositions
.Distance
— (Float
)The total distance of travel for the route.
DurationSeconds
— (Float
)The expected duration of travel for the route.
Error
— (map
)An error corresponding to the calculation of a route between the
DeparturePosition
andDestinationPosition
.Code
— required — (String
)The type of error which occurred for the route calculation.
Possible values include:"RouteNotFound"
"RouteTooLong"
"PositionsNotFound"
"DestinationPositionNotFound"
"DeparturePositionNotFound"
"OtherValidationError"
Message
— (String
)A message about the error that occurred for the route calculation.
SnappedDeparturePositions
— (Array<Array<Float>>
)For routes calculated using an Esri route calculator resource, departure positions are snapped to the closest road. For Esri route calculator resources, this returns the list of departure/origin positions used for calculation of the
RouteMatrix
.SnappedDestinationPositions
— (Array<Array<Float>>
)The list of destination positions for the route matrix used for calculation of the
RouteMatrix
.Summary
— (map
)Contains information about the route matrix,
DataSource
,DistanceUnit
,RouteCount
andErrorCount
.DataSource
— required — (String
)The data provider of traffic and road network data used to calculate the routes. Indicates one of the available providers:
-
Esri
-
Grab
-
Here
For more information about data providers, see Amazon Location Service data providers.
-
RouteCount
— required — (Integer
)The count of cells in the route matrix. Equal to the number of
DeparturePositions
multiplied by the number ofDestinationPositions
.ErrorCount
— required — (Integer
)The count of error results in the route matrix. If this number is 0, all routes were calculated successfully.
DistanceUnit
— required — (String
)The unit of measurement for route distances.
Possible values include:"Kilometers"
"Miles"
-
(AWS.Response)
—
Returns:
createGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Creates a geofence collection, which manages and stores geofences.
Service Reference:
Examples:
Calling the createGeofenceCollection operation
var params = { CollectionName: 'STRING_VALUE', /* required */ Description: 'STRING_VALUE', KmsKeyId: 'STRING_VALUE', PricingPlan: RequestBasedUsage | MobileAssetTracking | MobileAssetManagement, PricingPlanDataSource: 'STRING_VALUE', Tags: { '<TagKey>': 'STRING_VALUE', /* '<TagKey>': ... */ } }; location.createGeofenceCollection(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)A custom name for the geofence collection.
Requirements:
-
Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).
-
Must be a unique geofence collection name.
-
No spaces allowed. For example,
ExampleGeofenceCollection
.
-
PricingPlan
— (String
)No longer used. If included, the only allowed value is
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
PricingPlanDataSource
— (String
)This parameter is no longer used.
Description
— (String
)An optional description for the geofence collection.
Tags
— (map<String>
)Applies one or more tags to the geofence collection. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.
Format:
"key" : "value"
Restrictions:
-
Maximum 50 tags per resource
-
Each resource tag must be unique with a maximum of one value.
-
Maximum key length: 128 Unicode characters in UTF-8
-
Maximum value length: 256 Unicode characters in UTF-8
-
Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.
-
Cannot use "aws:" as a prefix for a key.
-
KmsKeyId
— (String
)A key identifier for an Amazon Web Services KMS customer managed key. Enter a key ID, key ARN, alias name, or alias ARN.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CollectionName
— (String
)The name for the geofence collection.
CollectionArn
— (String
)The Amazon Resource Name (ARN) for the geofence collection resource. Used when you need to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollection
-
CreateTime
— (Date
)The timestamp for when the geofence collection was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
-
(AWS.Response)
—
Returns:
createKey(params = {}, callback) ⇒ AWS.Request
Creates an API key resource in your Amazon Web Services account, which lets you grant actions for Amazon Location resources to the API key bearer.
Note: For more information, see Using API keys.Service Reference:
Examples:
Calling the createKey operation
var params = { KeyName: 'STRING_VALUE', /* required */ Restrictions: { /* required */ AllowActions: [ /* required */ 'STRING_VALUE', /* more items */ ], AllowResources: [ /* required */ 'STRING_VALUE', /* more items */ ], AllowReferers: [ 'STRING_VALUE', /* more items */ ] }, Description: 'STRING_VALUE', ExpireTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, NoExpiry: true || false, Tags: { '<TagKey>': 'STRING_VALUE', /* '<TagKey>': ... */ } }; location.createKey(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
KeyName
— (String
)A custom name for the API key resource.
Requirements:
-
Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).
-
Must be a unique API key name.
-
No spaces allowed. For example,
ExampleAPIKey
.
-
Restrictions
— (map
)The API key restrictions for the API key resource.
AllowActions
— required — (Array<String>
)A list of allowed actions that an API key resource grants permissions to perform. You must have at least one action for each type of resource. For example, if you have a place resource, you must include at least one place action.
The following are valid values for the actions.
-
Map actions
-
geo:GetMap*
- Allows all actions needed for map rendering.
-
-
Place actions
-
geo:SearchPlaceIndexForText
- Allows geocoding. -
geo:SearchPlaceIndexForPosition
- Allows reverse geocoding. -
geo:SearchPlaceIndexForSuggestions
- Allows generating suggestions from text. -
GetPlace
- Allows finding a place by place ID.
-
-
Route actions
-
geo:CalculateRoute
- Allows point to point routing. -
geo:CalculateRouteMatrix
- Allows calculating a matrix of routes.
-
Note: You must use these strings exactly. For example, to provide access to map rendering, the only valid action isgeo:GetMap*
as an input to the list.["geo:GetMap*"]
is valid but["geo:GetMapTile"]
is not. Similarly, you cannot use["geo:SearchPlaceIndexFor*"]
- you must list each of the Place actions separately.-
AllowResources
— required — (Array<String>
)A list of allowed resource ARNs that a API key bearer can perform actions on.
-
The ARN must be the correct ARN for a map, place, or route ARN. You may include wildcards in the resource-id to match multiple resources of the same type.
-
The resources must be in the same
partition
,region
, andaccount-id
as the key that is being created. -
Other than wildcards, you must include the full ARN, including the
arn
,partition
,service
,region
,account-id
andresource-id
delimited by colons (:). -
No spaces allowed, even with wildcards. For example,
arn:aws:geo:region:account-id:map/ExampleMap*
.
For more information about ARN format, see Amazon Resource Names (ARNs).
-
AllowReferers
— (Array<String>
)An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.
Requirements:
-
Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list
$-._+!*(),;/?:@=&
-
May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.
-
May contain wildcard characters question mark (?) and asterisk ().
Question mark (?) will replace any single character (including hexadecimal digits).
Asterisk () will replace any multiple characters (including multiple hexadecimal digits).
-
No spaces allowed. For example,
https://example.com
.
-
Description
— (String
)An optional description for the API key resource.
ExpireTime
— (Date
)The optional timestamp for when the API key resource will expire in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
. One ofNoExpiry
orExpireTime
must be set.NoExpiry
— (Boolean
)Optionally set to
true
to set no expiration time for the API key. One ofNoExpiry
orExpireTime
must be set.Tags
— (map<String>
)Applies one or more tags to the map resource. A tag is a key-value pair that helps manage, identify, search, and filter your resources by labelling them.
Format:
"key" : "value"
Restrictions:
-
Maximum 50 tags per resource
-
Each resource tag must be unique with a maximum of one value.
-
Maximum key length: 128 Unicode characters in UTF-8
-
Maximum value length: 256 Unicode characters in UTF-8
-
Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.
-
Cannot use "aws:" as a prefix for a key.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Key
— (String
)The key value/string of an API key. This value is used when making API calls to authorize the call. For example, see GetMapGlyphs.
KeyArn
— (String
)The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:key/ExampleKey
-
KeyName
— (String
)The name of the API key resource.
CreateTime
— (Date
)The timestamp for when the API key resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
-
(AWS.Response)
—
Returns:
createMap(params = {}, callback) ⇒ AWS.Request
Creates a map resource in your Amazon Web Services account, which provides map tiles of different styles sourced from global location data providers.
Note: If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the Amazon Web Services service terms for more details.Service Reference:
Examples:
Calling the createMap operation
var params = { Configuration: { /* required */ Style: 'STRING_VALUE', /* required */ CustomLayers: [ 'STRING_VALUE', /* more items */ ], PoliticalView: 'STRING_VALUE' }, MapName: 'STRING_VALUE', /* required */ Description: 'STRING_VALUE', PricingPlan: RequestBasedUsage | MobileAssetTracking | MobileAssetManagement, Tags: { '<TagKey>': 'STRING_VALUE', /* '<TagKey>': ... */ } }; location.createMap(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MapName
— (String
)The name for the map resource.
Requirements:
-
Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).
-
Must be a unique map resource name.
-
No spaces allowed. For example,
ExampleMap
.
-
Configuration
— (map
)Specifies the
MapConfiguration
, including the map style, for the map resource that you create. The map style defines the look of maps and the data provider for your map resource.Style
— required — (String
)Specifies the map style selected from an available data provider.
Valid Esri map styles:
-
VectorEsriDarkGrayCanvas
– The Esri Dark Gray Canvas map style. A vector basemap with a dark gray, neutral background with minimal colors, labels, and features that's designed to draw attention to your thematic content. -
RasterEsriImagery
– The Esri Imagery map style. A raster basemap that provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. -
VectorEsriLightGrayCanvas
– The Esri Light Gray Canvas map style, which provides a detailed vector basemap with a light gray, neutral background style with minimal colors, labels, and features that's designed to draw attention to your thematic content. -
VectorEsriTopographic
– The Esri Light map style, which provides a detailed vector basemap with a classic Esri map style. -
VectorEsriStreets
– The Esri Street Map style, which provides a detailed vector basemap for the world symbolized with a classic Esri street map style. The vector tile layer is similar in content and style to the World Street Map raster map. -
VectorEsriNavigation
– The Esri Navigation map style, which provides a detailed basemap for the world symbolized with a custom navigation map style that's designed for use during the day in mobile devices.
Valid HERE Technologies map styles:
-
VectorHereContrast
– The HERE Contrast (Berlin) map style is a high contrast detailed base map of the world that blends 3D and 2D rendering.Note: TheVectorHereContrast
style has been renamed fromVectorHereBerlin
.VectorHereBerlin
has been deprecated, but will continue to work in applications that use it. -
VectorHereExplore
– A default HERE map style containing a neutral, global map and its features including roads, buildings, landmarks, and water features. It also now includes a fully designed map of Japan. -
VectorHereExploreTruck
– A global map containing truck restrictions and attributes (e.g. width / height / HAZMAT) symbolized with highlighted segments and icons on top of HERE Explore to support use cases within transport and logistics. -
RasterHereExploreSatellite
– A global map containing high resolution satellite imagery. -
HybridHereExploreSatellite
– A global map displaying the road network, street names, and city labels over satellite imagery. This style will automatically retrieve both raster and vector tiles, and your charges will be based on total tiles retrieved.Note: Hybrid styles use both vector and raster tiles when rendering the map that you see. This means that more tiles are retrieved than when using either vector or raster tiles alone. Your charges will include all tiles retrieved.
Valid GrabMaps map styles:
-
VectorGrabStandardLight
– The Grab Standard Light map style provides a basemap with detailed land use coloring, area names, roads, landmarks, and points of interest covering Southeast Asia. -
VectorGrabStandardDark
– The Grab Standard Dark map style provides a dark variation of the standard basemap covering Southeast Asia.
Note: Grab provides maps only for countries in Southeast Asia, and is only available in the Asia Pacific (Singapore) Region (ap-southeast-1
). For more information, see GrabMaps countries and area covered.Valid Open Data map styles:
-
VectorOpenDataStandardLight
– The Open Data Standard Light map style provides a detailed basemap for the world suitable for website and mobile application use. The map includes highways major roads, minor roads, railways, water features, cities, parks, landmarks, building footprints, and administrative boundaries. -
VectorOpenDataStandardDark
– Open Data Standard Dark is a dark-themed map style that provides a detailed basemap for the world suitable for website and mobile application use. The map includes highways major roads, minor roads, railways, water features, cities, parks, landmarks, building footprints, and administrative boundaries. -
VectorOpenDataVisualizationLight
– The Open Data Visualization Light map style is a light-themed style with muted colors and fewer features that aids in understanding overlaid data. -
VectorOpenDataVisualizationDark
– The Open Data Visualization Dark map style is a dark-themed style with muted colors and fewer features that aids in understanding overlaid data.
-
PoliticalView
— (String
)Specifies the political view for the style. Leave unset to not use a political view, or, for styles that support specific political views, you can choose a view, such as
IND
for the Indian view.Default is unset.
Note: Not all map resources or styles support political view styles. See Political views for more information.CustomLayers
— (Array<String>
)Specifies the custom layers for the style. Leave unset to not enable any custom layer, or, for styles that support custom layers, you can enable layer(s), such as POI layer for the VectorEsriNavigation style. Default is
unset
.Note: Not all map resources or styles support custom layers. See Custom Layers for more information.
PricingPlan
— (String
)No longer used. If included, the only allowed value is
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
Description
— (String
)An optional description for the map resource.
Tags
— (map<String>
)Applies one or more tags to the map resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.
Format:
"key" : "value"
Restrictions:
-
Maximum 50 tags per resource
-
Each resource tag must be unique with a maximum of one value.
-
Maximum key length: 128 Unicode characters in UTF-8
-
Maximum value length: 256 Unicode characters in UTF-8
-
Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.
-
Cannot use "aws:" as a prefix for a key.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:MapName
— (String
)The name of the map resource.
MapArn
— (String
)The Amazon Resource Name (ARN) for the map resource. Used to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:map/ExampleMap
-
CreateTime
— (Date
)The timestamp for when the map resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
-
(AWS.Response)
—
Returns:
createPlaceIndex(params = {}, callback) ⇒ AWS.Request
Creates a place index resource in your Amazon Web Services account. Use a place index resource to geocode addresses and other text queries by using the
SearchPlaceIndexForText
operation, and reverse geocode coordinates by using theSearchPlaceIndexForPosition
operation, and enable autosuggestions by using theSearchPlaceIndexForSuggestions
operation.Note: If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the Amazon Web Services service terms for more details.Service Reference:
Examples:
Calling the createPlaceIndex operation
var params = { DataSource: 'STRING_VALUE', /* required */ IndexName: 'STRING_VALUE', /* required */ DataSourceConfiguration: { IntendedUse: SingleUse | Storage }, Description: 'STRING_VALUE', PricingPlan: RequestBasedUsage | MobileAssetTracking | MobileAssetManagement, Tags: { '<TagKey>': 'STRING_VALUE', /* '<TagKey>': ... */ } }; location.createPlaceIndex(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
IndexName
— (String
)The name of the place index resource.
Requirements:
-
Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).
-
Must be a unique place index resource name.
-
No spaces allowed. For example,
ExamplePlaceIndex
.
-
DataSource
— (String
)Specifies the geospatial data provider for the new place index.
Note: This field is case-sensitive. Enter the valid values as shown. For example, enteringHERE
returns an error.Valid values include:
-
Esri
– For additional information about Esri's coverage in your region of interest, see Esri details on geocoding coverage. -
Grab
– Grab provides place index functionality for Southeast Asia. For additional information about GrabMaps' coverage, see GrabMaps countries and areas covered. -
Here
– For additional information about HERE Technologies' coverage in your region of interest, see HERE details on goecoding coverage.If you specify HERE Technologies (
Here
) as the data provider, you may not store results for locations in Japan. For more information, see the Amazon Web Services Service Terms for Amazon Location Service.
For additional information , see Data providers on the Amazon Location Service Developer Guide.
-
PricingPlan
— (String
)No longer used. If included, the only allowed value is
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
Description
— (String
)The optional description for the place index resource.
DataSourceConfiguration
— (map
)Specifies the data storage option requesting Places.
IntendedUse
— (String
)Specifies how the results of an operation will be stored by the caller.
Valid values include:
-
SingleUse
specifies that the results won't be stored. -
Storage
specifies that the result can be cached or stored in a database.
Default value:
Possible values include:SingleUse
"SingleUse"
"Storage"
-
Tags
— (map<String>
)Applies one or more tags to the place index resource. A tag is a key-value pair that helps you manage, identify, search, and filter your resources.
Format:
"key" : "value"
Restrictions:
-
Maximum 50 tags per resource.
-
Each tag key must be unique and must have exactly one associated value.
-
Maximum key length: 128 Unicode characters in UTF-8.
-
Maximum value length: 256 Unicode characters in UTF-8.
-
Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @
-
Cannot use "aws:" as a prefix for a key.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:IndexName
— (String
)The name for the place index resource.
IndexArn
— (String
)The Amazon Resource Name (ARN) for the place index resource. Used to specify a resource across Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:place-index/ExamplePlaceIndex
-
CreateTime
— (Date
)The timestamp for when the place index resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
-
(AWS.Response)
—
Returns:
createRouteCalculator(params = {}, callback) ⇒ AWS.Request
Creates a route calculator resource in your Amazon Web Services account.
You can send requests to a route calculator resource to estimate travel time, distance, and get directions. A route calculator sources traffic and road network data from your chosen data provider.
Note: If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the Amazon Web Services service terms for more details.Service Reference:
Examples:
Calling the createRouteCalculator operation
var params = { CalculatorName: 'STRING_VALUE', /* required */ DataSource: 'STRING_VALUE', /* required */ Description: 'STRING_VALUE', PricingPlan: RequestBasedUsage | MobileAssetTracking | MobileAssetManagement, Tags: { '<TagKey>': 'STRING_VALUE', /* '<TagKey>': ... */ } }; location.createRouteCalculator(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CalculatorName
— (String
)The name of the route calculator resource.
Requirements:
-
Can use alphanumeric characters (A–Z, a–z, 0–9) , hyphens (-), periods (.), and underscores (_).
-
Must be a unique Route calculator resource name.
-
No spaces allowed. For example,
ExampleRouteCalculator
.
-
DataSource
— (String
)Specifies the data provider of traffic and road network data.
Note: This field is case-sensitive. Enter the valid values as shown. For example, enteringHERE
returns an error.Valid values include:
-
Esri
– For additional information about Esri's coverage in your region of interest, see Esri details on street networks and traffic coverage.Route calculators that use Esri as a data source only calculate routes that are shorter than 400 km.
-
Grab
– Grab provides routing functionality for Southeast Asia. For additional information about GrabMaps' coverage, see GrabMaps countries and areas covered. -
Here
– For additional information about HERE Technologies' coverage in your region of interest, see HERE car routing coverage and HERE truck routing coverage.
For additional information , see Data providers on the Amazon Location Service Developer Guide.
-
PricingPlan
— (String
)No longer used. If included, the only allowed value is
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
Description
— (String
)The optional description for the route calculator resource.
Tags
— (map<String>
)Applies one or more tags to the route calculator resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.
-
For example: {
"tag1" : "value1"
,"tag2" : "value2"
}
Format:
"key" : "value"
Restrictions:
-
Maximum 50 tags per resource
-
Each resource tag must be unique with a maximum of one value.
-
Maximum key length: 128 Unicode characters in UTF-8
-
Maximum value length: 256 Unicode characters in UTF-8
-
Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.
-
Cannot use "aws:" as a prefix for a key.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CalculatorName
— (String
)The name of the route calculator resource.
-
For example,
ExampleRouteCalculator
.
-
CalculatorArn
— (String
)The Amazon Resource Name (ARN) for the route calculator resource. Use the ARN when you specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:route-calculator/ExampleCalculator
-
CreateTime
— (Date
)The timestamp when the route calculator resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.-
For example,
2020–07-2T12:15:20.000Z+01:00
-
-
(AWS.Response)
—
Returns:
createTracker(params = {}, callback) ⇒ AWS.Request
Creates a tracker resource in your Amazon Web Services account, which lets you retrieve current and historical location of devices.
Service Reference:
Examples:
Calling the createTracker operation
var params = { TrackerName: 'STRING_VALUE', /* required */ Description: 'STRING_VALUE', EventBridgeEnabled: true || false, KmsKeyEnableGeospatialQueries: true || false, KmsKeyId: 'STRING_VALUE', PositionFiltering: TimeBased | DistanceBased | AccuracyBased, PricingPlan: RequestBasedUsage | MobileAssetTracking | MobileAssetManagement, PricingPlanDataSource: 'STRING_VALUE', Tags: { '<TagKey>': 'STRING_VALUE', /* '<TagKey>': ... */ } }; location.createTracker(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The name for the tracker resource.
Requirements:
-
Contain only alphanumeric characters (A-Z, a-z, 0-9) , hyphens (-), periods (.), and underscores (_).
-
Must be a unique tracker resource name.
-
No spaces allowed. For example,
ExampleTracker
.
-
PricingPlan
— (String
)No longer used. If included, the only allowed value is
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
KmsKeyId
— (String
)A key identifier for an Amazon Web Services KMS customer managed key. Enter a key ID, key ARN, alias name, or alias ARN.
PricingPlanDataSource
— (String
)This parameter is no longer used.
Description
— (String
)An optional description for the tracker resource.
Tags
— (map<String>
)Applies one or more tags to the tracker resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.
Format:
"key" : "value"
Restrictions:
-
Maximum 50 tags per resource
-
Each resource tag must be unique with a maximum of one value.
-
Maximum key length: 128 Unicode characters in UTF-8
-
Maximum value length: 256 Unicode characters in UTF-8
-
Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.
-
Cannot use "aws:" as a prefix for a key.
-
PositionFiltering
— (String
)Specifies the position filtering for the tracker resource.
Valid values:
-
TimeBased
- Location updates are evaluated against linked geofence collections, but not every location update is stored. If your update frequency is more often than 30 seconds, only one update per 30 seconds is stored for each unique device ID. -
DistanceBased
- If the device has moved less than 30 m (98.4 ft), location updates are ignored. Location updates within this area are neither evaluated against linked geofence collections, nor stored. This helps control costs by reducing the number of geofence evaluations and historical device positions to paginate through. Distance-based filtering can also reduce the effects of GPS noise when displaying device trajectories on a map. -
AccuracyBased
- If the device has moved less than the measured accuracy, location updates are ignored. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is ignored if the device has moved less than 15 m. Ignored location updates are neither evaluated against linked geofence collections, nor stored. This can reduce the effects of GPS noise when displaying device trajectories on a map, and can help control your costs by reducing the number of geofence evaluations.
This field is optional. If not specified, the default value is
Possible values include:TimeBased
."TimeBased"
"DistanceBased"
"AccuracyBased"
-
EventBridgeEnabled
— (Boolean
)Whether to enable position
UPDATE
events from this tracker to be sent to EventBridge.Note: You do not need enable this feature to getENTER
andEXIT
events for geofences with this tracker. Those events are always sent to EventBridge.KmsKeyEnableGeospatialQueries
— (Boolean
)Enables
GeospatialQueries
for a tracker that uses a Amazon Web Services KMS customer managed key.This parameter is only used if you are using a KMS customer managed key.
Note: If you wish to encrypt your data using your own KMS customer managed key, then the Bounding Polygon Queries feature will be disabled by default. This is because by using this feature, a representation of your device positions will not be encrypted using the your KMS managed key. The exact device position, however; is still encrypted using your managed key. You can choose to opt-in to the Bounding Polygon Quseries feature. This is done by setting theKmsKeyEnableGeospatialQueries
parameter to true when creating or updating a Tracker.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:TrackerName
— (String
)The name of the tracker resource.
TrackerArn
— (String
)The Amazon Resource Name (ARN) for the tracker resource. Used when you need to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:tracker/ExampleTracker
-
CreateTime
— (Date
)The timestamp for when the tracker resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
-
(AWS.Response)
—
Returns:
deleteGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Deletes a geofence collection from your Amazon Web Services account.
Note: This operation deletes the resource permanently. If the geofence collection is the target of a tracker resource, the devices will no longer be monitored.Service Reference:
Examples:
Calling the deleteGeofenceCollection operation
var params = { CollectionName: 'STRING_VALUE' /* required */ }; location.deleteGeofenceCollection(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)The name of the geofence collection to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteKey(params = {}, callback) ⇒ AWS.Request
Deletes the specified API key. The API key must have been deactivated more than 90 days previously.
Service Reference:
Examples:
Calling the deleteKey operation
var params = { KeyName: 'STRING_VALUE', /* required */ ForceDelete: true || false }; location.deleteKey(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
KeyName
— (String
)The name of the API key to delete.
ForceDelete
— (Boolean
)ForceDelete bypasses an API key's expiry conditions and deletes the key. Set the parameter
true
to delete the key or tofalse
to not preemptively delete the API key.Valid values:
true
, orfalse
.Required: No
Note: This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteMap(params = {}, callback) ⇒ AWS.Request
Deletes a map resource from your Amazon Web Services account.
Note: This operation deletes the resource permanently. If the map is being used in an application, the map may not render.Service Reference:
Examples:
Calling the deleteMap operation
var params = { MapName: 'STRING_VALUE' /* required */ }; location.deleteMap(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MapName
— (String
)The name of the map resource to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deletePlaceIndex(params = {}, callback) ⇒ AWS.Request
Deletes a place index resource from your Amazon Web Services account.
Note: This operation deletes the resource permanently.Service Reference:
Examples:
Calling the deletePlaceIndex operation
var params = { IndexName: 'STRING_VALUE' /* required */ }; location.deletePlaceIndex(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
IndexName
— (String
)The name of the place index resource to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteRouteCalculator(params = {}, callback) ⇒ AWS.Request
Deletes a route calculator resource from your Amazon Web Services account.
Note: This operation deletes the resource permanently.Service Reference:
Examples:
Calling the deleteRouteCalculator operation
var params = { CalculatorName: 'STRING_VALUE' /* required */ }; location.deleteRouteCalculator(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CalculatorName
— (String
)The name of the route calculator resource to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteTracker(params = {}, callback) ⇒ AWS.Request
Deletes a tracker resource from your Amazon Web Services account.
Note: This operation deletes the resource permanently. If the tracker resource is in use, you may encounter an error. Make sure that the target resource isn't a dependency for your applications.Service Reference:
Examples:
Calling the deleteTracker operation
var params = { TrackerName: 'STRING_VALUE' /* required */ }; location.deleteTracker(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The name of the tracker resource to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
describeGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Retrieves the geofence collection details.
Service Reference:
Examples:
Calling the describeGeofenceCollection operation
var params = { CollectionName: 'STRING_VALUE' /* required */ }; location.describeGeofenceCollection(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)The name of the geofence collection.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CollectionName
— (String
)The name of the geofence collection.
CollectionArn
— (String
)The Amazon Resource Name (ARN) for the geofence collection resource. Used when you need to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollection
-
Description
— (String
)The optional description for the geofence collection.
PricingPlan
— (String
)No longer used. Always returns
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
PricingPlanDataSource
— (String
)No longer used. Always returns an empty string.
KmsKeyId
— (String
)A key identifier for an Amazon Web Services KMS customer managed key assigned to the Amazon Location resource
Tags
— (map<String>
)Displays the key, value pairs of tags associated with this resource.
CreateTime
— (Date
)The timestamp for when the geofence resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
UpdateTime
— (Date
)The timestamp for when the geofence collection was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
GeofenceCount
— (Integer
)The number of geofences in the geofence collection.
-
(AWS.Response)
—
Returns:
describeKey(params = {}, callback) ⇒ AWS.Request
Retrieves the API key resource details.
Service Reference:
Examples:
Calling the describeKey operation
var params = { KeyName: 'STRING_VALUE' /* required */ }; location.describeKey(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
KeyName
— (String
)The name of the API key resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Key
— (String
)The key value/string of an API key.
KeyArn
— (String
)The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:key/ExampleKey
-
KeyName
— (String
)The name of the API key resource.
Restrictions
— (map
)API Restrictions on the allowed actions, resources, and referers for an API key resource.
AllowActions
— required — (Array<String>
)A list of allowed actions that an API key resource grants permissions to perform. You must have at least one action for each type of resource. For example, if you have a place resource, you must include at least one place action.
The following are valid values for the actions.
-
Map actions
-
geo:GetMap*
- Allows all actions needed for map rendering.
-
-
Place actions
-
geo:SearchPlaceIndexForText
- Allows geocoding. -
geo:SearchPlaceIndexForPosition
- Allows reverse geocoding. -
geo:SearchPlaceIndexForSuggestions
- Allows generating suggestions from text. -
GetPlace
- Allows finding a place by place ID.
-
-
Route actions
-
geo:CalculateRoute
- Allows point to point routing. -
geo:CalculateRouteMatrix
- Allows calculating a matrix of routes.
-
Note: You must use these strings exactly. For example, to provide access to map rendering, the only valid action isgeo:GetMap*
as an input to the list.["geo:GetMap*"]
is valid but["geo:GetMapTile"]
is not. Similarly, you cannot use["geo:SearchPlaceIndexFor*"]
- you must list each of the Place actions separately.-
AllowResources
— required — (Array<String>
)A list of allowed resource ARNs that a API key bearer can perform actions on.
-
The ARN must be the correct ARN for a map, place, or route ARN. You may include wildcards in the resource-id to match multiple resources of the same type.
-
The resources must be in the same
partition
,region
, andaccount-id
as the key that is being created. -
Other than wildcards, you must include the full ARN, including the
arn
,partition
,service
,region
,account-id
andresource-id
delimited by colons (:). -
No spaces allowed, even with wildcards. For example,
arn:aws:geo:region:account-id:map/ExampleMap*
.
For more information about ARN format, see Amazon Resource Names (ARNs).
-
AllowReferers
— (Array<String>
)An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.
Requirements:
-
Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list
$-._+!*(),;/?:@=&
-
May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.
-
May contain wildcard characters question mark (?) and asterisk ().
Question mark (?) will replace any single character (including hexadecimal digits).
Asterisk () will replace any multiple characters (including multiple hexadecimal digits).
-
No spaces allowed. For example,
https://example.com
.
-
CreateTime
— (Date
)The timestamp for when the API key resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.ExpireTime
— (Date
)The timestamp for when the API key resource will expire in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.UpdateTime
— (Date
)The timestamp for when the API key resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.Description
— (String
)The optional description for the API key resource.
Tags
— (map<String>
)Tags associated with the API key resource.
-
(AWS.Response)
—
Returns:
describeMap(params = {}, callback) ⇒ AWS.Request
Retrieves the map resource details.
Service Reference:
Examples:
Calling the describeMap operation
var params = { MapName: 'STRING_VALUE' /* required */ }; location.describeMap(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MapName
— (String
)The name of the map resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:MapName
— (String
)The map style selected from an available provider.
MapArn
— (String
)The Amazon Resource Name (ARN) for the map resource. Used to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:map/ExampleMap
-
PricingPlan
— (String
)No longer used. Always returns
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
DataSource
— (String
)Specifies the data provider for the associated map tiles.
Configuration
— (map
)Specifies the map tile style selected from a partner data provider.
Style
— required — (String
)Specifies the map style selected from an available data provider.
Valid Esri map styles:
-
VectorEsriDarkGrayCanvas
– The Esri Dark Gray Canvas map style. A vector basemap with a dark gray, neutral background with minimal colors, labels, and features that's designed to draw attention to your thematic content. -
RasterEsriImagery
– The Esri Imagery map style. A raster basemap that provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. -
VectorEsriLightGrayCanvas
– The Esri Light Gray Canvas map style, which provides a detailed vector basemap with a light gray, neutral background style with minimal colors, labels, and features that's designed to draw attention to your thematic content. -
VectorEsriTopographic
– The Esri Light map style, which provides a detailed vector basemap with a classic Esri map style. -
VectorEsriStreets
– The Esri Street Map style, which provides a detailed vector basemap for the world symbolized with a classic Esri street map style. The vector tile layer is similar in content and style to the World Street Map raster map. -
VectorEsriNavigation
– The Esri Navigation map style, which provides a detailed basemap for the world symbolized with a custom navigation map style that's designed for use during the day in mobile devices.
Valid HERE Technologies map styles:
-
VectorHereContrast
– The HERE Contrast (Berlin) map style is a high contrast detailed base map of the world that blends 3D and 2D rendering.Note: TheVectorHereContrast
style has been renamed fromVectorHereBerlin
.VectorHereBerlin
has been deprecated, but will continue to work in applications that use it. -
VectorHereExplore
– A default HERE map style containing a neutral, global map and its features including roads, buildings, landmarks, and water features. It also now includes a fully designed map of Japan. -
VectorHereExploreTruck
– A global map containing truck restrictions and attributes (e.g. width / height / HAZMAT) symbolized with highlighted segments and icons on top of HERE Explore to support use cases within transport and logistics. -
RasterHereExploreSatellite
– A global map containing high resolution satellite imagery. -
HybridHereExploreSatellite
– A global map displaying the road network, street names, and city labels over satellite imagery. This style will automatically retrieve both raster and vector tiles, and your charges will be based on total tiles retrieved.Note: Hybrid styles use both vector and raster tiles when rendering the map that you see. This means that more tiles are retrieved than when using either vector or raster tiles alone. Your charges will include all tiles retrieved.
Valid GrabMaps map styles:
-
VectorGrabStandardLight
– The Grab Standard Light map style provides a basemap with detailed land use coloring, area names, roads, landmarks, and points of interest covering Southeast Asia. -
VectorGrabStandardDark
– The Grab Standard Dark map style provides a dark variation of the standard basemap covering Southeast Asia.
Note: Grab provides maps only for countries in Southeast Asia, and is only available in the Asia Pacific (Singapore) Region (ap-southeast-1
). For more information, see GrabMaps countries and area covered.Valid Open Data map styles:
-
VectorOpenDataStandardLight
– The Open Data Standard Light map style provides a detailed basemap for the world suitable for website and mobile application use. The map includes highways major roads, minor roads, railways, water features, cities, parks, landmarks, building footprints, and administrative boundaries. -
VectorOpenDataStandardDark
– Open Data Standard Dark is a dark-themed map style that provides a detailed basemap for the world suitable for website and mobile application use. The map includes highways major roads, minor roads, railways, water features, cities, parks, landmarks, building footprints, and administrative boundaries. -
VectorOpenDataVisualizationLight
– The Open Data Visualization Light map style is a light-themed style with muted colors and fewer features that aids in understanding overlaid data. -
VectorOpenDataVisualizationDark
– The Open Data Visualization Dark map style is a dark-themed style with muted colors and fewer features that aids in understanding overlaid data.
-
PoliticalView
— (String
)Specifies the political view for the style. Leave unset to not use a political view, or, for styles that support specific political views, you can choose a view, such as
IND
for the Indian view.Default is unset.
Note: Not all map resources or styles support political view styles. See Political views for more information.CustomLayers
— (Array<String>
)Specifies the custom layers for the style. Leave unset to not enable any custom layer, or, for styles that support custom layers, you can enable layer(s), such as POI layer for the VectorEsriNavigation style. Default is
unset
.Note: Not all map resources or styles support custom layers. See Custom Layers for more information.
Description
— (String
)The optional description for the map resource.
Tags
— (map<String>
)Tags associated with the map resource.
CreateTime
— (Date
)The timestamp for when the map resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.UpdateTime
— (Date
)The timestamp for when the map resource was last update in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
-
(AWS.Response)
—
Returns:
describePlaceIndex(params = {}, callback) ⇒ AWS.Request
Retrieves the place index resource details.
Service Reference:
Examples:
Calling the describePlaceIndex operation
var params = { IndexName: 'STRING_VALUE' /* required */ }; location.describePlaceIndex(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
IndexName
— (String
)The name of the place index resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:IndexName
— (String
)The name of the place index resource being described.
IndexArn
— (String
)The Amazon Resource Name (ARN) for the place index resource. Used to specify a resource across Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:place-index/ExamplePlaceIndex
-
PricingPlan
— (String
)No longer used. Always returns
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
Description
— (String
)The optional description for the place index resource.
CreateTime
— (Date
)The timestamp for when the place index resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.UpdateTime
— (Date
)The timestamp for when the place index resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.DataSource
— (String
)The data provider of geospatial data. Values can be one of the following:
-
Esri
-
Grab
-
Here
For more information about data providers, see Amazon Location Service data providers.
-
DataSourceConfiguration
— (map
)The specified data storage option for requesting Places.
IntendedUse
— (String
)Specifies how the results of an operation will be stored by the caller.
Valid values include:
-
SingleUse
specifies that the results won't be stored. -
Storage
specifies that the result can be cached or stored in a database.
Default value:
Possible values include:SingleUse
"SingleUse"
"Storage"
-
Tags
— (map<String>
)Tags associated with place index resource.
-
(AWS.Response)
—
Returns:
describeRouteCalculator(params = {}, callback) ⇒ AWS.Request
Retrieves the route calculator resource details.
Service Reference:
Examples:
Calling the describeRouteCalculator operation
var params = { CalculatorName: 'STRING_VALUE' /* required */ }; location.describeRouteCalculator(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CalculatorName
— (String
)The name of the route calculator resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CalculatorName
— (String
)The name of the route calculator resource being described.
CalculatorArn
— (String
)The Amazon Resource Name (ARN) for the Route calculator resource. Use the ARN when you specify a resource across Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:route-calculator/ExampleCalculator
-
PricingPlan
— (String
)Always returns
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
Description
— (String
)The optional description of the route calculator resource.
CreateTime
— (Date
)The timestamp when the route calculator resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.-
For example,
2020–07-2T12:15:20.000Z+01:00
-
UpdateTime
— (Date
)The timestamp when the route calculator resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.-
For example,
2020–07-2T12:15:20.000Z+01:00
-
DataSource
— (String
)The data provider of traffic and road network data. Indicates one of the available providers:
-
Esri
-
Grab
-
Here
For more information about data providers, see Amazon Location Service data providers.
-
Tags
— (map<String>
)Tags associated with route calculator resource.
-
(AWS.Response)
—
Returns:
describeTracker(params = {}, callback) ⇒ AWS.Request
Retrieves the tracker resource details.
Service Reference:
Examples:
Calling the describeTracker operation
var params = { TrackerName: 'STRING_VALUE' /* required */ }; location.describeTracker(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The name of the tracker resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:TrackerName
— (String
)The name of the tracker resource.
TrackerArn
— (String
)The Amazon Resource Name (ARN) for the tracker resource. Used when you need to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:tracker/ExampleTracker
-
Description
— (String
)The optional description for the tracker resource.
PricingPlan
— (String
)Always returns
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
PricingPlanDataSource
— (String
)No longer used. Always returns an empty string.
Tags
— (map<String>
)The tags associated with the tracker resource.
CreateTime
— (Date
)The timestamp for when the tracker resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.UpdateTime
— (Date
)The timestamp for when the tracker resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.KmsKeyId
— (String
)A key identifier for an Amazon Web Services KMS customer managed key assigned to the Amazon Location resource.
PositionFiltering
— (String
)The position filtering method of the tracker resource.
Possible values include:"TimeBased"
"DistanceBased"
"AccuracyBased"
EventBridgeEnabled
— (Boolean
)Whether
UPDATE
events from this tracker in EventBridge are enabled. If set totrue
these events will be sent to EventBridge.KmsKeyEnableGeospatialQueries
— (Boolean
)Enables
GeospatialQueries
for a tracker that uses a Amazon Web Services KMS customer managed key.This parameter is only used if you are using a KMS customer managed key.
Note: If you wish to encrypt your data using your own KMS customer managed key, then the Bounding Polygon Queries feature will be disabled by default. This is because by using this feature, a representation of your device positions will not be encrypted using the your KMS managed key. The exact device position, however; is still encrypted using your managed key. You can choose to opt-in to the Bounding Polygon Quseries feature. This is done by setting theKmsKeyEnableGeospatialQueries
parameter to true when creating or updating a Tracker.
-
(AWS.Response)
—
Returns:
disassociateTrackerConsumer(params = {}, callback) ⇒ AWS.Request
Removes the association between a tracker resource and a geofence collection.
Note: Once you unlink a tracker resource from a geofence collection, the tracker positions will no longer be automatically evaluated against geofences.Service Reference:
Examples:
Calling the disassociateTrackerConsumer operation
var params = { ConsumerArn: 'STRING_VALUE', /* required */ TrackerName: 'STRING_VALUE' /* required */ }; location.disassociateTrackerConsumer(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The name of the tracker resource to be dissociated from the consumer.
ConsumerArn
— (String
)The Amazon Resource Name (ARN) for the geofence collection to be disassociated from the tracker resource. Used when you need to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollectionConsumer
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
forecastGeofenceEvents(params = {}, callback) ⇒ AWS.Request
Evaluates device positions against geofence geometries from a given geofence collection. The event forecasts three states for which a device can be in relative to a geofence:
ENTER
: If a device is outside of a geofence, but would breach the fence if the device is moving at its current speed within time horizon window.EXIT
: If a device is inside of a geofence, but would breach the fence if the device is moving at its current speed within time horizon window.IDLE
: If a device is inside of a geofence, and the device is not moving.Service Reference:
Examples:
Calling the forecastGeofenceEvents operation
var params = { CollectionName: 'STRING_VALUE', /* required */ DeviceState: { /* required */ Position: [ /* required */ 'NUMBER_VALUE', /* more items */ ], Speed: 'NUMBER_VALUE' }, DistanceUnit: Kilometers | Miles, MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE', SpeedUnit: KilometersPerHour | MilesPerHour, TimeHorizonMinutes: 'NUMBER_VALUE' }; location.forecastGeofenceEvents(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)The name of the geofence collection.
DeviceState
— (map
)The device's state, including current position and speed.
Position
— required — (Array<Float>
)The device's position.
Speed
— (Float
)The device's speed.
TimeHorizonMinutes
— (Float
)Specifies the time horizon in minutes for the forecasted events.
DistanceUnit
— (String
)The distance unit used for the
NearestDistance
property returned in a forecasted event. The measurement system must match forDistanceUnit
andSpeedUnit
; ifKilometers
is specified forDistanceUnit
, thenSpeedUnit
must beKilometersPerHour
.Default Value:
Possible values include:Kilometers
"Kilometers"
"Miles"
SpeedUnit
— (String
)The speed unit for the device captured by the device state. The measurement system must match for
DistanceUnit
andSpeedUnit
; ifKilometers
is specified forDistanceUnit
, thenSpeedUnit
must beKilometersPerHour
.Default Value:
Possible values include:KilometersPerHour
."KilometersPerHour"
"MilesPerHour"
NextToken
— (String
)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
MaxResults
— (Integer
)An optional limit for the number of resources returned in a single call.
Default value:
20
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ForecastedEvents
— (Array<map>
)The list of forecasted events.
EventId
— required — (String
)The forecasted event identifier.
GeofenceId
— required — (String
)The geofence identifier pertaining to the forecasted event.
IsDeviceInGeofence
— required — (Boolean
)Indicates if the device is located within the geofence.
NearestDistance
— required — (Float
)The closest distance from the device's position to the geofence.
EventType
— required — (String
)The event type, forecasting three states for which a device can be in relative to a geofence:
ENTER
: If a device is outside of a geofence, but would breach the fence if the device is moving at its current speed within time horizon window.EXIT
: If a device is inside of a geofence, but would breach the fence if the device is moving at its current speed within time horizon window.IDLE
: If a device is inside of a geofence, and the device is not moving."ENTER"
"EXIT"
"IDLE"
ForecastedBreachTime
— (Date
)The forecasted time the device will breach the geofence in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
GeofenceProperties
— (map<String>
)The geofence properties.
NextToken
— (String
)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.
DistanceUnit
— (String
)The distance unit for the forecasted events.
Possible values include:"Kilometers"
"Miles"
SpeedUnit
— (String
)The speed unit for the forecasted events.
Possible values include:"KilometersPerHour"
"MilesPerHour"
-
(AWS.Response)
—
Returns:
getDevicePosition(params = {}, callback) ⇒ AWS.Request
Retrieves a device's most recent position according to its sample time.
Note: Device positions are deleted after 30 days.Service Reference:
Examples:
Calling the getDevicePosition operation
var params = { DeviceId: 'STRING_VALUE', /* required */ TrackerName: 'STRING_VALUE' /* required */ }; location.getDevicePosition(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The tracker resource receiving the position update.
DeviceId
— (String
)The device whose position you want to retrieve.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:DeviceId
— (String
)The device whose position you retrieved.
SampleTime
— (Date
)The timestamp at which the device's position was determined. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.ReceivedTime
— (Date
)The timestamp for when the tracker resource received the device position. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.Position
— (Array<Float>
)The last known device position.
Accuracy
— (map
)The accuracy of the device position.
Horizontal
— required — (Float
)Estimated maximum distance, in meters, between the measured position and the true position of a device, along the Earth's surface.
PositionProperties
— (map<String>
)The properties associated with the position.
-
(AWS.Response)
—
Returns:
getDevicePositionHistory(params = {}, callback) ⇒ AWS.Request
Retrieves the device position history from a tracker resource within a specified range of time.
Note: Device positions are deleted after 30 days.Service Reference:
Examples:
Calling the getDevicePositionHistory operation
var params = { DeviceId: 'STRING_VALUE', /* required */ TrackerName: 'STRING_VALUE', /* required */ EndTimeExclusive: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE', StartTimeInclusive: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789 }; location.getDevicePositionHistory(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The tracker resource receiving the request for the device position history.
DeviceId
— (String
)The device whose position history you want to retrieve.
NextToken
— (String
)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
StartTimeInclusive
— (Date
)Specify the start time for the position history in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
. By default, the value will be 24 hours prior to the time that the request is made.Requirement:
-
The time specified for
StartTimeInclusive
must be beforeEndTimeExclusive
.
-
EndTimeExclusive
— (Date
)Specify the end time for the position history in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
. By default, the value will be the time that the request is made.Requirement:
-
The time specified for
EndTimeExclusive
must be after the time forStartTimeInclusive
.
-
MaxResults
— (Integer
)An optional limit for the number of device positions returned in a single call.
Default value:
100
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:DevicePositions
— (Array<map>
)Contains the position history details for the requested device.
DeviceId
— (String
)The device whose position you retrieved.
SampleTime
— required — (Date
)The timestamp at which the device's position was determined. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.ReceivedTime
— required — (Date
)The timestamp for when the tracker resource received the device position in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.Position
— required — (Array<Float>
)The last known device position.
Accuracy
— (map
)The accuracy of the device position.
Horizontal
— required — (Float
)Estimated maximum distance, in meters, between the measured position and the true position of a device, along the Earth's surface.
PositionProperties
— (map<String>
)The properties associated with the position.
NextToken
— (String
)A pagination token indicating there are additional pages available. You can use the token in a following request to fetch the next set of results.
-
(AWS.Response)
—
Returns:
getGeofence(params = {}, callback) ⇒ AWS.Request
Retrieves the geofence details from a geofence collection.
Note: The returned geometry will always match the geometry format used when the geofence was created.Service Reference:
Examples:
Calling the getGeofence operation
var params = { CollectionName: 'STRING_VALUE', /* required */ GeofenceId: 'STRING_VALUE' /* required */ }; location.getGeofence(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)The geofence collection storing the target geofence.
GeofenceId
— (String
)The geofence you're retrieving details for.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:GeofenceId
— (String
)The geofence identifier.
Geometry
— (map
)Contains the geofence geometry details describing a polygon or a circle.
Polygon
— (Array<Array<Array<Float>>>
)A polygon is a list of linear rings which are each made up of a list of vertices.
Each vertex is a 2-dimensional point of the form:
[longitude, latitude]
. This is represented as an array of doubles of length 2 (so[double, double]
).An array of 4 or more vertices, where the first and last vertex are the same (to form a closed boundary), is called a linear ring. The linear ring vertices must be listed in counter-clockwise order around the ring’s interior. The linear ring is represented as an array of vertices, or an array of arrays of doubles (
[[double, double], ...]
).A geofence consists of a single linear ring. To allow for future expansion, the Polygon parameter takes an array of linear rings, which is represented as an array of arrays of arrays of doubles (
[[[double, double], ...], ...]
).A linear ring for use in geofences can consist of between 4 and 1,000 vertices.
Circle
— (map
)A circle on the earth, as defined by a center point and a radius.
Center
— required — (Array<Float>
)A single point geometry, specifying the center of the circle, using WGS 84 coordinates, in the form
[longitude, latitude]
.Radius
— required — (Float
)The radius of the circle in meters. Must be greater than zero and no larger than 100,000 (100 kilometers).
Geobuf
— (Buffer, Typed Array, Blob, String
)Geobuf is a compact binary encoding for geographic data that provides lossless compression of GeoJSON polygons. The Geobuf must be Base64-encoded.
A polygon in Geobuf format can have up to 100,000 vertices.
Status
— (String
)Identifies the state of the geofence. A geofence will hold one of the following states:
-
ACTIVE
— The geofence has been indexed by the system. -
PENDING
— The geofence is being processed by the system. -
FAILED
— The geofence failed to be indexed by the system. -
DELETED
— The geofence has been deleted from the system index. -
DELETING
— The geofence is being deleted from the system index.
-
CreateTime
— (Date
)The timestamp for when the geofence collection was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
UpdateTime
— (Date
)The timestamp for when the geofence collection was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
GeofenceProperties
— (map<String>
)User defined properties of the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.
Format:
"key" : "value"
-
(AWS.Response)
—
Returns:
getMapGlyphs(params = {}, callback) ⇒ AWS.Request
Retrieves glyphs used to display labels on a map.
Service Reference:
Examples:
Calling the getMapGlyphs operation
var params = { FontStack: 'STRING_VALUE', /* required */ FontUnicodeRange: 'STRING_VALUE', /* required */ MapName: 'STRING_VALUE', /* required */ Key: 'STRING_VALUE' }; location.getMapGlyphs(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MapName
— (String
)The map resource associated with the glyph file.
FontStack
— (String
)A comma-separated list of fonts to load glyphs from in order of preference. For example,
Noto Sans Regular, Arial Unicode
.Valid font stacks for Esri styles:
-
VectorEsriDarkGrayCanvas –
Ubuntu Medium Italic
|Ubuntu Medium
|Ubuntu Italic
|Ubuntu Regular
|Ubuntu Bold
-
VectorEsriLightGrayCanvas –
Ubuntu Italic
|Ubuntu Regular
|Ubuntu Light
|Ubuntu Bold
-
VectorEsriTopographic –
Noto Sans Italic
|Noto Sans Regular
|Noto Sans Bold
|Noto Serif Regular
|Roboto Condensed Light Italic
-
VectorEsriStreets –
Arial Regular
|Arial Italic
|Arial Bold
-
VectorEsriNavigation –
Arial Regular
|Arial Italic
|Arial Bold
Valid font stacks for HERE Technologies styles:
-
VectorHereContrast –
Fira GO Regular
|Fira GO Bold
-
VectorHereExplore, VectorHereExploreTruck, HybridHereExploreSatellite –
Fira GO Italic
|Fira GO Map
|Fira GO Map Bold
|Noto Sans CJK JP Bold
|Noto Sans CJK JP Light
|Noto Sans CJK JP Regular
Valid font stacks for GrabMaps styles:
-
VectorGrabStandardLight, VectorGrabStandardDark –
Noto Sans Regular
|Noto Sans Medium
|Noto Sans Bold
Valid font stacks for Open Data styles:
-
VectorOpenDataStandardLight, VectorOpenDataStandardDark, VectorOpenDataVisualizationLight, VectorOpenDataVisualizationDark –
Amazon Ember Regular,Noto Sans Regular
|Amazon Ember Bold,Noto Sans Bold
|Amazon Ember Medium,Noto Sans Medium
|Amazon Ember Regular Italic,Noto Sans Italic
|Amazon Ember Condensed RC Regular,Noto Sans Regular
|Amazon Ember Condensed RC Bold,Noto Sans Bold
|Amazon Ember Regular,Noto Sans Regular,Noto Sans Arabic Regular
|Amazon Ember Condensed RC Bold,Noto Sans Bold,Noto Sans Arabic Condensed Bold
|Amazon Ember Bold,Noto Sans Bold,Noto Sans Arabic Bold
|Amazon Ember Regular Italic,Noto Sans Italic,Noto Sans Arabic Regular
|Amazon Ember Condensed RC Regular,Noto Sans Regular,Noto Sans Arabic Condensed Regular
|Amazon Ember Medium,Noto Sans Medium,Noto Sans Arabic Medium
Note: The fonts used by the Open Data map styles are combined fonts that useAmazon Ember
for most glyphs butNoto Sans
for glyphs unsupported byAmazon Ember
.-
FontUnicodeRange
— (String
)A Unicode range of characters to download glyphs for. Each response will contain 256 characters. For example, 0–255 includes all characters from range
U+0000
to00FF
. Must be aligned to multiples of 256.Key
— (String
)The optional API key to authorize the request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Blob
— (Buffer(Node.js), Typed Array(Browser)
)The glyph, as binary blob.
ContentType
— (String
)The map glyph content type. For example,
application/octet-stream
.CacheControl
— (String
)The HTTP Cache-Control directive for the value.
-
(AWS.Response)
—
Returns:
getMapSprites(params = {}, callback) ⇒ AWS.Request
Retrieves the sprite sheet corresponding to a map resource. The sprite sheet is a PNG image paired with a JSON document describing the offsets of individual icons that will be displayed on a rendered map.
Service Reference:
Examples:
Calling the getMapSprites operation
var params = { FileName: 'STRING_VALUE', /* required */ MapName: 'STRING_VALUE', /* required */ Key: 'STRING_VALUE' }; location.getMapSprites(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MapName
— (String
)The map resource associated with the sprite file.
FileName
— (String
)The name of the sprite file. Use the following file names for the sprite sheet:
-
sprites.png
-
sprites@2x.png
for high pixel density displays
For the JSON document containing image offsets. Use the following file names:
-
sprites.json
-
sprites@2x.json
for high pixel density displays
-
Key
— (String
)The optional API key to authorize the request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Blob
— (Buffer(Node.js), Typed Array(Browser)
)Contains the body of the sprite sheet or JSON offset file.
ContentType
— (String
)The content type of the sprite sheet and offsets. For example, the sprite sheet content type is
image/png
, and the sprite offset JSON document isapplication/json
.CacheControl
— (String
)The HTTP Cache-Control directive for the value.
-
(AWS.Response)
—
Returns:
getMapStyleDescriptor(params = {}, callback) ⇒ AWS.Request
Retrieves the map style descriptor from a map resource.
The style descriptor contains specifications on how features render on a map. For example, what data to display, what order to display the data in, and the style for the data. Style descriptors follow the Mapbox Style Specification.
Service Reference:
Examples:
Calling the getMapStyleDescriptor operation
var params = { MapName: 'STRING_VALUE', /* required */ Key: 'STRING_VALUE' }; location.getMapStyleDescriptor(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MapName
— (String
)The map resource to retrieve the style descriptor from.
Key
— (String
)The optional API key to authorize the request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Blob
— (Buffer(Node.js), Typed Array(Browser)
)Contains the body of the style descriptor.
ContentType
— (String
)The style descriptor's content type. For example,
application/json
.CacheControl
— (String
)The HTTP Cache-Control directive for the value.
-
(AWS.Response)
—
Returns:
getMapTile(params = {}, callback) ⇒ AWS.Request
Retrieves a vector data tile from the map resource. Map tiles are used by clients to render a map. they're addressed using a grid arrangement with an X coordinate, Y coordinate, and Z (zoom) level.
The origin (0, 0) is the top left of the map. Increasing the zoom level by 1 doubles both the X and Y dimensions, so a tile containing data for the entire world at (0/0/0) will be split into 4 tiles at zoom 1 (1/0/0, 1/0/1, 1/1/0, 1/1/1).
Service Reference:
Examples:
Calling the getMapTile operation
var params = { MapName: 'STRING_VALUE', /* required */ X: 'STRING_VALUE', /* required */ Y: 'STRING_VALUE', /* required */ Z: 'STRING_VALUE', /* required */ Key: 'STRING_VALUE' }; location.getMapTile(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MapName
— (String
)The map resource to retrieve the map tiles from.
Z
— (String
)The zoom value for the map tile.
X
— (String
)The X axis value for the map tile.
Y
— (String
)The Y axis value for the map tile.
Key
— (String
)The optional API key to authorize the request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Blob
— (Buffer(Node.js), Typed Array(Browser)
)Contains Mapbox Vector Tile (MVT) data.
ContentType
— (String
)The map tile's content type. For example,
application/vnd.mapbox-vector-tile
.CacheControl
— (String
)The HTTP Cache-Control directive for the value.
-
(AWS.Response)
—
Returns:
getPlace(params = {}, callback) ⇒ AWS.Request
Finds a place by its unique ID. A
PlaceId
is returned by other search operations.Note: A PlaceId is valid only if all of the following are the same in the original search request and the call toGetPlace
.- Customer Amazon Web Services account
- Amazon Web Services Region
- Data provider specified in the place index resource
Service Reference:
Examples:
Calling the getPlace operation
var params = { IndexName: 'STRING_VALUE', /* required */ PlaceId: 'STRING_VALUE', /* required */ Key: 'STRING_VALUE', Language: 'STRING_VALUE' }; location.getPlace(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
IndexName
— (String
)The name of the place index resource that you want to use for the search.
PlaceId
— (String
)The identifier of the place to find.
Language
— (String
)The preferred language used to return results. The value must be a valid BCP 47 language tag, for example,
en
for English.This setting affects the languages used in the results, but not the results themselves. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.
For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the
language
parameter set toen
. Thecity
in the results will most likely be returned asAthens
.If you set the
language
parameter toel
, for Greek, then thecity
in the results will more likely be returned asΑθήνα
.If the data provider does not have a value for Greek, the result will be in a language that the provider does support.
Key
— (String
)The optional API key to authorize the request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Place
— (map
)Details about the result, such as its address and position.
Label
— (String
)The full name and address of the point of interest such as a city, region, or country. For example,
123 Any Street, Any Town, USA
.Geometry
— required — (map
)Places uses a point geometry to specify a location or a Place.
Point
— (Array<Float>
)A single point geometry specifies a location for a Place using WGS 84 coordinates:
-
x — Specifies the x coordinate or longitude.
-
y — Specifies the y coordinate or latitude.
-
AddressNumber
— (String
)The numerical portion of an address, such as a building number.
Street
— (String
)The name for a street or a road to identify a location. For example,
Main Street
.Neighborhood
— (String
)The name of a community district. For example,
Downtown
.Municipality
— (String
)A name for a local area, such as a city or town name. For example,
Toronto
.SubRegion
— (String
)A county, or an area that's part of a larger region. For example,
Metro Vancouver
.Region
— (String
)A name for an area or geographical division, such as a province or state name. For example,
British Columbia
.Country
— (String
)A country/region specified using ISO 3166 3-digit country/region code. For example,
CAN
.PostalCode
— (String
)A group of numbers and letters in a country-specific format, which accompanies the address for the purpose of identifying a location.
Interpolated
— (Boolean
)True
if the result is interpolated from other known places.False
if the Place is a known place.Not returned when the partner does not provide the information.
For example, returns
False
for an address location that is found in the partner data, but returnsTrue
if an address does not exist in the partner data and its location is calculated by interpolating between other known addresses.TimeZone
— (map
)The time zone in which the
Place
is located. Returned only when using HERE or Grab as the selected partner.Name
— required — (String
)The name of the time zone, following the IANA time zone standard. For example,
America/Los_Angeles
.Offset
— (Integer
)The time zone's offset, in seconds, from UTC.
UnitType
— (String
)For addresses with a
UnitNumber
, the type of unit. For example,Apartment
.Note: Returned only for a place index that uses Esri as a data provider.UnitNumber
— (String
)For addresses with multiple units, the unit identifier. Can include numbers and letters, for example
3B
orUnit 123
.Note: Returned only for a place index that uses Esri or Grab as a data provider. Is not returned forSearchPlaceIndexForPosition
.Categories
— (Array<String>
)The Amazon Location categories that describe this Place.
For more information about using categories, including a list of Amazon Location categories, see Categories and filtering, in the Amazon Location Service Developer Guide.
SupplementalCategories
— (Array<String>
)Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories.
SubMunicipality
— (String
)An area that's part of a larger municipality. For example,
Blissville
is a submunicipality in the Queen County in New York.Note: This property supported by Esri and OpenData. The Esri property isdistrict
, and the OpenData property isborough
.
-
(AWS.Response)
—
Returns:
listDevicePositions(params = {}, callback) ⇒ AWS.Request
A batch request to retrieve all device positions.
Service Reference:
Examples:
Calling the listDevicePositions operation
var params = { TrackerName: 'STRING_VALUE', /* required */ FilterGeometry: { Polygon: [ [ [ 'NUMBER_VALUE', /* more items */ ], /* more items */ ], /* more items */ ] }, MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE' }; location.listDevicePositions(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The tracker resource containing the requested devices.
MaxResults
— (Integer
)An optional limit for the number of entries returned in a single call.
Default value:
100
NextToken
— (String
)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
FilterGeometry
— (map
)The geometry used to filter device positions.
Polygon
— (Array<Array<Array<Float>>>
)The set of arrays which define the polygon. A polygon can have between 4 and 1000 vertices.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Entries
— (Array<map>
)Contains details about each device's last known position.
DeviceId
— required — (String
)The ID of the device for this position.
SampleTime
— required — (Date
)The timestamp at which the device position was determined. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.Position
— required — (Array<Float>
)The last known device position. Empty if no positions currently stored.
Accuracy
— (map
)The accuracy of the device position.
Horizontal
— required — (Float
)Estimated maximum distance, in meters, between the measured position and the true position of a device, along the Earth's surface.
PositionProperties
— (map<String>
)The properties associated with the position.
NextToken
— (String
)A pagination token indicating there are additional pages available. You can use the token in a following request to fetch the next set of results.
-
(AWS.Response)
—
Returns:
listGeofenceCollections(params = {}, callback) ⇒ AWS.Request
Lists geofence collections in your Amazon Web Services account.
Service Reference:
Examples:
Calling the listGeofenceCollections operation
var params = { MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE' }; location.listGeofenceCollections(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MaxResults
— (Integer
)An optional limit for the number of resources returned in a single call.
Default value:
100
NextToken
— (String
)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
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Entries
— (Array<map>
)Lists the geofence collections that exist in your Amazon Web Services account.
CollectionName
— required — (String
)The name of the geofence collection.
Description
— required — (String
)The description for the geofence collection
PricingPlan
— (String
)No longer used. Always returns
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
PricingPlanDataSource
— (String
)No longer used. Always returns an empty string.
CreateTime
— required — (Date
)The timestamp for when the geofence collection was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
UpdateTime
— required — (Date
)Specifies a timestamp for when the resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
NextToken
— (String
)A pagination token indicating there are additional pages available. You can use the token in a following request to fetch the next set of results.
-
(AWS.Response)
—
Returns:
listGeofences(params = {}, callback) ⇒ AWS.Request
Lists geofences stored in a given geofence collection.
Service Reference:
Examples:
Calling the listGeofences operation
var params = { CollectionName: 'STRING_VALUE', /* required */ MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE' }; location.listGeofences(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)The name of the geofence collection storing the list of geofences.
NextToken
— (String
)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
MaxResults
— (Integer
)An optional limit for the number of geofences returned in a single call.
Default value:
100
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Entries
— (Array<map>
)Contains a list of geofences stored in the geofence collection.
GeofenceId
— required — (String
)The geofence identifier.
Geometry
— required — (map
)Contains the geofence geometry details describing a polygon or a circle.
Polygon
— (Array<Array<Array<Float>>>
)A polygon is a list of linear rings which are each made up of a list of vertices.
Each vertex is a 2-dimensional point of the form:
[longitude, latitude]
. This is represented as an array of doubles of length 2 (so[double, double]
).An array of 4 or more vertices, where the first and last vertex are the same (to form a closed boundary), is called a linear ring. The linear ring vertices must be listed in counter-clockwise order around the ring’s interior. The linear ring is represented as an array of vertices, or an array of arrays of doubles (
[[double, double], ...]
).A geofence consists of a single linear ring. To allow for future expansion, the Polygon parameter takes an array of linear rings, which is represented as an array of arrays of arrays of doubles (
[[[double, double], ...], ...]
).A linear ring for use in geofences can consist of between 4 and 1,000 vertices.
Circle
— (map
)A circle on the earth, as defined by a center point and a radius.
Center
— required — (Array<Float>
)A single point geometry, specifying the center of the circle, using WGS 84 coordinates, in the form
[longitude, latitude]
.Radius
— required — (Float
)The radius of the circle in meters. Must be greater than zero and no larger than 100,000 (100 kilometers).
Geobuf
— (Buffer, Typed Array, Blob, String
)Geobuf is a compact binary encoding for geographic data that provides lossless compression of GeoJSON polygons. The Geobuf must be Base64-encoded.
A polygon in Geobuf format can have up to 100,000 vertices.
Status
— required — (String
)Identifies the state of the geofence. A geofence will hold one of the following states:
-
ACTIVE
— The geofence has been indexed by the system. -
PENDING
— The geofence is being processed by the system. -
FAILED
— The geofence failed to be indexed by the system. -
DELETED
— The geofence has been deleted from the system index. -
DELETING
— The geofence is being deleted from the system index.
-
CreateTime
— required — (Date
)The timestamp for when the geofence was stored in a geofence collection in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
UpdateTime
— required — (Date
)The timestamp for when the geofence was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
GeofenceProperties
— (map<String>
)User defined properties of the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.
Format:
"key" : "value"
NextToken
— (String
)A pagination token indicating there are additional pages available. You can use the token in a following request to fetch the next set of results.
-
(AWS.Response)
—
Returns:
listKeys(params = {}, callback) ⇒ AWS.Request
Lists API key resources in your Amazon Web Services account.
Service Reference:
Examples:
Calling the listKeys operation
var params = { Filter: { KeyStatus: Active | Expired }, MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE' }; location.listKeys(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MaxResults
— (Integer
)An optional limit for the number of resources returned in a single call.
Default value:
100
NextToken
— (String
)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
Filter
— (map
)Optionally filter the list to only
Active
orExpired
API keys.KeyStatus
— (String
)Filter on
Possible values include:Active
orExpired
API keys."Active"
"Expired"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Entries
— (Array<map>
)Contains API key resources in your Amazon Web Services account. Details include API key name, allowed referers and timestamp for when the API key will expire.
KeyName
— required — (String
)The name of the API key resource.
ExpireTime
— required — (Date
)The timestamp for when the API key resource will expire, in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.Description
— (String
)The optional description for the API key resource.
Restrictions
— required — (map
)API Restrictions on the allowed actions, resources, and referers for an API key resource.
AllowActions
— required — (Array<String>
)A list of allowed actions that an API key resource grants permissions to perform. You must have at least one action for each type of resource. For example, if you have a place resource, you must include at least one place action.
The following are valid values for the actions.
-
Map actions
-
geo:GetMap*
- Allows all actions needed for map rendering.
-
-
Place actions
-
geo:SearchPlaceIndexForText
- Allows geocoding. -
geo:SearchPlaceIndexForPosition
- Allows reverse geocoding. -
geo:SearchPlaceIndexForSuggestions
- Allows generating suggestions from text. -
GetPlace
- Allows finding a place by place ID.
-
-
Route actions
-
geo:CalculateRoute
- Allows point to point routing. -
geo:CalculateRouteMatrix
- Allows calculating a matrix of routes.
-
Note: You must use these strings exactly. For example, to provide access to map rendering, the only valid action isgeo:GetMap*
as an input to the list.["geo:GetMap*"]
is valid but["geo:GetMapTile"]
is not. Similarly, you cannot use["geo:SearchPlaceIndexFor*"]
- you must list each of the Place actions separately.-
AllowResources
— required — (Array<String>
)A list of allowed resource ARNs that a API key bearer can perform actions on.
-
The ARN must be the correct ARN for a map, place, or route ARN. You may include wildcards in the resource-id to match multiple resources of the same type.
-
The resources must be in the same
partition
,region
, andaccount-id
as the key that is being created. -
Other than wildcards, you must include the full ARN, including the
arn
,partition
,service
,region
,account-id
andresource-id
delimited by colons (:). -
No spaces allowed, even with wildcards. For example,
arn:aws:geo:region:account-id:map/ExampleMap*
.
For more information about ARN format, see Amazon Resource Names (ARNs).
-
AllowReferers
— (Array<String>
)An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.
Requirements:
-
Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list
$-._+!*(),;/?:@=&
-
May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.
-
May contain wildcard characters question mark (?) and asterisk ().
Question mark (?) will replace any single character (including hexadecimal digits).
Asterisk () will replace any multiple characters (including multiple hexadecimal digits).
-
No spaces allowed. For example,
https://example.com
.
-
CreateTime
— required — (Date
)The timestamp of when the API key was created, in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.UpdateTime
— required — (Date
)The timestamp of when the API key was last updated, in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
NextToken
— (String
)A pagination token indicating there are additional pages available. You can use the token in a following request to fetch the next set of results.
-
(AWS.Response)
—
Returns:
listMaps(params = {}, callback) ⇒ AWS.Request
Lists map resources in your Amazon Web Services account.
Service Reference:
Examples:
Calling the listMaps operation
var params = { MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE' }; location.listMaps(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MaxResults
— (Integer
)An optional limit for the number of resources returned in a single call.
Default value:
100
NextToken
— (String
)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
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Entries
— (Array<map>
)Contains a list of maps in your Amazon Web Services account
MapName
— required — (String
)The name of the associated map resource.
Description
— required — (String
)The description for the map resource.
DataSource
— required — (String
)Specifies the data provider for the associated map tiles.
PricingPlan
— (String
)No longer used. Always returns
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
CreateTime
— required — (Date
)The timestamp for when the map resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.UpdateTime
— required — (Date
)The timestamp for when the map resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
NextToken
— (String
)A pagination token indicating there are additional pages available. You can use the token in a following request to fetch the next set of results.
-
(AWS.Response)
—
Returns:
listPlaceIndexes(params = {}, callback) ⇒ AWS.Request
Lists place index resources in your Amazon Web Services account.
Service Reference:
Examples:
Calling the listPlaceIndexes operation
var params = { MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE' }; location.listPlaceIndexes(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MaxResults
— (Integer
)An optional limit for the maximum number of results returned in a single call.
Default value:
100
NextToken
— (String
)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
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Entries
— (Array<map>
)Lists the place index resources that exist in your Amazon Web Services account
IndexName
— required — (String
)The name of the place index resource.
Description
— required — (String
)The optional description for the place index resource.
DataSource
— required — (String
)The data provider of geospatial data. Values can be one of the following:
-
Esri
-
Grab
-
Here
For more information about data providers, see Amazon Location Service data providers.
-
PricingPlan
— (String
)No longer used. Always returns
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
CreateTime
— required — (Date
)The timestamp for when the place index resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.UpdateTime
— required — (Date
)The timestamp for when the place index resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
NextToken
— (String
)A pagination token indicating that there are additional pages available. You can use the token in a new request to fetch the next page of results.
-
(AWS.Response)
—
Returns:
listRouteCalculators(params = {}, callback) ⇒ AWS.Request
Lists route calculator resources in your Amazon Web Services account.
Service Reference:
Examples:
Calling the listRouteCalculators operation
var params = { MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE' }; location.listRouteCalculators(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MaxResults
— (Integer
)An optional maximum number of results returned in a single call.
Default Value:
100
NextToken
— (String
)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
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Entries
— (Array<map>
)Lists the route calculator resources that exist in your Amazon Web Services account
CalculatorName
— required — (String
)The name of the route calculator resource.
Description
— required — (String
)The optional description of the route calculator resource.
DataSource
— required — (String
)The data provider of traffic and road network data. Indicates one of the available providers:
-
Esri
-
Grab
-
Here
For more information about data providers, see Amazon Location Service data providers.
-
PricingPlan
— (String
)Always returns
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
CreateTime
— required — (Date
)The timestamp when the route calculator resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.-
For example,
2020–07-2T12:15:20.000Z+01:00
-
UpdateTime
— required — (Date
)The timestamp when the route calculator resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.-
For example,
2020–07-2T12:15:20.000Z+01:00
-
NextToken
— (String
)A pagination token indicating there are additional pages available. You can use the token in a subsequent request to fetch the next set of results.
-
(AWS.Response)
—
Returns:
listTagsForResource(params = {}, callback) ⇒ AWS.Request
Returns a list of tags that are applied to the specified Amazon Location resource.
Service Reference:
Examples:
Calling the listTagsForResource operation
var params = { ResourceArn: 'STRING_VALUE' /* required */ }; location.listTagsForResource(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
ResourceArn
— (String
)The Amazon Resource Name (ARN) of the resource whose tags you want to retrieve.
-
Format example:
arn:aws:geo:region:account-id:resourcetype/ExampleResource
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Tags
— (map<String>
)Tags that have been applied to the specified resource. Tags are mapped from the tag key to the tag value:
"TagKey" : "TagValue"
.-
Format example:
{"tag1" : "value1", "tag2" : "value2"}
-
-
(AWS.Response)
—
Returns:
listTrackerConsumers(params = {}, callback) ⇒ AWS.Request
Lists geofence collections currently associated to the given tracker resource.
Service Reference:
Examples:
Calling the listTrackerConsumers operation
var params = { TrackerName: 'STRING_VALUE', /* required */ MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE' }; location.listTrackerConsumers(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The tracker resource whose associated geofence collections you want to list.
MaxResults
— (Integer
)An optional limit for the number of resources returned in a single call.
Default value:
100
NextToken
— (String
)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
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ConsumerArns
— (Array<String>
)Contains the list of geofence collection ARNs associated to the tracker resource.
NextToken
— (String
)A pagination token indicating there are additional pages available. You can use the token in a following request to fetch the next set of results.
-
(AWS.Response)
—
Returns:
listTrackers(params = {}, callback) ⇒ AWS.Request
Lists tracker resources in your Amazon Web Services account.
Service Reference:
Examples:
Calling the listTrackers operation
var params = { MaxResults: 'NUMBER_VALUE', NextToken: 'STRING_VALUE' }; location.listTrackers(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MaxResults
— (Integer
)An optional limit for the number of resources returned in a single call.
Default value:
100
NextToken
— (String
)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
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Entries
— (Array<map>
)Contains tracker resources in your Amazon Web Services account. Details include tracker name, description and timestamps for when the tracker was created and last updated.
TrackerName
— required — (String
)The name of the tracker resource.
Description
— required — (String
)The description for the tracker resource.
PricingPlan
— (String
)Always returns
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
PricingPlanDataSource
— (String
)No longer used. Always returns an empty string.
CreateTime
— required — (Date
)The timestamp for when the tracker resource was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.UpdateTime
— required — (Date
)The timestamp at which the device's position was determined. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
NextToken
— (String
)A pagination token indicating there are additional pages available. You can use the token in a following request to fetch the next set of results.
-
(AWS.Response)
—
Returns:
putGeofence(params = {}, callback) ⇒ AWS.Request
Stores a geofence geometry in a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.
Service Reference:
Examples:
Calling the putGeofence operation
var params = { CollectionName: 'STRING_VALUE', /* required */ GeofenceId: 'STRING_VALUE', /* required */ Geometry: { /* required */ Circle: { Center: [ /* required */ 'NUMBER_VALUE', /* more items */ ], Radius: 'NUMBER_VALUE' /* required */ }, Geobuf: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, Polygon: [ [ [ 'NUMBER_VALUE', /* more items */ ], /* more items */ ], /* more items */ ] }, GeofenceProperties: { '<PropertyMapKeyString>': 'STRING_VALUE', /* '<PropertyMapKeyString>': ... */ } }; location.putGeofence(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)The geofence collection to store the geofence in.
GeofenceId
— (String
)An identifier for the geofence. For example,
ExampleGeofence-1
.Geometry
— (map
)Contains the details to specify the position of the geofence. Can be a polygon, a circle or a polygon encoded in Geobuf format. Including multiple selections will return a validation error.
Note: The geofence polygon format supports a maximum of 1,000 vertices. The Geofence Geobuf format supports a maximum of 100,000 vertices.Polygon
— (Array<Array<Array<Float>>>
)A polygon is a list of linear rings which are each made up of a list of vertices.
Each vertex is a 2-dimensional point of the form:
[longitude, latitude]
. This is represented as an array of doubles of length 2 (so[double, double]
).An array of 4 or more vertices, where the first and last vertex are the same (to form a closed boundary), is called a linear ring. The linear ring vertices must be listed in counter-clockwise order around the ring’s interior. The linear ring is represented as an array of vertices, or an array of arrays of doubles (
[[double, double], ...]
).A geofence consists of a single linear ring. To allow for future expansion, the Polygon parameter takes an array of linear rings, which is represented as an array of arrays of arrays of doubles (
[[[double, double], ...], ...]
).A linear ring for use in geofences can consist of between 4 and 1,000 vertices.
Circle
— (map
)A circle on the earth, as defined by a center point and a radius.
Center
— required — (Array<Float>
)A single point geometry, specifying the center of the circle, using WGS 84 coordinates, in the form
[longitude, latitude]
.Radius
— required — (Float
)The radius of the circle in meters. Must be greater than zero and no larger than 100,000 (100 kilometers).
Geobuf
— (Buffer, Typed Array, Blob, String
)Geobuf is a compact binary encoding for geographic data that provides lossless compression of GeoJSON polygons. The Geobuf must be Base64-encoded.
A polygon in Geobuf format can have up to 100,000 vertices.
GeofenceProperties
— (map<String>
)Associates one of more properties with the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.
Format:
"key" : "value"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:GeofenceId
— (String
)The geofence identifier entered in the request.
CreateTime
— (Date
)The timestamp for when the geofence was created in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
UpdateTime
— (Date
)The timestamp for when the geofence was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
-
(AWS.Response)
—
Returns:
searchPlaceIndexForPosition(params = {}, callback) ⇒ AWS.Request
Reverse geocodes a given coordinate and returns a legible address. Allows you to search for Places or points of interest near a given position.
Service Reference:
Examples:
Calling the searchPlaceIndexForPosition operation
var params = { IndexName: 'STRING_VALUE', /* required */ Position: [ /* required */ 'NUMBER_VALUE', /* more items */ ], Key: 'STRING_VALUE', Language: 'STRING_VALUE', MaxResults: 'NUMBER_VALUE' }; location.searchPlaceIndexForPosition(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
IndexName
— (String
)The name of the place index resource you want to use for the search.
Position
— (Array<Float>
)Specifies the longitude and latitude of the position to query.
This parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the second number represents the Y coordinate, or latitude.
For example,
[-123.1174, 49.2847]
represents a position with longitude-123.1174
and latitude49.2847
.MaxResults
— (Integer
)An optional parameter. The maximum number of results returned per request.
Default value:
50
Language
— (String
)The preferred language used to return results. The value must be a valid BCP 47 language tag, for example,
en
for English.This setting affects the languages used in the results, but not the results themselves. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.
For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the
language
parameter set toen
. Thecity
in the results will most likely be returned asAthens
.If you set the
language
parameter toel
, for Greek, then thecity
in the results will more likely be returned asΑθήνα
.If the data provider does not have a value for Greek, the result will be in a language that the provider does support.
Key
— (String
)The optional API key to authorize the request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Summary
— (map
)Contains a summary of the request. Echoes the input values for
Position
,Language
,MaxResults
, and theDataSource
of the place index.Position
— required — (Array<Float>
)The position specified in the request.
MaxResults
— (Integer
)Contains the optional result count limit that is specified in the request.
Default value:
50
DataSource
— required — (String
)The geospatial data provider attached to the place index resource specified in the request. Values can be one of the following:
-
Esri
-
Grab
-
Here
For more information about data providers, see Amazon Location Service data providers.
-
Language
— (String
)The preferred language used to return results. Matches the language in the request. The value is a valid BCP 47 language tag, for example,
en
for English.
Results
— (Array<map>
)Returns a list of Places closest to the specified position. Each result contains additional information about the Places returned.
Place
— required — (map
)Details about the search result, such as its address and position.
Label
— (String
)The full name and address of the point of interest such as a city, region, or country. For example,
123 Any Street, Any Town, USA
.Geometry
— required — (map
)Places uses a point geometry to specify a location or a Place.
Point
— (Array<Float>
)A single point geometry specifies a location for a Place using WGS 84 coordinates:
-
x — Specifies the x coordinate or longitude.
-
y — Specifies the y coordinate or latitude.
-
AddressNumber
— (String
)The numerical portion of an address, such as a building number.
Street
— (String
)The name for a street or a road to identify a location. For example,
Main Street
.Neighborhood
— (String
)The name of a community district. For example,
Downtown
.Municipality
— (String
)A name for a local area, such as a city or town name. For example,
Toronto
.SubRegion
— (String
)A county, or an area that's part of a larger region. For example,
Metro Vancouver
.Region
— (String
)A name for an area or geographical division, such as a province or state name. For example,
British Columbia
.Country
— (String
)A country/region specified using ISO 3166 3-digit country/region code. For example,
CAN
.PostalCode
— (String
)A group of numbers and letters in a country-specific format, which accompanies the address for the purpose of identifying a location.
Interpolated
— (Boolean
)True
if the result is interpolated from other known places.False
if the Place is a known place.Not returned when the partner does not provide the information.
For example, returns
False
for an address location that is found in the partner data, but returnsTrue
if an address does not exist in the partner data and its location is calculated by interpolating between other known addresses.TimeZone
— (map
)The time zone in which the
Place
is located. Returned only when using HERE or Grab as the selected partner.Name
— required — (String
)The name of the time zone, following the IANA time zone standard. For example,
America/Los_Angeles
.Offset
— (Integer
)The time zone's offset, in seconds, from UTC.
UnitType
— (String
)For addresses with a
UnitNumber
, the type of unit. For example,Apartment
.Note: Returned only for a place index that uses Esri as a data provider.UnitNumber
— (String
)For addresses with multiple units, the unit identifier. Can include numbers and letters, for example
3B
orUnit 123
.Note: Returned only for a place index that uses Esri or Grab as a data provider. Is not returned forSearchPlaceIndexForPosition
.Categories
— (Array<String>
)The Amazon Location categories that describe this Place.
For more information about using categories, including a list of Amazon Location categories, see Categories and filtering, in the Amazon Location Service Developer Guide.
SupplementalCategories
— (Array<String>
)Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories.
SubMunicipality
— (String
)An area that's part of a larger municipality. For example,
Blissville
is a submunicipality in the Queen County in New York.Note: This property supported by Esri and OpenData. The Esri property isdistrict
, and the OpenData property isborough
.
Distance
— required — (Float
)The distance in meters of a great-circle arc between the query position and the result.
Note: A great-circle arc is the shortest path on a sphere, in this case the Earth. This returns the shortest distance between two locations.PlaceId
— (String
)The unique identifier of the place. You can use this with the
GetPlace
operation to find the place again later.Note: ForSearchPlaceIndexForPosition
operations, thePlaceId
is returned only by place indexes that use HERE or Grab as a data provider.
-
(AWS.Response)
—
Returns:
searchPlaceIndexForSuggestions(params = {}, callback) ⇒ AWS.Request
Generates suggestions for addresses and points of interest based on partial or misspelled free-form text. This operation is also known as autocomplete, autosuggest, or fuzzy matching.
Optional parameters let you narrow your search results by bounding box or country, or bias your search toward a specific position on the globe.
Note: You can search for suggested place names near a specified position by usingBiasPosition
, or filter results within a bounding box by usingFilterBBox
. These parameters are mutually exclusive; using bothBiasPosition
andFilterBBox
in the same command returns an error.Service Reference:
Examples:
Calling the searchPlaceIndexForSuggestions operation
var params = { IndexName: 'STRING_VALUE', /* required */ Text: 'STRING_VALUE', /* required */ BiasPosition: [ 'NUMBER_VALUE', /* more items */ ], FilterBBox: [ 'NUMBER_VALUE', /* more items */ ], FilterCategories: [ 'STRING_VALUE', /* more items */ ], FilterCountries: [ 'STRING_VALUE', /* more items */ ], Key: 'STRING_VALUE', Language: 'STRING_VALUE', MaxResults: 'NUMBER_VALUE' }; location.searchPlaceIndexForSuggestions(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
IndexName
— (String
)The name of the place index resource you want to use for the search.
Text
— (String
)The free-form partial text to use to generate place suggestions. For example,
eiffel tow
.BiasPosition
— (Array<Float>
)An optional parameter that indicates a preference for place suggestions that are closer to a specified position.
If provided, this parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the second number represents the Y coordinate, or latitude.
For example,
[-123.1174, 49.2847]
represents the position with longitude-123.1174
and latitude49.2847
.Note:BiasPosition
andFilterBBox
are mutually exclusive. Specifying both options results in an error.FilterBBox
— (Array<Float>
)An optional parameter that limits the search results by returning only suggestions within a specified bounding box.
If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the southwest corner of the bounding box; the second pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the northeast corner of the bounding box.
For example,
[-12.7935, -37.4835, -12.0684, -36.9542]
represents a bounding box where the southwest corner has longitude-12.7935
and latitude-37.4835
, and the northeast corner has longitude-12.0684
and latitude-36.9542
.Note:FilterBBox
andBiasPosition
are mutually exclusive. Specifying both options results in an error.FilterCountries
— (Array<String>
)An optional parameter that limits the search results by returning only suggestions within the provided list of countries.
-
Use the ISO 3166 3-digit country code. For example, Australia uses three upper-case characters:
AUS
.
-
MaxResults
— (Integer
)An optional parameter. The maximum number of results returned per request.
The default:
5
Language
— (String
)The preferred language used to return results. The value must be a valid BCP 47 language tag, for example,
en
for English.This setting affects the languages used in the results. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.
For an example, we'll use the Greek language. You search for
Athens, Gr
to get suggestions with thelanguage
parameter set toen
. The results found will most likely be returned asAthens, Greece
.If you set the
language
parameter toel
, for Greek, then the result found will more likely be returned asΑθήνα, Ελλάδα
.If the data provider does not have a value for Greek, the result will be in a language that the provider does support.
FilterCategories
— (Array<String>
)A list of one or more Amazon Location categories to filter the returned places. If you include more than one category, the results will include results that match any of the categories listed.
For more information about using categories, including a list of Amazon Location categories, see Categories and filtering, in the Amazon Location Service Developer Guide.
Key
— (String
)The optional API key to authorize the request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Summary
— (map
)Contains a summary of the request. Echoes the input values for
BiasPosition
,FilterBBox
,FilterCountries
,Language
,MaxResults
, andText
. Also includes theDataSource
of the place index.Text
— required — (String
)The free-form partial text input specified in the request.
BiasPosition
— (Array<Float>
)Contains the coordinates for the optional bias position specified in the request.
This parameter contains a pair of numbers. The first number represents the X coordinate, or longitude; the second number represents the Y coordinate, or latitude.
For example,
[-123.1174, 49.2847]
represents the position with longitude-123.1174
and latitude49.2847
.FilterBBox
— (Array<Float>
)Contains the coordinates for the optional bounding box specified in the request.
FilterCountries
— (Array<String>
)Contains the optional country filter specified in the request.
MaxResults
— (Integer
)Contains the optional result count limit specified in the request.
DataSource
— required — (String
)The geospatial data provider attached to the place index resource specified in the request. Values can be one of the following:
-
Esri
-
Grab
-
Here
For more information about data providers, see Amazon Location Service data providers.
-
Language
— (String
)The preferred language used to return results. Matches the language in the request. The value is a valid BCP 47 language tag, for example,
en
for English.FilterCategories
— (Array<String>
)The optional category filter specified in the request.
Results
— (Array<map>
)A list of place suggestions that best match the search text.
Text
— required — (String
)The text of the place suggestion, typically formatted as an address string.
PlaceId
— (String
)The unique identifier of the Place. You can use this with the
GetPlace
operation to find the place again later, or to get full information for the Place.The
GetPlace
request must use the samePlaceIndex
resource as theSearchPlaceIndexForSuggestions
that generated the Place ID.Note: ForSearchPlaceIndexForSuggestions
operations, thePlaceId
is returned by place indexes that use Esri, Grab, or HERE as data providers.Categories
— (Array<String>
)The Amazon Location categories that describe the Place.
For more information about using categories, including a list of Amazon Location categories, see Categories and filtering, in the Amazon Location Service Developer Guide.
SupplementalCategories
— (Array<String>
)Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories.
-
(AWS.Response)
—
Returns:
searchPlaceIndexForText(params = {}, callback) ⇒ AWS.Request
Geocodes free-form text, such as an address, name, city, or region to allow you to search for Places or points of interest.
Optional parameters let you narrow your search results by bounding box or country, or bias your search toward a specific position on the globe.
Note: You can search for places near a given position usingBiasPosition
, or filter results within a bounding box usingFilterBBox
. Providing both parameters simultaneously returns an error.Search results are returned in order of highest to lowest relevance.
Service Reference:
Examples:
Calling the searchPlaceIndexForText operation
var params = { IndexName: 'STRING_VALUE', /* required */ Text: 'STRING_VALUE', /* required */ BiasPosition: [ 'NUMBER_VALUE', /* more items */ ], FilterBBox: [ 'NUMBER_VALUE', /* more items */ ], FilterCategories: [ 'STRING_VALUE', /* more items */ ], FilterCountries: [ 'STRING_VALUE', /* more items */ ], Key: 'STRING_VALUE', Language: 'STRING_VALUE', MaxResults: 'NUMBER_VALUE' }; location.searchPlaceIndexForText(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
IndexName
— (String
)The name of the place index resource you want to use for the search.
Text
— (String
)The address, name, city, or region to be used in the search in free-form text format. For example,
123 Any Street
.BiasPosition
— (Array<Float>
)An optional parameter that indicates a preference for places that are closer to a specified position.
If provided, this parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the second number represents the Y coordinate, or latitude.
For example,
[-123.1174, 49.2847]
represents the position with longitude-123.1174
and latitude49.2847
.Note:BiasPosition
andFilterBBox
are mutually exclusive. Specifying both options results in an error.FilterBBox
— (Array<Float>
)An optional parameter that limits the search results by returning only places that are within the provided bounding box.
If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the southwest corner of the bounding box; the second pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the northeast corner of the bounding box.
For example,
[-12.7935, -37.4835, -12.0684, -36.9542]
represents a bounding box where the southwest corner has longitude-12.7935
and latitude-37.4835
, and the northeast corner has longitude-12.0684
and latitude-36.9542
.Note:FilterBBox
andBiasPosition
are mutually exclusive. Specifying both options results in an error.FilterCountries
— (Array<String>
)An optional parameter that limits the search results by returning only places that are in a specified list of countries.
-
Valid values include ISO 3166 3-digit country codes. For example, Australia uses three upper-case characters:
AUS
.
-
MaxResults
— (Integer
)An optional parameter. The maximum number of results returned per request.
The default:
50
Language
— (String
)The preferred language used to return results. The value must be a valid BCP 47 language tag, for example,
en
for English.This setting affects the languages used in the results, but not the results themselves. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.
For an example, we'll use the Greek language. You search for
Athens, Greece
, with thelanguage
parameter set toen
. The result found will most likely be returned asAthens
.If you set the
language
parameter toel
, for Greek, then the result found will more likely be returned asΑθήνα
.If the data provider does not have a value for Greek, the result will be in a language that the provider does support.
FilterCategories
— (Array<String>
)A list of one or more Amazon Location categories to filter the returned places. If you include more than one category, the results will include results that match any of the categories listed.
For more information about using categories, including a list of Amazon Location categories, see Categories and filtering, in the Amazon Location Service Developer Guide.
Key
— (String
)The optional API key to authorize the request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Summary
— (map
)Contains a summary of the request. Echoes the input values for
BiasPosition
,FilterBBox
,FilterCountries
,Language
,MaxResults
, andText
. Also includes theDataSource
of the place index and the bounding box,ResultBBox
, which surrounds the search results.Text
— required — (String
)The search text specified in the request.
BiasPosition
— (Array<Float>
)Contains the coordinates for the optional bias position specified in the request.
This parameter contains a pair of numbers. The first number represents the X coordinate, or longitude; the second number represents the Y coordinate, or latitude.
For example,
[-123.1174, 49.2847]
represents the position with longitude-123.1174
and latitude49.2847
.FilterBBox
— (Array<Float>
)Contains the coordinates for the optional bounding box specified in the request.
FilterCountries
— (Array<String>
)Contains the optional country filter specified in the request.
MaxResults
— (Integer
)Contains the optional result count limit specified in the request.
ResultBBox
— (Array<Float>
)The bounding box that fully contains all search results.
Note: If you specified the optionalFilterBBox
parameter in the request,ResultBBox
is contained withinFilterBBox
.DataSource
— required — (String
)The geospatial data provider attached to the place index resource specified in the request. Values can be one of the following:
-
Esri
-
Grab
-
Here
For more information about data providers, see Amazon Location Service data providers.
-
Language
— (String
)The preferred language used to return results. Matches the language in the request. The value is a valid BCP 47 language tag, for example,
en
for English.FilterCategories
— (Array<String>
)The optional category filter specified in the request.
Results
— (Array<map>
)A list of Places matching the input text. Each result contains additional information about the specific point of interest.
Not all response properties are included with all responses. Some properties may only be returned by specific data partners.
Place
— required — (map
)Details about the search result, such as its address and position.
Label
— (String
)The full name and address of the point of interest such as a city, region, or country. For example,
123 Any Street, Any Town, USA
.Geometry
— required — (map
)Places uses a point geometry to specify a location or a Place.
Point
— (Array<Float>
)A single point geometry specifies a location for a Place using WGS 84 coordinates:
-
x — Specifies the x coordinate or longitude.
-
y — Specifies the y coordinate or latitude.
-
AddressNumber
— (String
)The numerical portion of an address, such as a building number.
Street
— (String
)The name for a street or a road to identify a location. For example,
Main Street
.Neighborhood
— (String
)The name of a community district. For example,
Downtown
.Municipality
— (String
)A name for a local area, such as a city or town name. For example,
Toronto
.SubRegion
— (String
)A county, or an area that's part of a larger region. For example,
Metro Vancouver
.Region
— (String
)A name for an area or geographical division, such as a province or state name. For example,
British Columbia
.Country
— (String
)A country/region specified using ISO 3166 3-digit country/region code. For example,
CAN
.PostalCode
— (String
)A group of numbers and letters in a country-specific format, which accompanies the address for the purpose of identifying a location.
Interpolated
— (Boolean
)True
if the result is interpolated from other known places.False
if the Place is a known place.Not returned when the partner does not provide the information.
For example, returns
False
for an address location that is found in the partner data, but returnsTrue
if an address does not exist in the partner data and its location is calculated by interpolating between other known addresses.TimeZone
— (map
)The time zone in which the
Place
is located. Returned only when using HERE or Grab as the selected partner.Name
— required — (String
)The name of the time zone, following the IANA time zone standard. For example,
America/Los_Angeles
.Offset
— (Integer
)The time zone's offset, in seconds, from UTC.
UnitType
— (String
)For addresses with a
UnitNumber
, the type of unit. For example,Apartment
.Note: Returned only for a place index that uses Esri as a data provider.UnitNumber
— (String
)For addresses with multiple units, the unit identifier. Can include numbers and letters, for example
3B
orUnit 123
.Note: Returned only for a place index that uses Esri or Grab as a data provider. Is not returned forSearchPlaceIndexForPosition
.Categories
— (Array<String>
)The Amazon Location categories that describe this Place.
For more information about using categories, including a list of Amazon Location categories, see Categories and filtering, in the Amazon Location Service Developer Guide.
SupplementalCategories
— (Array<String>
)Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories.
SubMunicipality
— (String
)An area that's part of a larger municipality. For example,
Blissville
is a submunicipality in the Queen County in New York.Note: This property supported by Esri and OpenData. The Esri property isdistrict
, and the OpenData property isborough
.
Distance
— (Float
)The distance in meters of a great-circle arc between the bias position specified and the result.
Distance
will be returned only if a bias position was specified in the query.Note: A great-circle arc is the shortest path on a sphere, in this case the Earth. This returns the shortest distance between two locations.Relevance
— (Float
)The relative confidence in the match for a result among the results returned. For example, if more fields for an address match (including house number, street, city, country/region, and postal code), the relevance score is closer to 1.
Returned only when the partner selected is Esri or Grab.
PlaceId
— (String
)The unique identifier of the place. You can use this with the
GetPlace
operation to find the place again later.Note: ForSearchPlaceIndexForText
operations, thePlaceId
is returned only by place indexes that use HERE or Grab as a data provider.
-
(AWS.Response)
—
Returns:
tagResource(params = {}, callback) ⇒ AWS.Request
Assigns one or more tags (key-value pairs) to the specified Amazon Location Service resource.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values.
You can use the
TagResource
operation with an Amazon Location Service resource that already has tags. If you specify a new tag key for the resource, this tag is appended to the tags already associated with the resource. If you specify a tag key that's already associated with the resource, the new tag value that you specify replaces the previous value for that tag.You can associate up to 50 tags with a resource.
Service Reference:
Examples:
Calling the tagResource operation
var params = { ResourceArn: 'STRING_VALUE', /* required */ Tags: { /* required */ '<TagKey>': 'STRING_VALUE', /* '<TagKey>': ... */ } }; location.tagResource(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
ResourceArn
— (String
)The Amazon Resource Name (ARN) of the resource whose tags you want to update.
-
Format example:
arn:aws:geo:region:account-id:resourcetype/ExampleResource
-
Tags
— (map<String>
)Applies one or more tags to specific resource. A tag is a key-value pair that helps you manage, identify, search, and filter your resources.
Format:
"key" : "value"
Restrictions:
-
Maximum 50 tags per resource.
-
Each tag key must be unique and must have exactly one associated value.
-
Maximum key length: 128 Unicode characters in UTF-8.
-
Maximum value length: 256 Unicode characters in UTF-8.
-
Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @
-
Cannot use "aws:" as a prefix for a key.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
untagResource(params = {}, callback) ⇒ AWS.Request
Removes one or more tags from the specified Amazon Location resource.
Service Reference:
Examples:
Calling the untagResource operation
var params = { ResourceArn: 'STRING_VALUE', /* required */ TagKeys: [ /* required */ 'STRING_VALUE', /* more items */ ] }; location.untagResource(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
ResourceArn
— (String
)The Amazon Resource Name (ARN) of the resource from which you want to remove tags.
-
Format example:
arn:aws:geo:region:account-id:resourcetype/ExampleResource
-
TagKeys
— (Array<String>
)The list of tag keys to remove from the specified resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
updateGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Updates the specified properties of a given geofence collection.
Service Reference:
Examples:
Calling the updateGeofenceCollection operation
var params = { CollectionName: 'STRING_VALUE', /* required */ Description: 'STRING_VALUE', PricingPlan: RequestBasedUsage | MobileAssetTracking | MobileAssetManagement, PricingPlanDataSource: 'STRING_VALUE' }; location.updateGeofenceCollection(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CollectionName
— (String
)The name of the geofence collection to update.
PricingPlan
— (String
)No longer used. If included, the only allowed value is
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
PricingPlanDataSource
— (String
)This parameter is no longer used.
Description
— (String
)Updates the description for the geofence collection.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CollectionName
— (String
)The name of the updated geofence collection.
CollectionArn
— (String
)The Amazon Resource Name (ARN) of the updated geofence collection. Used to specify a resource across Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollection
-
UpdateTime
— (Date
)The time when the geofence collection was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
-
(AWS.Response)
—
Returns:
updateKey(params = {}, callback) ⇒ AWS.Request
Updates the specified properties of a given API key resource.
Service Reference:
Examples:
Calling the updateKey operation
var params = { KeyName: 'STRING_VALUE', /* required */ Description: 'STRING_VALUE', ExpireTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, ForceUpdate: true || false, NoExpiry: true || false, Restrictions: { AllowActions: [ /* required */ 'STRING_VALUE', /* more items */ ], AllowResources: [ /* required */ 'STRING_VALUE', /* more items */ ], AllowReferers: [ 'STRING_VALUE', /* more items */ ] } }; location.updateKey(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
KeyName
— (String
)The name of the API key resource to update.
Description
— (String
)Updates the description for the API key resource.
ExpireTime
— (Date
)Updates the timestamp for when the API key resource will expire in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.NoExpiry
— (Boolean
)Whether the API key should expire. Set to
true
to set the API key to have no expiration time.ForceUpdate
— (Boolean
)The boolean flag to be included for updating
ExpireTime
orRestrictions
details.Must be set to
true
to update an API key resource that has been used in the past 7 days.False
if force update is not preferredDefault value:
False
Restrictions
— (map
)Updates the API key restrictions for the API key resource.
AllowActions
— required — (Array<String>
)A list of allowed actions that an API key resource grants permissions to perform. You must have at least one action for each type of resource. For example, if you have a place resource, you must include at least one place action.
The following are valid values for the actions.
-
Map actions
-
geo:GetMap*
- Allows all actions needed for map rendering.
-
-
Place actions
-
geo:SearchPlaceIndexForText
- Allows geocoding. -
geo:SearchPlaceIndexForPosition
- Allows reverse geocoding. -
geo:SearchPlaceIndexForSuggestions
- Allows generating suggestions from text. -
GetPlace
- Allows finding a place by place ID.
-
-
Route actions
-
geo:CalculateRoute
- Allows point to point routing. -
geo:CalculateRouteMatrix
- Allows calculating a matrix of routes.
-
Note: You must use these strings exactly. For example, to provide access to map rendering, the only valid action isgeo:GetMap*
as an input to the list.["geo:GetMap*"]
is valid but["geo:GetMapTile"]
is not. Similarly, you cannot use["geo:SearchPlaceIndexFor*"]
- you must list each of the Place actions separately.-
AllowResources
— required — (Array<String>
)A list of allowed resource ARNs that a API key bearer can perform actions on.
-
The ARN must be the correct ARN for a map, place, or route ARN. You may include wildcards in the resource-id to match multiple resources of the same type.
-
The resources must be in the same
partition
,region
, andaccount-id
as the key that is being created. -
Other than wildcards, you must include the full ARN, including the
arn
,partition
,service
,region
,account-id
andresource-id
delimited by colons (:). -
No spaces allowed, even with wildcards. For example,
arn:aws:geo:region:account-id:map/ExampleMap*
.
For more information about ARN format, see Amazon Resource Names (ARNs).
-
AllowReferers
— (Array<String>
)An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.
Requirements:
-
Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list
$-._+!*(),;/?:@=&
-
May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.
-
May contain wildcard characters question mark (?) and asterisk ().
Question mark (?) will replace any single character (including hexadecimal digits).
Asterisk () will replace any multiple characters (including multiple hexadecimal digits).
-
No spaces allowed. For example,
https://example.com
.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:KeyArn
— (String
)The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:key/ExampleKey
-
KeyName
— (String
)The name of the API key resource.
UpdateTime
— (Date
)The timestamp for when the API key resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
-
(AWS.Response)
—
Returns:
updateMap(params = {}, callback) ⇒ AWS.Request
Updates the specified properties of a given map resource.
Service Reference:
Examples:
Calling the updateMap operation
var params = { MapName: 'STRING_VALUE', /* required */ ConfigurationUpdate: { CustomLayers: [ 'STRING_VALUE', /* more items */ ], PoliticalView: 'STRING_VALUE' }, Description: 'STRING_VALUE', PricingPlan: RequestBasedUsage | MobileAssetTracking | MobileAssetManagement }; location.updateMap(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MapName
— (String
)The name of the map resource to update.
PricingPlan
— (String
)No longer used. If included, the only allowed value is
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
Description
— (String
)Updates the description for the map resource.
ConfigurationUpdate
— (map
)Updates the parts of the map configuration that can be updated, including the political view.
PoliticalView
— (String
)Specifies the political view for the style. Set to an empty string to not use a political view, or, for styles that support specific political views, you can choose a view, such as
IND
for the Indian view.Note: Not all map resources or styles support political view styles. See Political views for more information.CustomLayers
— (Array<String>
)Specifies the custom layers for the style. Leave unset to not enable any custom layer, or, for styles that support custom layers, you can enable layer(s), such as POI layer for the VectorEsriNavigation style. Default is
unset
.Note: Not all map resources or styles support custom layers. See Custom Layers for more information.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:MapName
— (String
)The name of the updated map resource.
MapArn
— (String
)The Amazon Resource Name (ARN) of the updated map resource. Used to specify a resource across AWS.
-
Format example:
arn:aws:geo:region:account-id:map/ExampleMap
-
UpdateTime
— (Date
)The timestamp for when the map resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
-
(AWS.Response)
—
Returns:
updatePlaceIndex(params = {}, callback) ⇒ AWS.Request
Updates the specified properties of a given place index resource.
Service Reference:
Examples:
Calling the updatePlaceIndex operation
var params = { IndexName: 'STRING_VALUE', /* required */ DataSourceConfiguration: { IntendedUse: SingleUse | Storage }, Description: 'STRING_VALUE', PricingPlan: RequestBasedUsage | MobileAssetTracking | MobileAssetManagement }; location.updatePlaceIndex(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
IndexName
— (String
)The name of the place index resource to update.
PricingPlan
— (String
)No longer used. If included, the only allowed value is
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
Description
— (String
)Updates the description for the place index resource.
DataSourceConfiguration
— (map
)Updates the data storage option for the place index resource.
IntendedUse
— (String
)Specifies how the results of an operation will be stored by the caller.
Valid values include:
-
SingleUse
specifies that the results won't be stored. -
Storage
specifies that the result can be cached or stored in a database.
Default value:
Possible values include:SingleUse
"SingleUse"
"Storage"
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:IndexName
— (String
)The name of the updated place index resource.
IndexArn
— (String
)The Amazon Resource Name (ARN) of the upated place index resource. Used to specify a resource across Amazon Web Services.
-
Format example:
arn:aws:geo:region:account-id:place- index/ExamplePlaceIndex
-
UpdateTime
— (Date
)The timestamp for when the place index resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
-
(AWS.Response)
—
Returns:
updateRouteCalculator(params = {}, callback) ⇒ AWS.Request
Updates the specified properties for a given route calculator resource.
Service Reference:
Examples:
Calling the updateRouteCalculator operation
var params = { CalculatorName: 'STRING_VALUE', /* required */ Description: 'STRING_VALUE', PricingPlan: RequestBasedUsage | MobileAssetTracking | MobileAssetManagement }; location.updateRouteCalculator(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CalculatorName
— (String
)The name of the route calculator resource to update.
PricingPlan
— (String
)No longer used. If included, the only allowed value is
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
Description
— (String
)Updates the description for the route calculator resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CalculatorName
— (String
)The name of the updated route calculator resource.
CalculatorArn
— (String
)The Amazon Resource Name (ARN) of the updated route calculator resource. Used to specify a resource across AWS.
-
Format example:
arn:aws:geo:region:account-id:route- calculator/ExampleCalculator
-
UpdateTime
— (Date
)The timestamp for when the route calculator was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
-
(AWS.Response)
—
Returns:
updateTracker(params = {}, callback) ⇒ AWS.Request
Updates the specified properties of a given tracker resource.
Service Reference:
Examples:
Calling the updateTracker operation
var params = { TrackerName: 'STRING_VALUE', /* required */ Description: 'STRING_VALUE', EventBridgeEnabled: true || false, KmsKeyEnableGeospatialQueries: true || false, PositionFiltering: TimeBased | DistanceBased | AccuracyBased, PricingPlan: RequestBasedUsage | MobileAssetTracking | MobileAssetManagement, PricingPlanDataSource: 'STRING_VALUE' }; location.updateTracker(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The name of the tracker resource to update.
PricingPlan
— (String
)No longer used. If included, the only allowed value is
Possible values include:RequestBasedUsage
."RequestBasedUsage"
"MobileAssetTracking"
"MobileAssetManagement"
PricingPlanDataSource
— (String
)This parameter is no longer used.
Description
— (String
)Updates the description for the tracker resource.
PositionFiltering
— (String
)Updates the position filtering for the tracker resource.
Valid values:
-
TimeBased
- Location updates are evaluated against linked geofence collections, but not every location update is stored. If your update frequency is more often than 30 seconds, only one update per 30 seconds is stored for each unique device ID. -
DistanceBased
- If the device has moved less than 30 m (98.4 ft), location updates are ignored. Location updates within this distance are neither evaluated against linked geofence collections, nor stored. This helps control costs by reducing the number of geofence evaluations and historical device positions to paginate through. Distance-based filtering can also reduce the effects of GPS noise when displaying device trajectories on a map. -
AccuracyBased
- If the device has moved less than the measured accuracy, location updates are ignored. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is ignored if the device has moved less than 15 m. Ignored location updates are neither evaluated against linked geofence collections, nor stored. This helps educe the effects of GPS noise when displaying device trajectories on a map, and can help control costs by reducing the number of geofence evaluations.
"TimeBased"
"DistanceBased"
"AccuracyBased"
-
EventBridgeEnabled
— (Boolean
)Whether to enable position
UPDATE
events from this tracker to be sent to EventBridge.Note: You do not need enable this feature to getENTER
andEXIT
events for geofences with this tracker. Those events are always sent to EventBridge.KmsKeyEnableGeospatialQueries
— (Boolean
)Enables
GeospatialQueries
for a tracker that uses a Amazon Web Services KMS customer managed key.This parameter is only used if you are using a KMS customer managed key.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:TrackerName
— (String
)The name of the updated tracker resource.
TrackerArn
— (String
)The Amazon Resource Name (ARN) of the updated tracker resource. Used to specify a resource across AWS.
-
Format example:
arn:aws:geo:region:account-id:tracker/ExampleTracker
-
UpdateTime
— (Date
)The timestamp for when the tracker resource was last updated in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.
-
(AWS.Response)
—
Returns:
verifyDevicePosition(params = {}, callback) ⇒ AWS.Request
Verifies the integrity of the device's position by determining if it was reported behind a proxy, and by comparing it to an inferred position estimated based on the device's state.
Service Reference:
Examples:
Calling the verifyDevicePosition operation
var params = { DeviceState: { /* required */ DeviceId: 'STRING_VALUE', /* required */ Position: [ /* required */ 'NUMBER_VALUE', /* more items */ ], SampleTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */ Accuracy: { Horizontal: 'NUMBER_VALUE' /* required */ }, CellSignals: { LteCellDetails: [ /* required */ { CellId: 'NUMBER_VALUE', /* required */ Mcc: 'NUMBER_VALUE', /* required */ Mnc: 'NUMBER_VALUE', /* required */ LocalId: { Earfcn: 'NUMBER_VALUE', /* required */ Pci: 'NUMBER_VALUE' /* required */ }, NetworkMeasurements: [ { CellId: 'NUMBER_VALUE', /* required */ Earfcn: 'NUMBER_VALUE', /* required */ Pci: 'NUMBER_VALUE', /* required */ Rsrp: 'NUMBER_VALUE', Rsrq: 'NUMBER_VALUE' }, /* more items */ ], NrCapable: true || false, Rsrp: 'NUMBER_VALUE', Rsrq: 'NUMBER_VALUE', Tac: 'NUMBER_VALUE', TimingAdvance: 'NUMBER_VALUE' }, /* more items */ ] }, Ipv4Address: 'STRING_VALUE', WiFiAccessPoints: [ { MacAddress: 'STRING_VALUE', /* required */ Rss: 'NUMBER_VALUE' /* required */ }, /* more items */ ] }, TrackerName: 'STRING_VALUE', /* required */ DistanceUnit: Kilometers | Miles }; location.verifyDevicePosition(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
TrackerName
— (String
)The name of the tracker resource to be associated with verification request.
DeviceState
— (map
)The device's state, including position, IP address, cell signals and Wi-Fi access points.
DeviceId
— required — (String
)The device identifier.
SampleTime
— required — (Date
)The timestamp at which the device's position was determined. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.Position
— required — (Array<Float>
)The last known device position.
Accuracy
— (map
)Defines the level of certainty of the position.
Horizontal
— required — (Float
)Estimated maximum distance, in meters, between the measured position and the true position of a device, along the Earth's surface.
Ipv4Address
— (String
)The device's Ipv4 address.
WiFiAccessPoints
— (Array<map>
)The Wi-Fi access points the device is using.
MacAddress
— required — (String
)Medium access control address (Mac).
Rss
— required — (Integer
)Received signal strength (dBm) of the WLAN measurement data.
CellSignals
— (map
)The cellular network infrastructure that the device is connected to.
LteCellDetails
— required — (Array<map>
)Information about the Long-Term Evolution (LTE) network the device is connected to.
CellId
— required — (Integer
)The E-UTRAN Cell Identifier (ECI).
Mcc
— required — (Integer
)The Mobile Country Code (MCC).
Mnc
— required — (Integer
)The Mobile Network Code (MNC)
LocalId
— (map
)The LTE local identification information (local ID).
Earfcn
— required — (Integer
)E-UTRA (Evolved Universal Terrestrial Radio Access) absolute radio frequency channel number (EARFCN).
Pci
— required — (Integer
)Physical Cell ID (PCI).
NetworkMeasurements
— (Array<map>
)The network measurements.
Earfcn
— required — (Integer
)E-UTRA (Evolved Universal Terrestrial Radio Access) absolute radio frequency channel number (EARFCN).
CellId
— required — (Integer
)E-UTRAN Cell Identifier (ECI).
Pci
— required — (Integer
)Physical Cell ID (PCI).
Rsrp
— (Integer
)Signal power of the reference signal received, measured in dBm (decibel-milliwatts).
Rsrq
— (Float
)Signal quality of the reference Signal received, measured in decibels (dB).
TimingAdvance
— (Integer
)Timing Advance (TA).
NrCapable
— (Boolean
)Indicates whether the LTE object is capable of supporting NR (new radio).
Rsrp
— (Integer
)Signal power of the reference signal received, measured in decibel-milliwatts (dBm).
Rsrq
— (Float
)Signal quality of the reference Signal received, measured in decibels (dB).
Tac
— (Integer
)LTE Tracking Area Code (TAC).
DistanceUnit
— (String
)The distance unit for the verification request.
Default Value:
Possible values include:Kilometers
"Kilometers"
"Miles"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:InferredState
— (map
)The inferred state of the device, given the provided position, IP address, cellular signals, and Wi-Fi- access points.
Position
— (Array<Float>
)The device position inferred by the provided position, IP address, cellular signals, and Wi-Fi- access points.
Accuracy
— (map
)The level of certainty of the inferred position.
Horizontal
— required — (Float
)Estimated maximum distance, in meters, between the measured position and the true position of a device, along the Earth's surface.
DeviationDistance
— (Float
)The distance between the inferred position and the device's self-reported position.
ProxyDetected
— required — (Boolean
)Indicates if a proxy was used.
DeviceId
— (String
)The device identifier.
SampleTime
— (Date
)The timestamp at which the device's position was determined. Uses ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.ReceivedTime
— (Date
)The timestamp for when the tracker resource received the device position in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ
.DistanceUnit
— (String
)The distance unit for the verification response.
Possible values include:"Kilometers"
"Miles"
-
(AWS.Response)
—
Returns:
Generated on Thu Aug 22 18:44:54 2024 by yard 0.9.36 (ruby-2.5.1). - batchEvaluateGeofences(params = {}, callback) ⇒ AWS.Request