Geolocation and Mapping - Building Geospatial Applications with Amazon Location Service and Amplify

Learn how to build geolocation and mapping applications using Amazon Location Service and AWS Amplify.

Four Building Blocks of a Location Application

Ride-hailing apps, food delivery, logistics tracking, real estate search, and store locators. Even though location-based applications serve different purposes, the building blocks they need are largely the same. Drawing a map on the screen; converting addresses and place names into latitude and longitude (geocoding); calculating the route and travel time between points; and continuously recording the position of moving objects to detect when they enter or leave a specific area. Those are the four. If you try to build them yourself, procuring map data and checking its licenses, generating and serving tiles, implementing route search over a road network, and operating a data store that keeps location history all become your own work. Amazon Location Service provides these building blocks as a managed service, making map rendering, place search, route calculation, and position tracking and geofencing callable as AWS APIs. The point to keep in mind is that the way this service is used changed significantly in November 2024. Previously, creating resources before you started was a required step, but the current generation removed that step, and you can now call the APIs with a single API key. This article assumes the current-generation APIs and walks through everything from how to actually call them to how pricing works. A later section also covers migration for those maintaining applications built on the previous generation.

The November 2024 Generation Change: From Resource Creation to API Keys

To understand the entry point of the current generation, the quickest route is to first grasp what went away. In the previous generation, to search for addresses you first had to create a resource called a place index, and likewise a route calculator for route calculation and a map resource for map display, each created in advance and then referenced by name. The design was that you chose a data provider at the stage of creating the resource, and subsequent calls were tied to that resource. The new set of APIs released in November 2024 removed this premise. The official explanation also states clearly that the resource creation step, which was previously required, is no longer necessary, and that you can now use the various APIs by setting up an API key. What was released at that time were 10 updated APIs and 7 new APIs, for a total of 17 new and enhanced APIs. At the same time, the namespaces in the SDK were also split. Place search became geo-places, route calculation became geo-routes, and map retrieval became geo-maps, each an independent family, so an application can pull in only the families it needs. API keys are created with CreateKey, and DescribeKey, ListKeys, UpdateKey, and DeleteKey are also available. The key value is a string that begins with v1.public., and it is intended to be embedded in frontend code. Precisely because keys are meant to be embedded, you can set an optional expiration on a key and narrow its scope of use by the HTTP referrer on the web or by the application identifier on mobile. However, there is a line around what an API key can call. Map, place, and route queries can be called with a key, but operations such as writing positions to a tracker, managing geofences, and managing the keys themselves require authorization through IAM or Amazon Cognito. The current-generation design is to treat queries that are fine to make public separately from writes and management operations that are not, each with its own authorization mechanism.

Places, Routes, and Maps: Three API Families and a First Call

The current-generation APIs are organized into three families. Places, which handles locations, has seven operations. They are Geocode, which finds latitude and longitude from an address string; ReverseGeocode, which finds an address from latitude and longitude; SearchText for free-form text search; SearchNearby for finding nearby facilities; Autocomplete and Suggest for input completion; and GetPlace, which retrieves details from an identifier. Input completion is split into two because returning confirmed address candidates and returning candidates for the search term itself are different situations. Routes, which handles routes, has five. They are CalculateRoutes, which calculates routes; CalculateRouteMatrix, which builds a many-to-many travel time table; CalculateIsolines, which returns the area reachable within a specified time as a polygon; OptimizeWaypoints, which optimizes the order of multiple stops; and SnapToRoads, which corrects a sequence of GPS points onto roads. The correspondence is CalculateRouteMatrix and OptimizeWaypoints for delivery planning, CalculateIsolines for trade area analysis, and SnapToRoads for cleaning up driving histories. The travel mode values differ by operation. CalculateRoutes has six types, adding Transit for public transportation and Intermodal for multimodal transport to Car, Pedestrian, Scooter, and Truck, while the other four operations, such as isolines and road snapping, have four types: Car, Pedestrian, Scooter, and Truck. In both cases the default is Car when nothing is specified, and Scooter is treated as a category that includes motorcycles. Maps, which handles maps, has five: GetStyleDescriptor, which returns style definitions; GetTile for vector tiles; GetGlyphs, which returns fonts for drawing labels; GetSprites for icon images; and GetStaticMap, which returns a map as a single image. If you only want to put a map in an email or a PDF, GetStaticMap covers it on its own. A handy way to check your first call is the CLI. When you use an API key, no signing is needed, so add --no-sign-request.

