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();
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.
- 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.
.
- createMap(params = {}, callback) ⇒ AWS.Request
Creates a map resource in your AWS 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 may only use HERE as your geolocation provider.- createPlaceIndex(params = {}, callback) ⇒ AWS.Request
Creates a place index resource in your AWS account.
- createRouteCalculator(params = {}, callback) ⇒ AWS.Request
Creates a route calculator resource in your AWS 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 AWS account, which lets you retrieve current and historical location of devices.
.
- deleteGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Deletes a geofence collection from your AWS account.
Note: This operation deletes the resource permanently.- deleteMap(params = {}, callback) ⇒ AWS.Request
Deletes a map resource from your AWS account.
Note: This operation deletes the resource permanently.- deletePlaceIndex(params = {}, callback) ⇒ AWS.Request
Deletes a place index resource from your AWS account.
Note: This operation deletes the resource permanently.- deleteRouteCalculator(params = {}, callback) ⇒ AWS.Request
Deletes a route calculator resource from your AWS account.
Note: This operation deletes the resource permanently.- deleteTracker(params = {}, callback) ⇒ AWS.Request
Deletes a tracker resource from your AWS account.
Note: This operation deletes the resource permanently.- describeGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Retrieves the geofence collection 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.- 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.
.
- 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.
- listDevicePositions(params = {}, callback) ⇒ AWS.Request
A batch request to retrieve all device positions.
.
- listGeofenceCollections(params = {}, callback) ⇒ AWS.Request
Lists geofence collections in your AWS account.
.
- listGeofences(params = {}, callback) ⇒ AWS.Request
Lists geofences stored in a given geofence collection.
.
- listMaps(params = {}, callback) ⇒ AWS.Request
Lists map resources in your AWS account.
.
- listPlaceIndexes(params = {}, callback) ⇒ AWS.Request
Lists place index resources in your AWS account.
.
- listRouteCalculators(params = {}, callback) ⇒ AWS.Request
Lists route calculator resources in your AWS 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 AWS 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.
<p>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.
.
- 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.
.
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.
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.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. 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
.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. 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
.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
.
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
.
createGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Creates a geofence collection, which manages and stores geofences.
createMap(params = {}, callback) ⇒ AWS.Request
Creates a map resource in your AWS 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 may only use HERE as your geolocation provider. See section 82 of the AWS service terms for more details.createPlaceIndex(params = {}, callback) ⇒ AWS.Request
Creates a place index resource in your AWS 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 may only use HERE as your geolocation provider. See section 82 of the AWS service terms for more details.createRouteCalculator(params = {}, callback) ⇒ AWS.Request
Creates a route calculator resource in your AWS 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 may only use HERE as your geolocation provider. See section 82 of the AWS service terms for more details.createTracker(params = {}, callback) ⇒ AWS.Request
Creates a tracker resource in your AWS account, which lets you retrieve current and historical location of devices.
deleteGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Deletes a geofence collection from your AWS 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.deleteMap(params = {}, callback) ⇒ AWS.Request
Deletes a map resource from your AWS account.
Note: This operation deletes the resource permanently. If the map is being used in an application, the map may not render.deletePlaceIndex(params = {}, callback) ⇒ AWS.Request
Deletes a place index resource from your AWS account.
Note: This operation deletes the resource permanently.deleteRouteCalculator(params = {}, callback) ⇒ AWS.Request
Deletes a route calculator resource from your AWS account.
Note: This operation deletes the resource permanently.deleteTracker(params = {}, callback) ⇒ AWS.Request
Deletes a tracker resource from your AWS 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.describeGeofenceCollection(params = {}, callback) ⇒ AWS.Request
Retrieves the geofence collection details.
describeRouteCalculator(params = {}, callback) ⇒ AWS.Request
Retrieves the route calculator 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.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.
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.
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.
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).
listDevicePositions(params = {}, callback) ⇒ AWS.Request
A batch request to retrieve all device positions.
listGeofenceCollections(params = {}, callback) ⇒ AWS.Request
Lists geofence collections in your AWS account.
listGeofences(params = {}, callback) ⇒ AWS.Request
Lists geofences stored in a given geofence collection.
listPlaceIndexes(params = {}, callback) ⇒ AWS.Request
Lists place index resources in your AWS account.
listRouteCalculators(params = {}, callback) ⇒ AWS.Request
Lists route calculator resources in your AWS 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.
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. Allows you to search for Places or points of interest near a given position.
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.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.
tagResource(params = {}, callback) ⇒ AWS.Request
Assigns one or more tags (key-value pairs) to the specified Amazon Location Service resource.
<p>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.</p> <p>You can use the <code>TagResource</code> 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. </p> <p>You can associate up to 50 tags with a resource.</p>
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.
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.
- batchEvaluateGeofences(params = {}, callback) ⇒ AWS.Request