aws geo-places geocode \
  --query-text '東京都渋谷区神宮前 1-1-1' \
  --language ja \
  --key "$ALS_API_KEY" \
  --no-sign-request \
  --region ap-northeast-1

To call it directly over HTTP, pass the key in the key query parameter to POST /v2/geocode and put QueryText, Language, and so on in the body as JSON. In the wording of the official documentation, a request is described as requiring either an API key or a valid SigV4 signature. The split is regular IAM authentication for calls from the server side and an API key for calls from a browser or app. If you want to validate a large number of addresses at once, rather than sending requests one at a time, there is a path that uses Amazon Location Service Jobs to process files on Amazon S3 asynchronously. Also, for position tracking and geofences, even in the current generation you create resources called trackers and geofence collections before using them. The accurate understanding is that it is the map, place, and route queries that no longer require resource creation.

Rendering Maps and Integrating with the Frontend

Rendering the map itself is handled by MapLibre. MapLibre GL JS on the web and MapLibre Native on mobile are the officially recommended renderers, and Amazon Location Service's role is to supply the style definitions and tiles. On the web, the implementation works just by passing the style descriptor URL to MapLibre's style setting.

import maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';

const region = 'ap-northeast-1';
const apiKey = import.meta.env.VITE_ALS_API_KEY;

const map = new maplibregl.Map({
  container: 'map',
  style: `https://maps.geo.${region}.amazonaws.com/v2/styles/Standard/descriptor?key=${apiKey}&color-scheme=Dark`,
  center: [139.7671, 35.6812],
  zoom: 14
});

map.addControl(new maplibregl.NavigationControl());

Choose the style from four types: Standard, Monochrome, Hybrid, and Satellite. The color tone can be switched between Light and Dark with the color-scheme parameter, and the default is Light. This value is case-sensitive, so writing dark does not work. Other presentation features such as 3D buildings, terrain shading, contour line density, and traffic overlays can also be controlled with parameters appended to the descriptor URL. In other words, you do not need to rewrite application code to change the look; changing how the URL is assembled is enough. There are two formats for endpoint host names. The traditional IPv4-only format is service-code.geo.region-code.amazonaws.com, and the dual-stack format that supports both IPv4 and IPv6 is service-code.geo.region-code.api.aws. The service code is maps for maps, places for places, routes for routes, geofencing for geofences, tracking for trackers, and metadata for the family that bulk processing jobs belong to. In environments where IPv6 connectivity is a requirement, choose the latter format. If you use AWS Amplify with React, there is also a way to display a map with the Amplify Geo UI components.

import { MapView, Marker } from '@aws-amplify/ui-react-geo';
import '@aws-amplify/ui-react-geo/styles.css';

export default function StoreLocator() {
  return (
    <MapView
      initialViewState={{ latitude: 35.6812, longitude: 139.7671, zoom: 14 }}
    >
      <Marker latitude={35.6812} longitude={139.7671} />
    </MapView>
  );
}

However, this approach assumes map resources configured by Amplify and authorization through Amazon Cognito, and its way of handling credentials differs from the API key approach described so far. Sorting it out this way, with this approach for adding a map to an existing Amplify application and a keyed descriptor URL passed to MapLibre for using the current-generation APIs directly, lets you avoid a halfway mix of authorization designs. If you want to control the scope each user can work with, or handle operations that involve writes, either configuration ends up relying on Cognito and IAM.

Migrating from the Previous-Generation APIs and Where the Old Procedures Stand

If an existing application runs on the previous generation, the code looks quite different. Geocoding in the previous generation took the form of specifying the name of a place index created in advance.

aws location search-place-index-for-text \
  --index-name MyPlaceIndex \
  --text '東京都渋谷区神宮前 1-1' \
  --language ja \
  --region ap-northeast-1

In this form, the data provider chosen when the index is created determines the search results from then on. Changing providers required recreating the index, and even simply comparing search quality involved resource management. The current-generation APIs have no parameter equivalent to --index-name. Likewise, there is no parameter for a route calculator name or a map resource name, so in practice the migration work comes down to "removing the places where you passed resource names and replacing the call targets with the new operation names." The travel mode values also changed. The previous generation had five types: Bicycle, Car, Motorcycle, Truck, and Walking. The current generation is based on Car, Pedestrian, Scooter, and Truck, with Transit for public transportation and Intermodal for multimodal transport added only for route calculation (CalculateRoutes). Map Walking to Pedestrian and Motorcycle to Scooter. The current generation includes no value for bicycles, so applications that returned bicycle routes need to decide how to handle them during migration. The previous-generation documentation has not disappeared; it is collected under docs.aws.amazon.com/location/previous/. Whether a procedure you came across in a search is current or previous-generation can be told by whether the URL contains previous. When you want to check the old procedures during migration, this is the place to look. If you are moving from an application written with the Google Maps JavaScript API, there is an option that AWS publishes: the Amazon Location Migration SDK. It is a tool built on the idea of inserting a layer that mimics the Google Maps calling interface and swapping map rendering and place search over to Amazon Location Service without significantly rewriting the application's business logic. For applications too large to rewrite all at once, a practical way to proceed is to first confirm the scope of replacement with this layer.

Choosing a Data Provider and Its Terms of Use

Map and geocoding results themselves are not produced by AWS on its own; they are supplied by data providers. As of August 2026, the providers are Esri, HERE, and GrabMaps, which covers Southeast Asia. For map tiles, you can also choose styles derived from Open Data in addition to these, but only when going through previous-generation map resources. Open Data is used for drawing maps and is not used for place search or route calculation. If you frame it as choosing between two providers, the option for Southeast Asia and the Open Data tiles drop out of view. What matters first in the selection is the terms of use rather than quality. Moreover, these terms are set not in the service documentation but in the AWS Service Terms. Esri data cannot be used to track your own business assets (such as company vehicles or your own facilities) or for route calculation for that purpose without written consent from AWS. With HERE data, you cannot store results for Japan. GrabMaps is a provider for Southeast Asia, and the Regions where it is available are limited. In addition, the operations and styles you can use differ by Region. In ap-southeast-1 (Singapore) and ap-southeast-5 (Malaysia), which serve Southeast Asia, Geocode is not offered, and map styles are limited to Standard and Monochrome. The reliable way to confirm whether the operations you need are offered in the Regions for your target area is to check the list of availability by Region before you start implementing. Whether storage is permitted also ties directly to billing. The Places API has a parameter called IntendedUse, for which you specify either SingleUse (one-off use) or Storage (storing results). If you store responses in your own database, you must specify Storage to comply with the Service Terms, and the unit price in that case is higher. If you only display results on screen and do not store them, use SingleUse. Rather than settling it with the generalization that location data does not leave AWS, the practical way to sort it out is to check two points: each provider's storage restrictions and the IntendedUse setting.

Location Service Pricing

(As of August 2026; checked separately in two Regions, US East (N. Virginia) and Asia Pacific (Tokyo). The prices are the same in both Regions.) Pricing for map, place, and route queries is determined not by how long you hold resources but by the number of calls you make. Because these families do not require creating map or index resources, there is no fixed cost during periods when you are not using them. As described later, only geofences have a charge for holding them. For map tiles, GetTile in the current generation costs 0.04 USD per 1,000 tiles regardless of style. Provider-specific unit prices remain for retrieval through previous-generation map resources, where only the Open Data styles cost 0.035 USD per 1,000 tiles. GetStaticMap, which returns a single image, costs 0.50 USD per 1,000 requests. Note that displaying a single screen retrieves multiple tiles, and the more zooming and panning a UI involves, the more tiles it uses. Place search costs, per 1,000 requests, 0.50 USD for Core and 1.50 USD for Advanced. The lightweight responses of Autocomplete and Suggest for input completion have a separate bucket called Label, which costs 0.20 USD per 1,000 requests. Uses that involve storage (calls that specify Storage for IntendedUse) cost 4.00 USD per 1,000 requests. For bulk address validation, tiered unit prices apply. For Advanced, the first 100,000 records cost 12.50 USD per 1,000, the next 400,000 cost 9.00 USD, the next 500,000 cost 6.50 USD, the next 4,000,000 cost 3.00 USD, and the portion above 5,000,000 costs 1.50 USD. Core has a separate series of tiered unit prices that falls from 10.50 USD to 1.00 USD. Route calculation (CalculateRoutes) costs, per 1,000 requests, 0.50 USD for Core, 1.50 USD for Advanced, and 4.00 USD for Premium. The price levels are common to the other operations as well, but the buckets available differ by operation. The travel time table (CalculateRouteMatrix) has only Core and Advanced, while isolines, road snapping, and waypoint optimization have only Advanced and Premium. Therefore, the latter three operations have no 0.50 USD Core, and their lowest unit price is 1.50 USD per 1,000 requests. Position tracking is determined not by a monthly fee per device but by the number of positions you send. Position writes cost 0.05 USD per 1,000 for the first 500,000, 0.035 USD for the next 4,500,000, 0.025 USD for the next 45,000,000, and 0.0125 USD for the portion above 50,000,000. Position reads and device deletions each cost 0.05 USD per 1,000, and position integrity evaluations cost 1.00 USD per 1,000. Running 100 vehicles that send their position every 10 seconds exceeds 860,000 records in a single day, which shows how the design of the sending interval goes straight into cost. Geofences are the only component with a holding charge in addition to per-call charges, at 0.20 USD per month per 1,000 registered geofences. Matching positions against geofences (position evaluation) is tiered: the first 250,000 cost 0.16 USD per 1,000, the next 1,750,000 cost 0.11 USD, the next 23,000,000 cost 0.07 USD, and the portion above 25,000,000 costs 0.06 USD. In addition, management operations such as creating and updating geofences are offered at 0.05 USD per 1,000, and arrival forecasts at 1.75 USD per 1,000. Whether you are billed under Core, Advanced, or Premium depends on the options attached to the request. The bucket actually applied is returned in the PricingBucket field of the response, so measuring which bucket your development requests fall into before building an estimate lets you avoid gaps between what you expect and what you are billed. For usage above 5,000 USD per month, the official pricing page provides information about volume discounts. As for what you can try for free, you need to know that two different descriptions coexist. The AWS-wide free tier for new accounts changed to a credit-based model on July 15, 2025, under which you receive credits worth up to 200 USD, use the free plan for 6 months, and use the credits within 12 months. Meanwhile, the Location Service pricing page also lists a traditional table that offers free usage up to a certain amount each month for the first 3 months. Which one applies to your account depends on when it was created, so it is safe to check the actual remaining amount on the Free Tier screen of the Billing Dashboard before putting together an estimate.

Summary

The current generation of Amazon Location Service is not a service you use after creating place indexes and route calculators. With a single API key, you can call the seven operations of Places, the five operations of Routes, and the five operations of Maps. When you come across articles or samples written with previous-generation procedures, checking whether the URL contains previous keeps you from mixing up the generations. The points to keep in mind at design time can be narrowed down to three. The first is separating authorization: queries that are fine to make public go to API keys, while writes and management go to IAM or Amazon Cognito. The second is the data provider: from Esri, HERE, GrabMaps, and Open Data for map tiles, choose a provider whose Service Terms permit your use, and if you store results, specify Storage for IntendedUse. The third is the billing unit: because cost is determined by the number of requests and the applied bucket, adjusting how you attach options while watching PricingBucket is effective. Leave map rendering to MapLibre, and switch the look with parameters in the style descriptor URL. Once you understand this division of roles, you can assemble everything from a small screen such as a store locator to a configuration at the scale of continuously tracking vehicles with the same way of thinking.

References (Official AWS Resources)

The primary sources for this page are the official AWS website and documentation. Check the official pages below for the latest specifications and pricing.

If this page and the official documentation disagree, treat the official documentation as authoritative.

Share