id
stringlengths
8
78
source
stringclasses
743 values
chunk_id
int64
1
5.05k
text
stringlengths
593
49.7k
amazon-location-developer-guide-038
amazon-location-developer-guide.pdf
38
comply with local laws, as certain countries require adherence to their specific geopolitical views for maps and map data. Common use cases Embed maps in your application Build maps into your applications to create location-based experiences. Visualize business locations, search for points of interest, and help users find specific addresses. Enable seamless location sharing and geotagging features to engage your customers. Use comprehensive map data, robust geocoding, and flexible rendering to create customized, interactive maps tailored to your needs. Integrate dynamic, high-quality mapping experiences that drive user engagement and business insights into your application, whether you're building a directory, ride-sharing app, or social platform. Static maps for reporting or printing Seamlessly add images of street maps, satellite imagery, and location-based visuals into your websites, documents, and applications. Static maps enable you to create customizable map images that provide geographical context, without complex client-side rendering. Display delivery route on receipts, include location details in documents, or integrate maps into your digital experiences. Analyze and visualize data Overlay your data onto high-quality maps to uncover transformative spatial patterns and trends. Empower your teams to create customizable, interactive map visualizations with your geographic data. Use maps and your data to optimize site selection, plan infrastructure, or analyze market opportunities. Enhance real estate experiences Provide prospective buyers with comprehensive location context for real estate listings. Display the property's exact location, as well as surrounding neighborhood details like jurisdictional boundaries, local businesses, parks, and schools. Help customers find directions to your open houses. Create informative, location-centric real estate experiences that engage and inform your clients. Common use cases 116 Amazon Location Service Developer Guide Build engaging travel experiences Display dynamic maps showcasing destinations, with detailed street views and key geographical features. Highlight hotels, restaurants, and other points of interest for tourists and travelers. Plot outdoor amenities, like hiking trails, to help users plan their ideal itinerary. Use maps to support disaster response efforts Timely and accurate location information is critical during crises. Use mapping capabilities to build websites and applications that provide essential context to communities during pending disasters like fires, hurricanes, and floods. Display dynamic maps showcasing evacuation routes, safe shelters, road closures, and traffic congestion to help empower communities to quickly assess the situation and make informed decisions. Standalone Map APIs API Name Short Description Resources GetStyleDescriptor Retrieves the available map styles, such as standard, AWS map styles and customization monochrome, hybrid, and satellite, that can be applied to maps. GetTile Fetches individual map tiles based on a specified style and Tiles GetStaticMap zoom level, allowing for the rendering of maps at various levels of detail. Generates a static map image based on specific coordinat es and parameters, useful for embedding maps in reports or emails. the section called “Static maps” Standalone Map APIs 117 Amazon Location Service Displaying Map Developer Guide Topic Short Description Resources Styling Dynamic Map Amazon Location Service provides two options for styling your dynamic maps namely using predesign ed AWS Map Styles and customizing map style using style descriptors. the section called “Style dynamic maps” the section called “Standard map style” the section called “Monochro me map style” the section called “Hybrid map style” Rendering Dynamic Map Amazon Location Service recommends rendering maps the section called “Map Rendering SDK by language” using the MapLibre rendering engine. MapLibre is an engine for displaying maps in web or mobile applications. Customizing Static Map How to customize static maps generated using Amazon the section called “Customize static maps” Location Service. Overlay on your static maps to enhance the map's visual representation. the section called “Overlay on the static map” Overlaying Static Map Map concepts This section provides foundational knowledge for using Amazon Location Service's mapping capabilities. It details various map design options available and also explains how you can leverage AWS Map Styles and Design principles to customize the look and feel of your maps, ensuring visual consistency and branding in applications. Displaying Map 118 Amazon Location Service Developer Guide In addition, this topic covers critical mapping concepts such as Maps terminology, localization, and internationalization. Topics • Maps terminology • Localization and internationalization Maps terminology This section defines key terms related to Amazon Location Service Maps, providing insights into core concepts like basemaps, vector and raster data, map rendering, and map styles. Understanding these terms is essential for effectively utilizing the Amazon Location Service mapping APIs and resources. Basemap A basemap provides geographic context to your map, stored as vector tile layers. These tile layers include geographical features such as street names, buildings, and land use for visual reference. Vector Vector data consists of points, lines, and polygons, and is used to represent roads, locations, and areas on a map. Vector shapes can also be used as icons for markers on a map. Raster Raster data is image data made up
amazon-location-developer-guide-039
amazon-location-developer-guide.pdf
39
like basemaps, vector and raster data, map rendering, and map styles. Understanding these terms is essential for effectively utilizing the Amazon Location Service mapping APIs and resources. Basemap A basemap provides geographic context to your map, stored as vector tile layers. These tile layers include geographical features such as street names, buildings, and land use for visual reference. Vector Vector data consists of points, lines, and polygons, and is used to represent roads, locations, and areas on a map. Vector shapes can also be used as icons for markers on a map. Raster Raster data is image data made up of a grid, typically representing continuous data like terrain, satellite imagery, or heat maps. Raster images can also be used as icons or textures on a map. Map Rendering The map rendering library pulls data from Amazon Location Service at runtime, rendering the map based on the selected map resource. A map resource defines the data provider and map style. Amazon Location Service recommends using the MapLibre rendering engine. Vector Tile A vector tile is a format that stores map data using vector shapes. It adjusts to the display resolution and selectively renders features, while maintaining a small file size for optimal performance. Supported format: Mapbox Vector Tiles (MVT). Maps terminology 119 Amazon Location Service Map Style Developer Guide A map style defines color and other styling information for the map data, determining how the map will appear when rendered. Amazon Location Service provides map styles based on the Mapbox GL style specification. Glyph File A binary file containing encoded Unicode characters, used by a map renderer to display labels. Sprite File A Portable Network Graphic (PNG) image file that contains small raster images and corresponding location descriptions in a JSON file. Used by a map renderer to display icons or textures on a map. Bounding Box A bounding box is defined by two diagonal corner points: the northwest (NW) (top-left) and southeast (SE) (bottom-right) points. These points are key for specifying the spatial extent of an map. Localization and internationalization Amazon Location Service supports localization features that allow developers to customize maps for specific languages and regions. This includes support for local place names and the ability to render maps in different languages. Style Standard Monochrome Political View Languages Argentina, Cyprus, Egypt, Georgia, Greece, Kenya, Morocco, Palestine, Serbia, Russia, Sudan, Suriname, Syria, Türkiye, Tanzania, Uruguay Argentina, Cyprus, Egypt, Georgia, Greece, Kenya, Morocco, Palestine, Serbia, Supported through client-side library. Supported through client-side library. Localization and internationalization 120 Amazon Location Service Developer Guide Style Political View Languages Hybrid Russia, Sudan, Suriname, Syria, Türkiye, Tanzania, Uruguay Argentina, Cyprus, Egypt, Georgia, Greece, Kenya, Morocco, Palestine, Serbia, Russia, Sudan, Suriname, Syria, Türkiye, Tanzania, Uruguay Supported through client-side library. Satellite Not required Not required Languages Amazon Location Service provide Maps APIs that allow you to customize the language of map labels and text elements. This capability enables your applications to cater to a global audience or regions with multiple languages. By displaying maps in the user’s preferred language, you enhance the overall user experience, making the maps more accessible and relevant to your diverse user base. For more information, see How to set a preferred language for a map. Localization and internationalization 121 Amazon Location Service Developer Guide Political view By default, Amazon Location Service present an international perspective, which visually represents disputed territories with dashed borders. To switch from the international perspective to a country- specific geopolitical view, you must use the political view parameter in your API query. This helps businesses comply with local laws, as certain countries require adherence to their specific geopolitical views for maps and map data. In addition to the default international perspective, Amazon Location Service supports the geopolitical views of the following countries: Argentina, Cyprus, Egypt, Georgia, Greece, Kenya, Morocco, Palestine, Serbia, Russia, Sudan, Suriname, Syria, Türkiye, Tanzania, and Uruguay. To activate a geopolitical view, pass the appropriate value to the political view parameter. For more information, see How to set the political view of a map. Localization and internationalization 122 Amazon Location Service Developer Guide AWS map styles and customization Map styles overview To request a map, you must choose first a map style. Map styles define the visual appearance of the rendered map, including the styling for map tiles, glyphs, and sprites. Map tiles can be either vector (MVT) or raster (image). While the style may change as you zoom in or out, it generally maintains a consistent theme. You can override parts or the entire style before passing it to the map rendering library. AWS map styles AWS map styles adhere to industry standards, offering a sophisticated and professional look. These styles reduce time-to-market and eliminate the need for dedicated cartographers to create map styles from scratch. These predesigned styles enable you to quickly and
amazon-location-developer-guide-040
amazon-location-developer-guide.pdf
40
the visual appearance of the rendered map, including the styling for map tiles, glyphs, and sprites. Map tiles can be either vector (MVT) or raster (image). While the style may change as you zoom in or out, it generally maintains a consistent theme. You can override parts or the entire style before passing it to the map rendering library. AWS map styles AWS map styles adhere to industry standards, offering a sophisticated and professional look. These styles reduce time-to-market and eliminate the need for dedicated cartographers to create map styles from scratch. These predesigned styles enable you to quickly and effectively create visually appealing maps for your end users. By leveraging the predesigned AWS map styles, you can bypass the time-consuming and resource- intensive process of designing and constructing map styles from scratch. This accelerates your development process, allowing you to focus on core functionalities. Map styles 123 Dynamic Map: Yes, Static Maps: No Dynamic Map: Yes, Static Maps: No Dynamic Map: Yes, Static Maps: No Amazon Location Service Developer Guide Map style name Description Color scheme Supports Standard Colored map style Dark and Light Monochrome Grey scale map styles Dark and Light Hybrid Satellite Road and label overlay on satellite imagery Satellite imagery-b ased map style Not Applicable Not Applicable Dynamic Map: Yes, Static Maps: Yes Amazon Location Service provides styles following the MapLibre GL style specification. Standard map style The Standard map style is a clean and modern general-purpose map design that fits beautifully and functionally into almost any application or website. To learn more, see Standard map style. Standard map style 124 Amazon Location Service Developer Guide Monochrome map style The Monochrome map style is a minimalist canvas with a constrained color palette, designed for use with data visualization overlays. The Monochrome style offers both light and dark modes, communicating all the essential information needed for geographic context. To learn more, see the section called “Monochrome map style”. Hybrid map style The hybrid map style combines global satellite imagery with clear labels and configurable POI categories from our vector maps. To learn more, see the section called “Hybrid map style”. Monochrome map style 125 Amazon Location Service Developer Guide Satellite map style The Satellite map style presents high-resolution, real-world imagery captured by satellites, offering a realistic view of landscapes, buildings, and terrain. This style typically includes minimal labels or overlays to keep the focus on geographical details. Satellite map style 126 Amazon Location Service Standard map style Developer Guide The Standard map style offers a clean, modern, and general-purpose map design that can seamlessly fit into almost any application or website. Color scheme The Standard map style comes in both light and dark modes. The light mode is versatile and can fit into any context, while the dark mode features a constrained palette, designed to show details clearly and maintain readability in darker environments. This ensures minimal distractions, especially in scenarios such as night-time navigation. Forest Standard map style 127 Amazon Location Service Road Developer Guide City Standard map style 128 Amazon Location Service Neighborhood Developer Guide A pleasing, modern palette Soft colors provide important land-use context without overwhelming the map, offering useful information at both high and low zoom levels. Zoomed out, features such as forests, deserts, and glaciers add richness to the map. When zoomed in, a range of colors highlights important landmarks like schools, hospitals, recreation areas (like parks and sports facilities), and urban districts like commercial and industrial zones. The overall style features a cohesive color palette, including POI markers that complement their respective land-use areas. The road network is displayed in shades of gray, providing detail without overwhelming the map with bright, distracting colors. Standard map style 129 Amazon Location Service Highway Developer Guide Beach Standard map style 130 Amazon Location Service Island Developer Guide Neighborhood Standard map style 131 Amazon Location Service Intersection Developer Guide Roundabout Rich points of interest (POI) The Standard map style supports a rich array of configurable points of interest (POIs). With just a few lines of code, you can select the POI categories relevant to your use case. Standard map style 132 Amazon Location Service Developer Guide Designed for the world The Standard style supports different political views, ensuring that maps display the correct borders for your users. The style also allows easy language switching for map labels, with dozens of supported languages and writing systems. To learn more, see the section called “Localization and internationalization”. Standard map style 133 Amazon Location Service Languages Developer Guide Political view Land use The Standard map style uses vibrant colors to indicate designated land uses. Greens represent forests, grass, golf courses, sports centers, and parks. Relevant colors are used for water bodies, Standard map style 134 Amazon Location Service Developer Guide glaciers, deserts, and beaches. Additionally, land uses such
amazon-location-developer-guide-041
amazon-location-developer-guide.pdf
41
political views, ensuring that maps display the correct borders for your users. The style also allows easy language switching for map labels, with dozens of supported languages and writing systems. To learn more, see the section called “Localization and internationalization”. Standard map style 133 Amazon Location Service Languages Developer Guide Political view Land use The Standard map style uses vibrant colors to indicate designated land uses. Greens represent forests, grass, golf courses, sports centers, and parks. Relevant colors are used for water bodies, Standard map style 134 Amazon Location Service Developer Guide glaciers, deserts, and beaches. Additionally, land uses such as commercial, industrial, airports, military zones, medical facilities, and educational areas are highlighted with specific vibrant categories. Light Standard map style 135 Amazon Location Service Dark Developer Guide Monochrome map style The Monochrome style is a minimalist canvas with a constrained color palette, designed for use with data visualization overlays. This style supports both light and dark modes, each of which communicates all the essential information needed for geographic context. Color schemes The Monochrome style offers color choices for both dark and light modes. Monochrome map style 136 Amazon Location Service Continent Developer Guide Neighborhood Use cases The Monochrome style is well-suited for data visualization and minimalistic design needs. Data visualization The Monochrome style deliberately uses only shades of gray, allowing you complete freedom of color choice for data overlay layers such as choropleths, heatmaps, or dot maps. Monochrome map style 137 Amazon Location Service Developer Guide Minimalist design To maintain a clean and unobtrusive map, the Monochrome styles include a reduced set of points of interest (POIs) for essential features, such as airports, parks, hospitals, and universities. Airport Monochrome map style 138 Amazon Location Service Neighborhood Developer Guide Although the Monochrome style includes a reduced set of POIs, the underlying tiles still contain the complete set of POI data. This allows you to display POIs that are not visually present in the style. Designed for the world The Monochrome style supports different political views, ensuring that maps display the correct borders for your users. The style also allows for easy switching between languages for map labels, with dozens of supported languages and writing systems. Monochrome map style 139 Amazon Location Service Developer Guide Hybrid map style The Hybrid map style combines global satellite imagery with the same clear labels and configurable points of interest (POI) categories found in the Standard map style. This combination provides rich geographic detail while ensuring readability and usability for your application. Rich points of interest (POI) The labels and POIs have been specifically designed for contrast and readability, providing the necessary context for the satellite layer without distracting from the detailed imagery. Light road lines highlight the urban structure when zoomed out and gradually fade as you zoom in, revealing more detailed street-level information. Hybrid map style 140 Amazon Location Service Zoom Developer Guide Neighborhood Hybrid map style 141 Amazon Location Service Zoomed-in Developer Guide Designed for the world The Hybrid style supports different political views, ensuring that the map displays the correct borders for your users. This style also allows for easy switching between languages for map labels, with dozens of supported languages and writing systems available to ensure a localized experience. Map APIs Maps provide access to both dynamic and static map types for a variety of applications. For more information, See Maps. • Dynamic Maps: Interactive maps that can be customized in real time, allowing users to pan, zoom, and overlay data. For more information, See the section called “Dynamic maps”. • Static Maps: Static images of maps that display specific locations or routes without interactive elements, suitable for applications with limited interactivity. For more information, See the section called “Static maps”. The following table presents a number of business use cases that are best solved with Maps APIs. Maps use cases The following section presents a number of business use cases that are best solved with Maps APIs. Map APIs 142 Amazon Location Service Developer Guide Business need Useful API Examples Display interactive maps Supports map gestures, such as zoom, pan, ease, fly, pitch, rotate, and bearing. Add markers to a map Examples are markers, icon, and more. Add user interaction components to a map Examples are showing map in preferred language or geo- political view. Visualize real time or pre- recorded data on a map Examples are heat map, KML, GeoJSON features, polygons, rectangles, polylines, circles, markers, and more. Display map with localizat ion Examples are showing map in preferred language or geo- political view. GetTile and GetStyleD escriptor with rendering engine (MapLibre) the section called “Display a map” GetTile and GetStyleD escriptor with rendering engine (MapLibre) GetTile and GetStyleD escriptor with rendering engine (MapLibre) the section called “Add a marker on the map” the section called “Add an
amazon-location-developer-guide-042
amazon-location-developer-guide.pdf
42
interaction components to a map Examples are showing map in preferred language or geo- political view. Visualize real time or pre- recorded data on a map Examples are heat map, KML, GeoJSON features, polygons, rectangles, polylines, circles, markers, and more. Display map with localizat ion Examples are showing map in preferred language or geo- political view. GetTile and GetStyleD escriptor with rendering engine (MapLibre) the section called “Display a map” GetTile and GetStyleD escriptor with rendering engine (MapLibre) GetTile and GetStyleD escriptor with rendering engine (MapLibre) the section called “Add a marker on the map” the section called “Add an icon on the map” the section called “Add control on the map” the section called “Add a popup to a map” GetTile and GetStyleD escriptor with rendering engine (MapLibre) the section called “Add a line on the map” the section called “Add a polygon on the map” GetTile and GetStyleD escriptor with rendering engine (MapLibre) the section called “Set a preferred language for a map” Display a static map image GetStaticMap the section called “Set the political view of a map” the section called “Get a static map of a specific position” Maps 143 Amazon Location Service Developer Guide Business need Useful API Examples For example, use map image in application, email, report, or print. Add marker to a map image GetStaticMap the section called “Get a static map of a specific dimension” the section called “Decide between radius and zoom for a static map” the section called “Add scale for a static map” the section called “Add a marker to a static map” Examples are markers, proximity circle, icon, and more. Visualize data on a map image Examples are GeoJSON features, polygons, rectangle s, polylines, circles, and more. GetStaticMap the section called “Add a line to a static map” Visualize real world use case on a map GetStaticMap the section called “Add a route to a static map” Examples include routes, proximity circle, and more. Visualize Places search and/ or geocode result on a map All APIs return geocoordi nates, except autocomplete. GetTile and GetStyleD escriptor with rendering engine (MapLibre) with Places API Draw a route on a map Supports waypoint marking. GetTile and GetStyleD escriptor with rendering engine (MapLibre) with Calculate route Maps 144 Amazon Location Service Developer Guide Business need Useful API Examples Visualize matched GPS traces on a map Supports travel modes, such as truck, pedestrian, car, and scooter. GetStyleDescriptor with rendering engine (MapLibre) with Snap to road Dynamic maps Note You must use the political view feature to comply with applicable laws, including those related to mapping the country or region where maps, images, and other data you access through Amazon Location Service are made available. Dynamic maps, also known as interactive maps, are digital maps that support gestures such as zoom, pan, ease, fly, pitch, rotate, and bearing. With Amazon Location Service, you can build map applications that provide responsive, interactive, and immersive experiences for your users. These maps help users visualize and analyze real-time and historical data based on user input, allowing them to pan, zoom, and explore the map in real-time. Maps offered by Amazon Location Service also support multiple languages and political views. Learn more about the section called “Localization and internationalization”. Dynamic maps 145 Amazon Location Service City Developer Guide Roads Dynamic maps 146 Amazon Location Service Park Developer Guide For more information about AWS Map Styles, see the section called “Map styles”. Common use cases Analyze and visualize data Overlay your data onto high-quality maps to uncover transformative spatial patterns and trends. Empower your teams to create customizable, interactive map visualizations with your geographic data. Use maps and data to optimize site selection, plan infrastructure, or analyze market opportunities. Enhance real estate experiences Provide prospective buyers with comprehensive location context for real estate listings. Display the property's exact location along with surrounding neighborhood details such as jurisdictional boundaries, local businesses, parks, and schools. Help customers find directions to your open houses and create informative, location-centric real estate experiences. Build engaging travel experiences Display dynamic maps showcasing destinations, with detailed street views and key geographic features. Highlight points of interest such as hotels, restaurants, and attractions for tourists and travelers. Plot outdoor amenities like hiking trails to help users plan their ideal itinerary. Dynamic maps 147 Amazon Location Service Rendering dynamic maps Developer Guide A map rendering engine is a library responsible for the visual rendering of maps on digital screens. The rendering engine stitches map tiles (vector, hybrid, satellite), map data (points, lines, polygons), or raster data (imagery) together to display an interactive map in web browsers or native apps. Amazon Location Service recommends using the MapLibre rendering engine, which supports both web and mobile (iOS and Android) platforms. MapLibre also provides a plugin model and supports user interfaces
amazon-location-developer-guide-043
amazon-location-developer-guide.pdf
43
Plot outdoor amenities like hiking trails to help users plan their ideal itinerary. Dynamic maps 147 Amazon Location Service Rendering dynamic maps Developer Guide A map rendering engine is a library responsible for the visual rendering of maps on digital screens. The rendering engine stitches map tiles (vector, hybrid, satellite), map data (points, lines, polygons), or raster data (imagery) together to display an interactive map in web browsers or native apps. Amazon Location Service recommends using the MapLibre rendering engine, which supports both web and mobile (iOS and Android) platforms. MapLibre also provides a plugin model and supports user interfaces for searching and routing in various languages. For more information, see the section called “Create your first Maps and Places application” and the section called “Dynamic maps”. Requesting map assets The rendering engine uses a map style, which contains references to map tiles, sprites (icons), and glyphs (fonts). As users interact with the map—loading, panning, or zooming—the rendering engine calls APIs (for tiles, sprites, and glyphs) with the desired input parameters. You can also directly call these APIs based on your application's needs. Map tiles Small square tiles containing data that are retrieved from servers and assembled by a rendering engine to create an interactive digital map. Map style A collection of rules that define the visual appearance of the map, such as colors and styles. Amazon Location Service follows the Mapbox GL style specification. Glyph file A binary file containing encoded Unicode characters, used by the map renderer to display text labels. Sprite file A Portable Network Graphics (PNG) image file that contains small raster images, with location descriptions in a JSON file. Used by the map renderer to render icons or textures on the map. Dynamic maps 148 Amazon Location Service Tiles Developer Guide Map tiles are pre-rendered, small sections of a larger map, typically displayed as square images. They are used to efficiently display geographic data by loading only the visible portions at different zoom levels. There are three main types of map tiles: Tile types Vector map tiles Vector map tiles store map data as geometric shapes (points, lines, polygons) rather than as images. This enables the creation of high-quality, scalable maps that remain clear at any resolution. Raster map tiles Raster map tiles are pre-rendered images representing a specific geographic area. Unlike vector tiles, raster tiles are simpler but lack flexibility for restyling. Hybrid map tiles Hybrid map tiles combine both vector and raster data. They use vector data for core map elements, such as roads, while using raster imagery for more complex elements like detailed satellite or aerial photography. Vector tile layers The following are the 10 layers of vector map tiles: • Boundaries: Defines administrative and geographic boundaries, including country, state, and city borders. • Buildings and addresses: Represents building shapes and detailed address points. • Earth: Shows global terrain and surface coverage for natural features like deserts, mountains, and forests. • Land use: Displays categorized areas such as parks, farmland, and urban zones. • Places: Identifies important locations like cities, towns, and notable landmarks. • Points of interest (POIs): Highlights attractions, businesses, and other key locations. • Roads: Represents the network of streets, highways, and pathways. • Road labels: Provides text labels for road names and route numbers. Dynamic maps 149 Amazon Location Service Developer Guide • Transit: Depicts public transport lines such as buses, trains, and subways. • Water: Displays bodies of water, including lakes, rivers, and oceans. Use cases • Fetching map tiles for rendering different sections of a map at various zoom levels. • Optimizing map tile requests based on user interaction, such as panning and zooming. • Accessing vector or raster tiles for detailed rendering purposes. Understand the request The request requires the following parameters: Tileset, X, Y, and Z to identify the specific tile to be fetched. The Key parameter can be optionally included for authorization. • Tileset: Specifies the desired tileset for fetching the tile. • X: The X-axis value for the map tile. • Y: The Y-axis value for the map tile. • Z: The zoom value, defining the zoom level for the tile. • Key: Optionally included for authorization purposes. Understand the response The response includes headers such as CacheControl, ContentType, and ETag, and contains the map tile data as a binary blob in MVT format. These headers manage cache control, provide content format details, and version control for tiles. • CacheControl: Controls client-side caching for the map tile. • ContentType: Specifies the format of the tile data. • ETag: Provides a version identifier for the tile. • Blob: Contains the vector tile data in MVT format. Style dynamic maps Amazon Location Service provides two options for styling your dynamic maps: using predesigned AWS Map Styles or customizing the map style using style descriptors.
amazon-location-developer-guide-044
amazon-location-developer-guide.pdf
44
response includes headers such as CacheControl, ContentType, and ETag, and contains the map tile data as a binary blob in MVT format. These headers manage cache control, provide content format details, and version control for tiles. • CacheControl: Controls client-side caching for the map tile. • ContentType: Specifies the format of the tile data. • ETag: Provides a version identifier for the tile. • Blob: Contains the vector tile data in MVT format. Style dynamic maps Amazon Location Service provides two options for styling your dynamic maps: using predesigned AWS Map Styles or customizing the map style using style descriptors. Dynamic maps 150 Amazon Location Service Developer Guide Use predesigned AWS map styles AWS map styles are predefined styles that adhere to industry standards to deliver a sophisticated, professional aesthetic. By leveraging these styles in Amazon Location Service, you can reduce time- to-market and eliminate the need for dedicated cartographers to create map styles from scratch. For more information, see the section called “Map styles”. To learn more about predefined map styles, see: • the section called “Standard map style” • the section called “Monochrome map style” • the section called “Hybrid map style” • the section called “Satellite map style” Benefits of using AWS map styles • Time and resource efficiency: AWS Map Styles allow you to bypass the time-consuming and resource-intensive process of designing map styles from scratch. This allows you to focus on core functionalities while providing visually appealing maps. • Professional and consistent aesthetics: Skilled cartographers have meticulously crafted AWS Map Styles, following industry best practices. Every detail, from color palettes to label placements, has been optimized for clarity and legibility. • Seamless integration: AWS Map Styles integrate seamlessly with your application's design language, providing a polished and consistent mapping experience for your end-users. Get started with AWS map styles • Check the AWS map styles offering: In the Amazon Location Service console, navigate to the Map section to explore the available styles. • Choose the style that matches your needs: Select the style that best aligns with your application's design and user experience requirements. • Integrate the style: Follow the provided documentation to integrate the chosen style into your application using Amazon Location Service APIs or SDKs. Learn more about the section called “Display a map”. Dynamic maps 151 Amazon Location Service Use cases Developer Guide • Customizing map styles based on color schemes like "Light" or "Dark". • Displaying maps according to specific political views or geographic boundaries. • Optimizing map styles for different use cases, such as logistics or default views. Understand the request The request supports parameters like ColorScheme, Key, and PoliticalView to define the map's style and presentation. The Style parameter is required to specify the desired map style. • ColorScheme: Sets the map's color tone, such as "Light" or "Dark". • PoliticalView: Specifies the political view for map visualization. • Style: Defines the style of the map, like "Standard" or "Monochrome". Understand the response The response provides headers like CacheControl, ContentType, and ETag, and contains the style descriptor as a JSON blob. The headers give caching information, content format details, and versioning for style changes. • CacheControl: Controls caching configurations for the style descriptor. • ContentType: Indicates the response format as JSON. • ETag: Provides a version identifier for the style descriptor. • Blob: Contains the body of the style descriptor in JSON format. Customize style descriptors To customize map styles, you must understand the structure of the style descriptor, which is usually a JSON object defining the visual representation of map elements. The style descriptor comprises several layers, each controlling the style for a specific type of map element, such as roads, parks, buildings, or labels. • Use a predefined style descriptor as a base: You can either start with a predefined style descriptor or create one from scratch using map style editors such as Maputnik. Dynamic maps 152 Amazon Location Service Developer Guide • Understand the structure: The style descriptor is a hierarchical JSON object that contains layers, each representing a different map element. Each layer has properties that control the visual appearance of that element, such as color, opacity, and line width. • Modify styles for layers: Depending on the map style editor you’re using, you can change existing layers or add new ones to customize the style. For example, you can adjust the color of roads, modify the font size of labels, or add custom icons for specific locations. • Define styles for different zoom levels: Map style editors allow you to define different styles for different zoom levels, which is useful for controlling the level of detail and visibility based on user zoom interactions. • Test and iterate: After modifying or creating the style descriptor, test the customized style on a map to ensure it
amazon-location-developer-guide-045
amazon-location-developer-guide.pdf
45
Depending on the map style editor you’re using, you can change existing layers or add new ones to customize the style. For example, you can adjust the color of roads, modify the font size of labels, or add custom icons for specific locations. • Define styles for different zoom levels: Map style editors allow you to define different styles for different zoom levels, which is useful for controlling the level of detail and visibility based on user zoom interactions. • Test and iterate: After modifying or creating the style descriptor, test the customized style on a map to ensure it displays as intended. Iterate and adjust until you achieve the desired visual style. Style iconography with sprites A sprite is a Portable Network Graphic (PNG) image file that contains small raster images such as icons, markers, and other elements rendered on a map. Sprites can be customized based on parameters like style, color scheme, and variant. Amazon Location Service provides a sprite sheet through the GetSprites API. You can also use custom icons by either loading your own icon set (see the section called “Add an icon on the map”) or customizing the style descriptor to load your custom sprites. Use cases • Rendering custom map elements using sprite sheets for specific styles and color schemes. • Fetching sprites for various map styles such as Standard, Monochrome, or Hybrid. • Customizing iconography on the map by modifying sprites. Understand the request The request requires URI parameters such as ColorScheme, FileName, and Style. These parameters allow for the customization of the sprite sheet based on the map's color scheme, style, and the specific sprite file required. • ColorScheme: Defines the color scheme for the sprites, such as "Light" or "Dark". • FileName: The name of the sprite file to retrieve, which could be a PNG or JSON file. Dynamic maps 153 Amazon Location Service Developer Guide • Style: Specifies the map style, such as "Standard" or "Monochrome". Understand the response The response contains headers such as CacheControl, ContentType, and ETag, and returns the sprite data as either a binary blob or a JSON file. These headers provide caching information, the content type of the response, and version control for the sprite data. • CacheControl: Caching configurations for the sprite file. • ContentType: The format of the response, indicating whether it contains PNG or JSON data. • ETag: Identifier for the sprite's version, used for cache validation. • Blob: Contains the body of the sprite sheet or the JSON offset file. Standard Light Standard Dark Monochrome Light Monochrome Dark Dynamic maps 154 Amazon Location Service Hybrid Developer Guide Style labels with glyphs Glyphs are binary files containing encoded Unicode characters, which are used by a map renderer to display labels. Amazon Location Service enables the retrieval of specific glyphs from a font stack for use in map rendering through the GetGlyphs API. Use cases • Rendering custom text on maps with specific fonts and styles. • Fetching glyphs for localized map text rendering. • Using Unicode character ranges to display map labels and symbols. • Optimizing map font rendering based on font stacks and glyph ranges. Supported fonts in API The following fonts are supported in the API: • Amazon Ember Bold • Amazon Ember Bold Italic • Amazon Ember Bold,Noto Sans Bold • Amazon Ember Bold,Noto Sans Bold,Noto Sans Arabic Bold • Amazon Ember Condensed RC BdItalic • Amazon Ember Condensed RC Bold • Amazon Ember Condensed RC Bold Italic • Amazon Ember Condensed RC Bold,Noto Sans Bold • Amazon Ember Condensed RC Bold,Noto Sans Bold,Noto Sans Arabic Condensed Bold • Amazon Ember Condensed RC Light • Amazon Ember Condensed RC Light Italic Dynamic maps 155 Amazon Location Service Developer Guide • Amazon Ember Condensed RC LtItalic • Amazon Ember Condensed RC Regular • Amazon Ember Condensed RC Regular Italic • Amazon Ember Condensed RC Regular,Noto Sans Regular • Amazon Ember Condensed RC Regular,Noto Sans Regular,Noto Sans Arabic Condensed Regular • Amazon Ember Condensed RC RgItalic • Amazon Ember Condensed RC ThItalic • Amazon Ember Condensed RC Thin • Amazon Ember Condensed RC Thin Italic • Amazon Ember Heavy • Amazon Ember Heavy Italic • Amazon Ember Light • Amazon Ember Light Italic • Amazon Ember Medium • Amazon Ember Medium Italic • Amazon Ember Medium,Noto Sans Medium • Amazon Ember Medium,Noto Sans Medium,Noto Sans Arabic Medium • Amazon Ember Regular • Amazon Ember Regular Italic • Amazon Ember Regular Italic,Noto Sans Italic • Amazon Ember Regular Italic,Noto Sans Italic,Noto Sans Arabic Regular • Amazon Ember Regular,Noto Sans Regular • Amazon Ember Regular,Noto Sans Regular,Noto Sans Arabic Regular • Amazon Ember Thin • Amazon Ember Thin Italic • AmazonEmberCdRC_Bd • AmazonEmberCdRC_BdIt • AmazonEmberCdRC_Lt Dynamic maps 156 Amazon Location Service • AmazonEmberCdRC_LtIt • AmazonEmberCdRC_Rg • AmazonEmberCdRC_RgIt • AmazonEmberCdRC_Th • AmazonEmberCdRC_ThIt • AmazonEmber_Bd
amazon-location-developer-guide-046
amazon-location-developer-guide.pdf
46
Light Italic • Amazon Ember Medium • Amazon Ember Medium Italic • Amazon Ember Medium,Noto Sans Medium • Amazon Ember Medium,Noto Sans Medium,Noto Sans Arabic Medium • Amazon Ember Regular • Amazon Ember Regular Italic • Amazon Ember Regular Italic,Noto Sans Italic • Amazon Ember Regular Italic,Noto Sans Italic,Noto Sans Arabic Regular • Amazon Ember Regular,Noto Sans Regular • Amazon Ember Regular,Noto Sans Regular,Noto Sans Arabic Regular • Amazon Ember Thin • Amazon Ember Thin Italic • AmazonEmberCdRC_Bd • AmazonEmberCdRC_BdIt • AmazonEmberCdRC_Lt Dynamic maps 156 Amazon Location Service • AmazonEmberCdRC_LtIt • AmazonEmberCdRC_Rg • AmazonEmberCdRC_RgIt • AmazonEmberCdRC_Th • AmazonEmberCdRC_ThIt • AmazonEmber_Bd • AmazonEmber_BdIt • AmazonEmber_He • AmazonEmber_HeIt • AmazonEmber_Lt • AmazonEmber_LtIt • AmazonEmber_Md • AmazonEmber_MdIt • AmazonEmber_Rg • AmazonEmber_RgIt • AmazonEmber_Th • AmazonEmber_ThIt • Noto Sans Black • Noto Sans Black Italic • Noto Sans Bold • Noto Sans Bold Italic • Noto Sans Extra Bold • Noto Sans Extra Bold Italic • Noto Sans Extra Light • Noto Sans Extra Light Italic • Noto Sans Italic • Noto Sans Light • Noto Sans Light Italic • Noto Sans Medium Dynamic maps Developer Guide 157 Developer Guide Amazon Location Service • Noto Sans Medium Italic • Noto Sans Regular • Noto Sans Semi Bold • Noto Sans Semi Bold Italic • Noto Sans Thin • Noto Sans Thin Italic • NotoSans-Bold • NotoSans-Italic • NotoSans-Medium • NotoSans-Regular • Open Sans Regular,Arial Unicode MS Regular Understand the request The request accepts two required URI parameters, FontStack and FontUnicodeRange, which determine the font and the Unicode range for glyphs. The FontStack parameter specifies which font to use, while the FontUnicodeRange defines the character range to fetch. The request does not include a body, focusing only on the URI parameters for its functionality. • FontStack: Specifies the name of the font stack to retrieve. Example: "Amazon Ember Bold, Noto Sans Bold". • FontUnicodeRange: A Unicode range of characters to download glyphs for. The range must be multiples of 256. Example: "0-255". Understand the response The response returns glyph data as a binary blob, along with HTTP headers for caching, content type, ETag, and pricing information. The glyph data is returned as a binary blob to be rendered on maps, and the headers provide additional metadata for handling the response effectively. • CacheControl: Instructs the client on caching configurations for the response. • ContentType: Specifies the format of the response body, indicating the type of glyph data returned. • ETag: An identifier for the glyph's version, used for cache validation. Dynamic maps 158 Amazon Location Service Developer Guide • PricingBucket: Indicates the pricing tier associated with the request. • Blob: The glyph data returned as a binary blob, used to render map text. Static maps Note Static maps only support Satellite style. For more information, see the section called “Map styles”. Static maps offer a pre-rendered representation of geographic data with the option to overlay markers (or pins), routes, and polygon areas, as needed for your application. The Static Map lets you generate static (non-interactive) map images based on customizable parameters and data inputs. By customizing overlays, shapes, or applying custom styles, Static Map enables you to create map visualizations that meet specific needs, enhancing the end-user experience and effectively communicating geographical information. The server customizes the requested map images and delivers them to the client as JPEG files. You can programmatically request and generate map images tailored to your specific requirements. The GetStaticMap API generates a static image of a map based on specified parameters like center coordinates, bounding boxes, or overlays. The API allows customization of map features and style, enabling use in web or mobile applications without interactive map functionality. Common use cases • Embedded maps in web or mobile application: Static map images can be efficiently embedded in websites or mobile applications to provide visualizations of locations, routes, or points of interest with non-interactive maps, reducing load times and data usage. Examples include search engines (such as Yahoo) showing map images with search results for POIs. • Location details in e-mails: Static map images can be used to share location information via email to help your end users understand the context of the email. For example, food delivery or ride-sharing apps use static map images to display pickup/drop-off locations, routes, or surrounding areas in post-trip or delivery emails containing bill and summary. • Marketing materials and printed documents: Customized static map images can be incorporated into brochures, flyers, or other printed materials, providing visually appealing representations of geographical information relevant to the content. Static maps 159 Amazon Location Service Understand the request Developer Guide The request includes optional URI parameters, like BoundedPositions, BoundingBox, and Center, among others, to define the visible area and overlays of the map. The parameters Height and Width are required for defining the image size. To learn
amazon-location-developer-guide-047
amazon-location-developer-guide.pdf
47
use static map images to display pickup/drop-off locations, routes, or surrounding areas in post-trip or delivery emails containing bill and summary. • Marketing materials and printed documents: Customized static map images can be incorporated into brochures, flyers, or other printed materials, providing visually appealing representations of geographical information relevant to the content. Static maps 159 Amazon Location Service Understand the request Developer Guide The request includes optional URI parameters, like BoundedPositions, BoundingBox, and Center, among others, to define the visible area and overlays of the map. The parameters Height and Width are required for defining the image size. To learn more, see the section called “Customize static maps” and the section called “Overlay on the static map”. • BoundedPositions: Coordinates to encompass in the image. • BoundingBox: Coordinates defining the south-west and north-east edges of the map. • Height: Specifies the height of the image. • Width: Specifies the width of the image. • GeoJsonOverlay: A valid GeoJSON object for adding overlays. Understand the response The response contains headers like CacheControl, ContentType, and ETag, and returns the static map as a binary blob in either JPEG or PNG format. The headers provide metadata like cache control, content type, and version for static images. • CacheControl: Specifies caching configurations for the map image. • ContentType: Indicates the format of the map image (JPEG or PNG). • ETag: An identifier for the version of the static map image. • Blob: Represents the map image in either JPEG or PNG format. Customize static maps Note Static maps only support the Satellite style. For more information, see the section called “Map styles”. This section provides an overview of how to customize static maps generated using Amazon Location Service. It covers various features, such as adjusting the map's position, size, language, scale, overlays, and attribution, enabling you to tailor the map to your specific requirements. Static maps 160 Amazon Location Service Position Developer Guide The position allows you to define the center and boundaries of the map. You can control the map's focus by setting the center coordinates, a bounding box, or using a zoom level to determine how much area to display. To learn how it works, see the section called “Get a static map of a specific position”. • Center: Defines the center point of the map using longitude and latitude coordinates. • Radius: Specifies the radius (distance from the center) that will be displayed on the static map. • Bounding Box: Defines a rectangular area of the map, set by providing the coordinates of the top-left and bottom-right corners. • Zoom: Controls the zoom level of the map. Higher zoom levels show more detail in a smaller area, while lower zoom levels show less detail over a larger area. Dimension and quality You can customize the size and visual quality of the static map by defining its dimensions (height and width) and adding padding for better presentation of markers and other elements. To learn how it works, see the section called “Get a static map of a specific dimension”. • Height and Width: Specifies the size of the static map image by defining its height and width in pixels. • Padding: Adds extra space around the edges of the map, allowing for better visualization when placing markers, lines, or shapes. Scale The scale provides control over the scale of the map and defines the units (kilometers, miles) to measure distances. This is useful for accurately representing the map's size and distance relationships. To learn how it works, see the section called “Add scale for a static map”. • Scale Unit: Defines the units for the map's scale bar (for example, kilometers or miles), allowing users to accurately gauge distances on the map. Static maps 161 Amazon Location Service Overlay Developer Guide You can add markers, lines to show routes, polygons to show areas, and more. To learn how it works, see the section called “Add a marker to a static map”, the section called “Add a line to a static map”, or the section called “Add a route to a static map”. Overlay on the static map This section explains how to overlay additional information onto static maps using Amazon Location Service. You can customize your static maps by adding various geographical features, such as points, lines, and polygons, to enhance the map's visual representation. Amazon Location Service supports multiple formats, including GeoJSON and a compact overlay format, to provide flexible and efficient ways of adding overlays. With GeoJSON GeoJSON is a versatile format that allows you to overlay custom data on static maps. By defining geographical features such as points, lines, and polygons, you can enhance the visual representation of your maps, providing valuable context for users. GeoJSON is widely supported and offers flexibility when it comes to styling and customizing
amazon-location-developer-guide-048
amazon-location-developer-guide.pdf
48
You can customize your static maps by adding various geographical features, such as points, lines, and polygons, to enhance the map's visual representation. Amazon Location Service supports multiple formats, including GeoJSON and a compact overlay format, to provide flexible and efficient ways of adding overlays. With GeoJSON GeoJSON is a versatile format that allows you to overlay custom data on static maps. By defining geographical features such as points, lines, and polygons, you can enhance the visual representation of your maps, providing valuable context for users. GeoJSON is widely supported and offers flexibility when it comes to styling and customizing map overlays, making it an ideal format for displaying regions, plotting routes, or showing spatial relationships. With Amazon Location Service, you can leverage GeoJSON to add dynamic, location-based features directly onto your static maps. This enables you to create highly customizable overlays that can be tailored to meet your specific business needs. GeoJSON supports several geometry types, including Point, LineString, Polygon, and MultiPolygon, allowing you to display a wide range of features, from markers and routes to complex area representations. Colors When styling GeoJSON features, you have flexibility in defining colors. You can specify colors using different formats, such as hexadecimal values (like #ff0000 for red) or with alpha transparency (like #ff000080 for semi-transparent red). This ensures your overlays can be visually consistent with the map style. If no color is specified, the default color for the selected map style will be applied. Drawing order Custom overlays are drawn in a specific order to maintain clarity and avoid visual clutter. In Amazon Location Service, overlay features like polygons, lines, and points will appear above the base map, but below map labels. The drawing order prioritizes polygons first, followed by lines, and then points or markers. Static maps 162 Amazon Location Service Measurement units Developer Guide For properties like width and outline-width, you can use different measurement units to specify size, including pixels (px), meters (m), kilometers (km), miles (mi), and percentages (%). The percentage unit adjusts the property relative to a default value, providing more flexibility in styling your overlays. Geometry types Amazon Location Service supports multiple GeoJSON geometry types, such as Point, LineString, Polygon, and MultiPolygon. Each geometry type can be styled and adjusted using the properties object in GeoJSON, allowing for extensive customization of markers, routes, and areas on your map. With compact overlay Note Compact overlay supports the following geometry types: point, line, and polygon. It doesn't support multiPoint, multiLine, or multiPolgyon. The compact overlay option allows you to efficiently display multiple geometries on a static map by using a single query parameter. This streamlined approach simplifies the request format and reduces the size of the request, making it easier to transmit overlay data. Customers can input various geometry types and their corresponding style properties in one query parameter, and Amazon Location Service will handle the heavy lifting by parsing and rendering the overlay as specified. While using the compact overlay format, keep in mind that there are limits on the size of the request URL. Although Amazon Location Service optimizes the query, ensure that your request stays within reasonable limits, especially when dealing with multiple geometries and their associated properties. Format The compact overlay format is structured as follows: geometry_type:geometry;property_1=value_1;property_2=value_2| geometry_type:geometry;property_1=value_1... Static maps 163 Amazon Location Service Developer Guide Each geometry type is defined along with its style properties. Multiple geometries are separated by a pipe operator (|), and properties for each geometry are separated using a semicolon. Supported geometry types Amazon Location Service supports several geometry types, including Point, MultiPoint, LineString, Polygon, and MultiPolygon. These geometry types can be combined and styled within the same query parameter using the compact overlay format. Styling properties Each geometry can be customized using various style properties, such as color, outline color, size, and more. These properties allow you to control the appearance of each geometry on the map, ensuring that the overlay aligns with your business requirements. How to This section contains a variety of how to guides and examples for how to use Maps APIs. Examples • How to use dynamic maps • How to use static maps How to use dynamic maps These how-to topics offer a comprehensive walkthrough teaching you how to enhance your mapping applications using the Amazon Location Service. From displaying interactive maps to adding markers, lines, and polygons, these tutorials demonstrate how to utilize essential features like setting map controls, adding custom icons, and handling real-time data. Furthermore, the topics also cover localization and internationalization aspects, such as setting preferred languages, adjusting political views, and ensuring compliance with regional laws by customizing map content based on the user’s location or perspective. Each how-to is designed to be accessible, with step-by-step instructions for implementing these features in web applications using MapLibre GL JS.
amazon-location-developer-guide-049
amazon-location-developer-guide.pdf
49
a comprehensive walkthrough teaching you how to enhance your mapping applications using the Amazon Location Service. From displaying interactive maps to adding markers, lines, and polygons, these tutorials demonstrate how to utilize essential features like setting map controls, adding custom icons, and handling real-time data. Furthermore, the topics also cover localization and internationalization aspects, such as setting preferred languages, adjusting political views, and ensuring compliance with regional laws by customizing map content based on the user’s location or perspective. Each how-to is designed to be accessible, with step-by-step instructions for implementing these features in web applications using MapLibre GL JS. Whether your goal is to build a dynamic map experience with custom icons and popups or to tailor map views for specific political perspectives and languages, these examples will help you achieve your objectives while ensuring a rich, localized mapping experience for users across different regions. These tutorials ensure that you can fully How to 164 Amazon Location Service Developer Guide leverage the capabilities of Amazon Location Service, from basic mapping functions to complex geopolitical and localization needs. Topics • How to display a map • How to add control on the map • How to add a marker on the map • How to add an icon on the map • How to add a line on the map • How to add a polygon on the map • How to add a popup to a map • How to set a preferred language for a map • How to set the political view of a map • How to filter POI on the map How to display a map Amazon Location Service allows you to display both interactive and non-interactive maps using our map styles. See the section called “Map styles” to learn more. Interactive map In this example, you will display an interactive map that allows users to zoom, pan, pinch, and pitch. Interactive map code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> Dynamic maps 165 Amazon Location Service Developer Guide <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https:// unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre- gl@4.x/dist/maplibre-gl.js'></script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; // e.g., Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // e.g., us-east-2, us-east-1, us-west-2, etc. const styleUrl = `https://maps.geo. ${awsRegion}.amazonaws.com/v2/styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', // container id style: styleUrl, // style URL center: [25.24, 36.31], // starting position [lng, lat] zoom: 2, // starting zoom }); </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Dynamic maps 166 Amazon Location Service Developer Guide Restrict map panning beyond an area In this example, you will restrict the map from being panned beyond a defined boundary. Restrict map panning code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/ maplibre-gl@4.x/dist/maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.js'></script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; // e.g., Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // e.g., us- east-2, us-east-1, us-west-2, etc. const styleUrl = `https://maps.geo. ${awsRegion}.amazonaws.com/v2/styles/${mapStyle}/descriptor?key=${apiKey}`; var bounds = [ [90.0, -21.943045533438166], // Southwest coordinates [146.25, 31.952162238024968] // Northeast coordinates ]; const map = new maplibregl.Map({ Dynamic maps 167 Amazon Location Service Developer Guide container: 'map', // container id style: styleUrl, // style URL maxBounds: bounds, // Sets bounds of SE Asia }); </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Non-interactive map In this example, you will display a non-interactive map by disabling user interaction. Non-interactive map code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> Dynamic maps 168 Amazon Location Service <script> Developer Guide const apiKey = "<API_KEY>"; const mapStyle = "Standard"; // e.g., Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // e.g., us-east-2, us-east-1, us- west-2, etc. const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', // container id style: styleUrl, // style URL center: [25.24, 36.31], // starting position [lng, lat] zoom: 2, // starting zoom interactive: false, // Disable pan & zoom handlers }); </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } How to add control on
amazon-location-developer-guide-050
amazon-location-developer-guide.pdf
50
id="map"></div> Dynamic maps 168 Amazon Location Service <script> Developer Guide const apiKey = "<API_KEY>"; const mapStyle = "Standard"; // e.g., Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // e.g., us-east-2, us-east-1, us- west-2, etc. const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', // container id style: styleUrl, // style URL center: [25.24, 36.31], // starting position [lng, lat] zoom: 2, // starting zoom interactive: false, // Disable pan & zoom handlers }); </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } How to add control on the map Amazon Location Service allows you to add multiple controls to the map, including navigation, geolocation, fullscreen, scale, and attribution controls. • Navigation control: Contains zoom buttons and a compass. • Geolocate control: Provides a button that uses the browser's geolocation API to locate the user on the map. • Fullscreen control: Contains a button for toggling the map in and out of fullscreen mode. • Scale control: Displays the ratio of a distance on the map to the corresponding distance on the ground. Dynamic maps 169 Amazon Location Service Developer Guide • Attribution control: Presents the map's attribution information. By default, the attribution control is expanded (regardless of map width). You can add the controls to any corner of the map: top-left, bottom-left, bottom-right, or top- right. Adding map controls In the following example, you'll add the map controls listed above. Map control code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Map Controls</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; // e.g., Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // e.g., us-east-2, us-east-1, us- west-2, etc. const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', // container id Dynamic maps 170 Amazon Location Service Developer Guide style: styleUrl, // style URL center: [-123.13203602550998, 49.28726257639254], // starting position [lng, lat] zoom: 10, // starting zoom attributionControl: false, // hide default attributionControl in bottom left }); // Adding controls to the map map.addControl(new maplibregl.NavigationControl()); // Zoom and rotation controls map.addControl(new maplibregl.FullscreenControl()); // Fullscreen control map.addControl(new maplibregl.GeolocateControl()); // Geolocation control map.addControl(new maplibregl.AttributionControl(), 'bottom- left'); // Attribution in bottom-left map.addControl(new maplibregl.ScaleControl(), 'bottom-right'); // Scale control in bottom-right </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Developer tips Navigation control options new maplibregl.NavigationControl({ showCompass: true, // show or hide compass (default: true) showZoom: true // show or hide zoom controls (default: true) }); Dynamic maps 171 Amazon Location Service Geolocate control options Developer Guide new maplibregl.GeolocateControl({ positionOptions: { enableHighAccuracy: true }, // default: false trackUserLocation: true // default: false }); Attribution control options new maplibregl.AttributionControl({ compact: true, // compact (collapsed) mode (default: false) }); Scale control options new maplibregl.ScaleControl({ maxWidth: 100, // width of the scale (default: 50) unit: 'imperial' // imperial or metric (default: metric) }); Fullscreen control options map.addControl(new maplibregl.FullscreenControl({ container: document.querySelector('body') // container for fullscreen mode })); How to add a marker on the map With Amazon Location, you can add both fixed and draggable markers, and you can also customize the color of the markers based on your data and preferences. Dynamic maps 172 Developer Guide Amazon Location Service Add a fixed marker Fixed marker code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Add marker on a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; // e.g., Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // e.g., us-east-2, us-east-1, us- west-2, etc. const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', // container id style: styleUrl, // style URL center: [0, 0], // starting position [lng, lat] zoom: 1, // starting zoom }); const marker = new maplibregl.Marker() // Create fixed marker .setLngLat([85.1376, 25.5941]) // Set coordinates [long, lat] for marker (e.g., Patna, BR, IN) .addTo(map); // Add marker to the map Dynamic maps 173 Amazon Location Service Developer Guide </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Add a draggable marker Draggable marker code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Add draggable marker on a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script
amazon-location-developer-guide-051
amazon-location-developer-guide.pdf
51
// Create fixed marker .setLngLat([85.1376, 25.5941]) // Set coordinates [long, lat] for marker (e.g., Patna, BR, IN) .addTo(map); // Add marker to the map Dynamic maps 173 Amazon Location Service Developer Guide </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Add a draggable marker Draggable marker code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Add draggable marker on a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; // e.g., Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // e.g., us-east-2, us-east-1, us- west-2, etc. Dynamic maps 174 Amazon Location Service Developer Guide const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', // container id style: styleUrl, // style URL center: [0, 0], // starting position [lng, lat] zoom: 1, // starting zoom }); const marker = new maplibregl.Marker({ draggable: true }) // Create draggable marker .setLngLat([85.1376, 25.5941]) // Set coordinates [long, lat] for marker (e.g., Patna, BR, IN) .addTo(map); // Add marker to the map </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Changing marker color Colorful marker code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Adding colorful marker on a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> Dynamic maps 175 Amazon Location Service Developer Guide <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Monochrome"; // e.g., Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // e.g., us-east-2, us-east-1, us- west-2, etc. const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', // container id style: styleUrl, // style URL center: [0, 0], // starting position [lng, lat] zoom: 1, // starting zoom }); const marker = new maplibregl.Marker({ color: "black" }) // Create colored marker .setLngLat([85.1376, 25.5941]) // Set coordinates [long, lat] for marker (e.g., Patna, BR, IN) .addTo(map); // Add marker to the map </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Dynamic maps 176 Developer Guide Amazon Location Service Add multiple markers Multiple markers code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Adding multiple markers on a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; // e.g., Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // e.g., us-east-2, us-east-1, us- west-2, etc. const colorScheme ="Dark"; // e.g., Dark, Light (default) const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?color-scheme=${colorScheme}&key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', // container id style: styleUrl, // style URL center: [0, 0], // starting position [lng, lat] zoom: 1, // starting zoom }); const locations = [ { lng: 85.1376, lat: 25.5941, label: 'Patna', color: '#FF5722' }, Dynamic maps 177 Amazon Location Service Developer Guide { lng: 77.1025, lat: 28.7041, label: 'Delhi', color: '#2196F3' }, { lng: 77.5946, lat: 12.9716, label: 'Bangalore', color: '#FF9800' }, { lng: 78.4867, lat: 17.3850, label: 'Hyderabad', color: '#9C27B0' }, { lng: -87.6298, lat: 41.8781, label: 'Chicago', color: '#4CAF50' }, { lng: -122.3321, lat: 47.6062, label: 'Seattle', color: '#FFC107' }, { lng: 4.3517, lat: 50.8503, label: 'Brussels', color: '#3F51B5' }, { lng: 2.3522, lat: 48.8566, label: 'Paris', color: '#E91E63' }, { lng: -0.1276, lat: 51.5074, label: 'London', color: '#795548' }, { lng: 28.0473, lat: -26.2041, label: 'Johannesburg', color: '#673AB7' }, { lng: -123.1216, lat: 49.2827, label: 'Vancouver', color: '#FF5722' }, { lng: -104.9903, lat: 39.7392, label: 'Denver', color: '#FF9800' }, { lng: -97.7431, lat: 30.2672, label: 'Austin', color: '#3F51B5' } ]; // Loop through the locations array and add a marker for each one locations.forEach(location => { const marker = new maplibregl.Marker({ color: location.color, draggable: true }) // Create colored marker .setLngLat([location.lng, location.lat]) // Set longitude and latitude .addTo(map); // Add marker to the map }); </script> </body> </html> style.css body { margin: 0; padding: 0; } Dynamic maps 178 Amazon Location Service Developer Guide html, body, #map { height: 100%; } How to add an icon on the map Amazon Location Service enables you to add icons, preferably in PNG format, to the map. You can add icons to specific geolocations and style them as needed. Add a static icon In this example, you will use an
amazon-location-developer-guide-052
amazon-location-developer-guide.pdf
52
marker = new maplibregl.Marker({ color: location.color, draggable: true }) // Create colored marker .setLngLat([location.lng, location.lat]) // Set longitude and latitude .addTo(map); // Add marker to the map }); </script> </body> </html> style.css body { margin: 0; padding: 0; } Dynamic maps 178 Amazon Location Service Developer Guide html, body, #map { height: 100%; } How to add an icon on the map Amazon Location Service enables you to add icons, preferably in PNG format, to the map. You can add icons to specific geolocations and style them as needed. Add a static icon In this example, you will use an external URL to add an icon to the map using a symbol layer. Static icon code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Static icon on map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; // e.g., Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // e.g., us-east-2, us-east-1, us- west-2, etc. const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; Dynamic maps 179 Amazon Location Service Developer Guide const map = new maplibregl.Map({ container: 'map', // container id style: styleUrl, // style URL center: [-123.1144289, 49.2806672], // starting position [lng, lat] (e.g., Vancouver) zoom: 12, // starting zoom }); map.on('load', async () => { image = await map.loadImage('https://upload.wikimedia.org/ wikipedia/commons/1/1e/Biking_other.png'); map.addImage('biking', image.data); map.addSource('point', { 'type': 'geojson', 'data': { 'type': 'FeatureCollection', 'features': [ { 'type': 'Feature', 'geometry': { 'type': 'Point', 'coordinates': [-123.1144289, 49.2806672] } } ] } }); map.addLayer({ 'id': 'points', 'type': 'symbol', 'source': 'point', 'layout': { 'icon-image': 'biking', 'icon-size': 0.25 } }); }); </script> </body> </html> Dynamic maps 180 Amazon Location Service style.css Developer Guide body { margin: 0; padding: 0; } html, body, #map { height: 100%; } How to add a line on the map With Amazon Location Service, you can add both pre-recorded GPS traces as line-strings and real- time GPS traces to dynamic maps. Adding a pre-recorded line In this example, you will add a pre-recorded GPS trace as a GeoJSON (main.js) to the dynamic map. To do so, you need to add a source (like GeoJSON) and a layer with line styling of your choice to the map. Pre-recorded line code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Add a line on the map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> <script src='main.js'></script> </head> <body> <!-- Map container --> <div id="map"></div> <script> Dynamic maps 181 Amazon Location Service Developer Guide const apiKey = "<API_KEY>"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', style: styleUrl, center: [-123.126575, 49.290585], zoom: 12.5 }); map.on('load', () => { map.addSource('vancouver-office-to-stanley-park-route', { type: 'geojson', data: routeGeoJSON }); map.addLayer({ id: 'vancouver-office-to-stanley-park-route', type: 'line', source: 'vancouver-office-to-stanley-park-route', layout: { 'line-cap': 'round', 'line-join': 'round' }, paint: { 'line-color': '#008296', 'line-width': 2 } }); }); </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Dynamic maps 182 Amazon Location Service Developer Guide main.js const routeGeoJSON = { type: "FeatureCollection", features: [ { type: "Feature", geometry: { type: "LineString", coordinates: [ [-123.117011, 49.281306], [-123.11785, 49.28011], ... [-123.135735, 49.30106] ] }, properties: { name: "Amazon YVR to Stanley Park", description: "An evening walk from Amazon office to Stanley Park." } } ] }; Add a line in real-time In this example, you will simulate adding new GPS coordinates one by one to create a real-time GPS trace. This is useful for tracking real-time data updates. Real-time line code example index.html <!DOCTYPE html> <html lang="en"> <head> Dynamic maps 183 Amazon Location Service Developer Guide <title>Add a line on the map in real-time</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> <script src='main.js'></script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', style: styleUrl, center: [-123.126575, 49.290585], zoom: 12.5 }); map.on('load', () => { const coordinates = routeGeoJSON.features[0].geometry.coordinates; routeGeoJSON.features[0].geometry.coordinates = [coordinates[0], coordinates[20]]; map.addSource('vancouver-office-to-stanley-park-route', { type: 'geojson', data: routeGeoJSON }); map.addLayer({ id: 'vancouver-office-to-stanley-park-route', type: 'line', source: 'vancouver-office-to-stanley-park-route', Dynamic maps 184 Amazon Location Service Developer Guide layout: { 'line-cap': 'round', 'line-join': 'round' }, paint: { 'line-color': '#008296', 'line-width': 2 } }); map.jumpTo({center: coordinates[0], zoom: 14}); map.setPitch(30); let i = 0; const timer = window.setInterval(() => { if (i < coordinates.length) {
amazon-location-developer-guide-053
amazon-location-developer-guide.pdf
53
apiKey = "<API_KEY>"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', style: styleUrl, center: [-123.126575, 49.290585], zoom: 12.5 }); map.on('load', () => { const coordinates = routeGeoJSON.features[0].geometry.coordinates; routeGeoJSON.features[0].geometry.coordinates = [coordinates[0], coordinates[20]]; map.addSource('vancouver-office-to-stanley-park-route', { type: 'geojson', data: routeGeoJSON }); map.addLayer({ id: 'vancouver-office-to-stanley-park-route', type: 'line', source: 'vancouver-office-to-stanley-park-route', Dynamic maps 184 Amazon Location Service Developer Guide layout: { 'line-cap': 'round', 'line-join': 'round' }, paint: { 'line-color': '#008296', 'line-width': 2 } }); map.jumpTo({center: coordinates[0], zoom: 14}); map.setPitch(30); let i = 0; const timer = window.setInterval(() => { if (i < coordinates.length) { routeGeoJSON.features[0].geometry.coordinates.push(coordinates[i]); map.getSource('vancouver-office-to-stanley-park- route').setData(routeGeoJSON); map.panTo(coordinates[i]); i++; } else { window.clearInterval(timer); } }, 100); }); </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } main.js const routeGeoJSON = { Dynamic maps 185 Amazon Location Service Developer Guide type: "FeatureCollection", features: [ { type: "Feature", geometry: { type: "LineString", coordinates: [ [-123.117011, 49.281306], [-123.11785, 49.28011], ... [-123.135735, 49.30106] ] }, properties: { name: "Amazon YVR to Stanley Park", description: "An evening walk from Amazon office to Stanley Park." } } ] }; Developer tips Fitting bounds: You can fit the line to the map bounds by calculating the bounds of the line's coordinates: const coordinates = routeGeoJSON.features[0].geometry.coordinates; const bounds = coordinates.reduce((bounds, coord) => bounds.extend(coord), new maplibregl.LngLatBounds(coordinates[0], coordinates[0])); map.fitBounds(bounds, { padding: 20 }); How to add a polygon on the map Amazon Location Service allows you to add polygons to the map. You can style the polygon based on your business needs, including adding fill and border styling. Dynamic maps 186 Amazon Location Service Add a polygon Developer Guide In this example, you will add a polygon to the map and style it with a fill color and a border. Polygon code example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Overlay a Polygon on a Map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> <script src='main.js'></script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', style: styleUrl, center: [-123.13203602550998, 49.28726257639254], zoom: 16 }); map.on('load', () => { map.addSource('barclayHeritageSquare', { type: 'geojson', Dynamic maps 187 Amazon Location Service Developer Guide data: barclayHeritageSquare }); map.addLayer({ id: 'barclayHeritageSquare-fill', type: 'fill', source: 'barclayHeritageSquare', layout: {}, paint: { 'fill-color': '#008296', 'fill-opacity': 0.25 } }); map.addLayer({ id: 'barclayHeritageSquare-outline', type: 'line', source: 'barclayHeritageSquare', layout: {}, paint: { 'line-color': '#008296', 'line-width': 2 } }); }); </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } main.js const barclayHeritageSquare = { "type": "FeatureCollection", "features": [ Dynamic maps 188 Amazon Location Service { "type": "Feature", "properties": { "park_id": 200, Developer Guide "park_name": "Barclay Heritage Square", "area_ha": 0.63255076039675, "park_url": "http://covapp.vancouver.ca/parkfinder/ parkdetail.aspx?inparkid=200" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [-123.1320948511985, 49.287379401361406], [-123.13179672786798, 49.2871908081159], [-123.13148154587924, 49.28739992437733], [-123.1313830551372, 49.28733617069321], [-123.13118648745055, 49.287208851500054], [-123.13128257706838, 49.28714532642171], [-123.13147941881572, 49.28727228533418], ... [-123.13177619357138, 49.28759081706052], [-123.1320948511985, 49.287379401361406] ] ] } } ] }; How to add a popup to a map Amazon Location Service allows you to add popups to the map. You can add simple popups, click- triggered popups on markers, hover-triggered popups, and popups for multiple markers. Add your first popup In this example, you will add your first popup. Dynamic maps 189 Amazon Location Service First popup code example index.html <!DOCTYPE html> <html lang="en"> <head> Developer Guide <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const map = new maplibregl.Map({ container: 'map', style: styleUrl, center: [-96, 37.8], zoom: 2 }); const popup = new maplibregl.Popup({closeOnClick: false}) .setLngLat([-96, 37.8]) .setHTML('<h1>Hello USA!</h1>') .addTo(map); </script> </body> </html> Dynamic maps 190 Amazon Location Service Developer Guide style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Show popup on click on a marker In this example, you will attach a popup to a marker and display it on click. Popup on marker click example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; Dynamic maps
amazon-location-developer-guide-054
amazon-location-developer-guide.pdf
54
height: 100%; } Show popup on click on a marker In this example, you will attach a popup to a marker and display it on click. Popup on marker click example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; Dynamic maps 191 Amazon Location Service Developer Guide const centralpark_nyc = [-73.966,40.781]; const map = new maplibregl.Map({ container: 'map', style: styleUrl, center: centralpark_nyc, zoom: 13 }); const popup = new maplibregl.Popup({offset: 25}).setText( 'Central Park, NY is one of the most filmed locations in the world, appearing in over 240 feature films since 1908.' ); new maplibregl.Marker() .setLngLat(centralpark_nyc) .setPopup(popup) .addTo(map); </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Show popup on hover on a marker In this example, you will attach a popup to a marker and display it on hover. Popup on marker hover example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> Dynamic maps 192 Amazon Location Service Developer Guide <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "<API_KEY>"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/ styles/${mapStyle}/descriptor?key=${apiKey}`; const centralpark_nyc = [-73.966,40.781]; const map = new maplibregl.Map({ container: 'map', style: styleUrl, center: centralpark_nyc, zoom: 13 }); const marker = new maplibregl.Marker().setLngLat([-73.968285, 40.785091]).addTo(map); const popup = new maplibregl.Popup({ offset: 25 }) .setHTML("<h3>Central Park</h3><p>Welcome to Central Park, NYC! </p>"); const markerElement = marker.getElement(); markerElement.addEventListener('mouseenter', () => { popup.setLngLat([-73.968285, 40.785091]).addTo(map); }); markerElement.addEventListener('mouseleave', () => { popup.remove(); }); </script> </body> </html> Dynamic maps 193 Amazon Location Service Developer Guide style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Show popup on click on multiple markers In this example, you will attach a popup to multiple markers and display it on click. Popup on click on multiple markers example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre- gl.js'></script> </head> <body> <!-- Map container --> <div id="map"></div> <script> const apiKey = "Your API Key"; const mapStyle = "Monochrome"; const awsRegion = "eu-central-1"; const colorScheme ="Light"; const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/ v2/styles/${mapStyle}/descriptor?color-scheme=${colorScheme}&key=${apiKey}`; Dynamic maps 194 Amazon Location Service Developer Guide const map = new maplibregl.Map({ container: 'map', style: styleUrl, center: [-123.126979, 49.2841563], zoom: 15, minZoom: 13, maxZoom: 17 }); const locations = [ { id: 1, lat: 49.281108, lng: -123.117049, name: "Amazon - YVR11 office" }, { id: 2, lat: 49.285580, lng: -123.115806, name: "Amazon - YVR20 office" }, { id: 3, lat: 49.281661, lng: -123.114174, name: "Amazon - YVR14 office" }, { id: 4, lat: 49.280663, lng: -123.114379, name: "Amazon - YVR26 office" }, { id: 5, lat: 49.285343, lng: -123.129119, name: "Amazon - YVR25 office" } ]; const geojson = { type: "FeatureCollection", features: locations.map(location => ({ type: "Feature", properties: { id: location.id, name: location.name }, geometry: { type: "Point", coordinates: [location.lng, location.lat] } })) }; map.on('load', async () => { try { const image = await loadImage('https:// upload.wikimedia.org/wikipedia/commons/thumb/9/93/ Amazon_Web_Services_Logo.svg/1200px-Amazon_Web_Services_Logo.svg.png'); map.addImage('aws', image); map.addSource('places', { type: 'geojson', data: geojson }); Dynamic maps 195 Amazon Location Service Developer Guide map.addLayer({ 'id': 'places', 'type': 'symbol', 'source': 'places', 'layout': { 'icon-image': 'aws', 'icon-size': 0.025, 'icon-allow-overlap': true } }); const popup = new maplibregl.Popup({ closeButton: false, closeOnClick: false }); map.on('click', 'places', (e) => { map.getCanvas().style.cursor = 'pointer'; const coordinates = e.features[0].geometry.coordinates.slice(); const name = e.features[0].properties.name; popup.setLngLat(coordinates).setHTML(name).addTo(map); }); map.on('mouseleave', 'places', () => { map.getCanvas().style.cursor = ''; popup.remove(); }); } catch (error) { console.error('Error loading image:', error); } }); async function loadImage(url) { return new Promise((resolve, reject) => { const img = new Image(); img.crossOrigin = 'anonymous'; img.onload = () => resolve(img); img.onerror = (error) => reject(error); img.src = url; }); } </script> </body> Dynamic maps 196 Amazon Location Service </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Developer Guide Show popup on hover on multiple markers In this example, you will attach a popup to multiple markers and display it on hover. Popup on hover on multiple markers example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport"
amazon-location-developer-guide-055
amazon-location-developer-guide.pdf
55
= 'anonymous'; img.onload = () => resolve(img); img.onerror = (error) => reject(error); img.src = url; }); } </script> </body> Dynamic maps 196 Amazon Location Service </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } Developer Guide Show popup on hover on multiple markers In this example, you will attach a popup to multiple markers and display it on hover. Popup on hover on multiple markers example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> <script src='https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js'></ script> </head> <body> <!-- Map container --> <div id="map" style="width: 100%; height: 100vh;"></div> <script> const apiKey = "You API Key"; const mapStyle = "Monochrome"; // eg. Standard, Monochrome, Hybrid, Satellite const awsRegion = "eu-central-1"; // eg. us-east-2, us-east-1, etc. const colorScheme ="Light"; // eg Dark, Light (default) Dynamic maps 197 Amazon Location Service Developer Guide const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/styles/ ${mapStyle}/descriptor?color-scheme=${colorScheme}&key=${apiKey}`; // Initialize the map const map = new maplibregl.Map({ container: 'map', // Container id style: styleUrl, // Style URL center: [-123.126979, 49.2841563], // Starting position [lng, lat] zoom: 15, // Starting zoom minZoom: 13, // Minimum zoom level maxZoom: 17 // Maximum zoom level }); const locations = [ { id: 1, lat: 49.281108, lng: -123.117049, name: "Amazon - YVR11 office" }, { id: 2, lat: 49.285580, lng: -123.115806, name: "Amazon - YVR20 office" }, { id: 3, lat: 49.281661, lng: -123.114174, name: "Amazon - YVR14 office" }, { id: 4, lat: 49.280663, lng: -123.114379, name: "Amazon - YVR26 office" }, { id: 5, lat: 49.285343, lng: -123.129119, name: "Amazon - YVR25 office" } ]; // Convert locations to GeoJSON const geojson = { type: "FeatureCollection", features: locations.map(location => ({ type: "Feature", properties: { id: location.id, name: location.name // Use the name property for popup }, geometry: { type: "Point", coordinates: [location.lng, location.lat] // GeoJSON uses [lng, lat] } })) }; // Add the GeoJSON source and layers when the map loads Dynamic maps 198 Amazon Location Service Developer Guide map.on('load', async () => { try { // Load the PNG image for the marker const image = await loadImage('https://upload.wikimedia.org/ wikipedia/commons/thumb/9/93/Amazon_Web_Services_Logo.svg/1200px- Amazon_Web_Services_Logo.svg.png'); // Ensure this URL points to a valid PNG map.addImage('aws', image); // Add a GeoJSON source map.addSource('places', { type: 'geojson', data: geojson }); // Add a layer showing the places with custom icons map.addLayer({ 'id': 'places', 'type': 'symbol', 'source': 'places', 'layout': { 'icon-image': 'aws', 'icon-size': 0.025, // Adjust as needed 'icon-allow-overlap': true // Allow icons to overlap } }); // Create a popup const popup = new maplibregl.Popup({ closeButton: false, closeOnClick: false }); // Event handlers for mouse enter and leave map.on('mouseenter', 'places', (e) => { map.getCanvas().style.cursor = 'pointer'; const coordinates = e.features[0].geometry.coordinates.slice(); const name = e.features[0].properties.name; // Set popup content and position popup.setLngLat(coordinates).setHTML(name).addTo(map); }); map.on('mouseleave', 'places', () => { Dynamic maps 199 Amazon Location Service Developer Guide map.getCanvas().style.cursor = ''; popup.remove(); }); } catch (error) { console.error('Error loading image:', error); } }); // Helper function to load the image async function loadImage(url) { return new Promise((resolve, reject) => { const img = new Image(); img.crossOrigin = 'anonymous'; // Enable CORS img.onload = () => resolve(img); img.onerror = (error) => reject(error); img.src = url; }); } </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } How to set a preferred language for a map Amazon Location Service enables you to set the preferred language at the client-side by updating the style descriptor for a specific language. You can set a preferred language and display content in that language where embedded. Otherwise, it will fall back to another language. Note For more information, see the section called “Localization and internationalization”. Dynamic maps 200 Amazon Location Service Developer Guide Set preferred language to Japanese and show map of Japan In this example, you will set update style to show map labels in Japanese (ja). Set preferred language to Japanese example index.html <html> <head> <link href="https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.css" rel="stylesheet" /> <script src="https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js"></script> <link href="style.css" rel="stylesheet" /> <script src="main.js"></script> </head> <body> <div id="map" /> <script> const apiKey = "Add Your Api Key"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const initialLocation = [139.76694, 35.68085]; //Japan async function initializeMap() { // get updated style object for preferred language. const styleObject = await getStyleWithPreferredLanguage("ja"); // Initialize the MapLibre map with the fetched style object const map = new maplibregl.Map({ container: 'map', style: styleObject, center: initialLocation, zoom: 15, hash:true, }); map.addControl(new maplibregl.NavigationControl(), "top-left"); return map; } initializeMap(); </script> </body> Dynamic maps 201 Developer Guide Amazon Location Service </html> style.css body { margin: 0; } #map { height: 100vh; } main.js async function getStyleWithPreferredLanguage(preferredLanguage) { const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/styles/ ${mapStyle}/descriptor?key=${apiKey}`; return fetch(styleUrl) .then(response => {
amazon-location-developer-guide-056
amazon-location-developer-guide.pdf
56
const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const initialLocation = [139.76694, 35.68085]; //Japan async function initializeMap() { // get updated style object for preferred language. const styleObject = await getStyleWithPreferredLanguage("ja"); // Initialize the MapLibre map with the fetched style object const map = new maplibregl.Map({ container: 'map', style: styleObject, center: initialLocation, zoom: 15, hash:true, }); map.addControl(new maplibregl.NavigationControl(), "top-left"); return map; } initializeMap(); </script> </body> Dynamic maps 201 Developer Guide Amazon Location Service </html> style.css body { margin: 0; } #map { height: 100vh; } main.js async function getStyleWithPreferredLanguage(preferredLanguage) { const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/styles/ ${mapStyle}/descriptor?key=${apiKey}`; return fetch(styleUrl) .then(response => { if (!response.ok) { throw new Error('Network response was not ok ' + response.statusText); } return response.json(); }) .then(styleObject => { if (preferredLanguage !== "en") { styleObject = setPreferredLanguage(styleObject, preferredLanguage); } return styleObject; }) .catch(error => { console.error('Error fetching style:', error); }); } const setPreferredLanguage = (style, language) => { let nextStyle = { ...style }; nextStyle.layers = nextStyle.layers.map(l => { if (l.type !== 'symbol' || !l?.layout?.['text-field']) return l; return updateLayer(l, /^name:([A-Za-z\-\_]+)$/g, `name:${language}`); }); Dynamic maps 202 Amazon Location Service Developer Guide return nextStyle; }; const updateLayer = (layer, prevPropertyRegex, nextProperty) => { const nextLayer = { ...layer, layout: { ...layer.layout, 'text-field': recurseExpression( layer.layout['text-field'], prevPropertyRegex, nextProperty ) } }; return nextLayer; }; const recurseExpression = (exp, prevPropertyRegex, nextProperty) => { if (!Array.isArray(exp)) return exp; if (exp[0] !== 'coalesce') return exp.map(v => recurseExpression(v, prevPropertyRegex, nextProperty) ); const first = exp[1]; const second = exp[2]; let isMatch = Array.isArray(first) && first[0] === 'get' && !!first[1].match(prevPropertyRegex)?.[0]; isMatch = isMatch && Array.isArray(second) && second[0] === 'get'; isMatch = isMatch && !exp?.[4]; if (!isMatch) return exp.map(v => recurseExpression(v, prevPropertyRegex, nextProperty) ); return [ 'coalesce', ['get', nextProperty], ['get', 'name:en'], Dynamic maps 203 Amazon Location Service Developer Guide ['get', 'name'] ]; }; Set preferred language based on end user's browser language In this example, you will set update style to show map labels in user's device language. Set preferred language based on browser language example index.html <html> <head> <link href="https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.css" rel="stylesheet" /> <script src="https://unpkg.com/maplibre-gl@4.x/dist/maplibre-gl.js"></script> <link href="style.css" rel="stylesheet" /> <script src="main.js"></script> </head> <body> <div id="map" /> <script> const apiKey = "Add Your Api Key"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; const initialLocation = [139.76694, 35.68085]; //Japan const userLanguage = navigator.language || navigator.userLanguage; const languageCode = userLanguage.split('-')[0]; async function initializeMap() { const styleObject = await getStyleWithPreferredLanguage(languageCode); const map = new maplibregl.Map({ container: 'map', style: styleObject, center: initialLocation, zoom: 15, hash:true, }); map.addControl(new maplibregl.NavigationControl(), "top-left"); return map; Dynamic maps 204 Developer Guide Amazon Location Service } initializeMap(); </script> </body> </html> style.css body { margin: 0; } #map { height: 100vh; } main.js async function getStyleWithPreferredLanguage(preferredLanguage) { const styleUrl = `https://maps.geo.${awsRegion}.amazonaws.com/v2/styles/ ${mapStyle}/descriptor?key=${apiKey}`; return fetch(styleUrl) .then(response => { if (!response.ok) { throw new Error('Network response was not ok ' + response.statusText); } return response.json(); }) .then(styleObject => { if (preferredLanguage !== "en") { styleObject = setPreferredLanguage(styleObject, preferredLanguage); } return styleObject; }) .catch(error => { console.error('Error fetching style:', error); }); } const setPreferredLanguage = (style, language) => { let nextStyle = { ...style }; Dynamic maps 205 Amazon Location Service Developer Guide nextStyle.layers = nextStyle.layers.map(l => { if (l.type !== 'symbol' || !l?.layout?.['text-field']) return l; return updateLayer(l, /^name:([A-Za-z\-\_]+)$/g, `name:${language}`); }); return nextStyle; }; const updateLayer = (layer, prevPropertyRegex, nextProperty) => { const nextLayer = { ...layer, layout: { ...layer.layout, 'text-field': recurseExpression( layer.layout['text-field'], prevPropertyRegex, nextProperty ) } }; return nextLayer; }; const recurseExpression = (exp, prevPropertyRegex, nextProperty) => { if (!Array.isArray(exp)) return exp; if (exp[0] !== 'coalesce') return exp.map(v => recurseExpression(v, prevPropertyRegex, nextProperty) ); const first = exp[1]; const second = exp[2]; let isMatch = Array.isArray(first) && first[0] === 'get' && !!first[1].match(prevPropertyRegex)?.[0]; isMatch = isMatch && Array.isArray(second) && second[0] === 'get'; isMatch = isMatch && !exp?.[4]; if (!isMatch) return exp.map(v => recurseExpression(v, prevPropertyRegex, nextProperty) ); Dynamic maps 206 Amazon Location Service Developer Guide return [ 'coalesce', ['get', nextProperty], ['get', 'name:en'], ['get', 'name'] ]; }; How to set the political view of a map Amazon Location Service enables you to set the political view to ensure your application complies with local laws. You can set a political view and compare maps from different political perspectives. Note For more information, see the section called “Localization and internationalization”. Set political view and compare with international perspective In this example, you will create and compare maps from two different political views: an international perspective and Turkey's view on Cyprus. Political view comparison example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/ maplibre-gl@4.x/dist/maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> Dynamic maps 207 Amazon Location Service Developer Guide <script src='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.js'></script> <script src="https://unpkg.com/@mapbox/mapbox-gl- sync-move@0.3.1"></script> <script src='main.js'></script> </head> <body> <!-- Map container --> <div class="maps"> <div id="internatinalView"></div> <div id="turkeyView"></div> </div> <script> const apiKey = "Add Your Api
amazon-location-developer-guide-057
amazon-location-developer-guide.pdf
57
In this example, you will create and compare maps from two different political views: an international perspective and Turkey's view on Cyprus. Political view comparison example index.html <!DOCTYPE html> <html lang="en"> <head> <title>Display a map</title> <meta property="og:description" content="Initialize a map in an HTML element with MapLibre GL JS." /> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet' href='https://unpkg.com/ maplibre-gl@4.x/dist/maplibre-gl.css' /> <link rel='stylesheet' href='style.css' /> Dynamic maps 207 Amazon Location Service Developer Guide <script src='https://unpkg.com/maplibre-gl@4.x/dist/ maplibre-gl.js'></script> <script src="https://unpkg.com/@mapbox/mapbox-gl- sync-move@0.3.1"></script> <script src='main.js'></script> </head> <body> <!-- Map container --> <div class="maps"> <div id="internatinalView"></div> <div id="turkeyView"></div> </div> <script> const apiKey = "Add Your Api Key"; const mapStyle = "Standard"; const awsRegion = "eu-central-1"; // International perspective without political- view query parameter const internatinalViewMapStyleUrl = `https:// maps.geo.${awsRegion}.amazonaws.com/v2/styles/${mapStyle}/descriptor?key=${apiKey}`; // Turkey perspective with political-view query parameter const turkeyViewMapStyleUrl = `https://maps.geo. ${awsRegion}.amazonaws.com/v2/styles/${mapStyle}/descriptor?political-view=TUR&key= ${apiKey}`; const internatinalViewMap = new maplibregl.Map({ container: 'internatinalView', // container id style: internatinalViewMapStyleUrl, // style URL center: [33.0714561, 35.1052139], // starting position [lng, lat] zoom: 7.5, }); const turkeyViewMap = new maplibregl.Map({ container: 'turkeyView', // container id style: turkeyViewMapStyleUrl, // style URL center: [33.0714561, 35.1052139], zoom: 7.5, Dynamic maps 208 Amazon Location Service Developer Guide }); // Sync map zoom and center syncMaps(internatinalViewMap, turkeyViewMap); // Informational popup for international view new maplibregl.Popup({closeOnClick: false}) .setLngLat([33, 35.5]) .setHTML('<h4>International view <br> recognizes <br> Cyprus</h4>') .addTo(internatinalViewMap); // Informational popup for Turkey's view new maplibregl.Popup({closeOnClick: false}) .setLngLat([33, 35.5]) .setHTML('<h4>Turkey does not <br> recognize <br> Cyprus</h4>') .addTo(turkeyViewMap); </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body { height: 100%; } #internatinalView, #turkeyView { height: 100%; width: 100%; } .maps { display: flex; width: 100%; height: 100%; } How to filter POI on the map Amazon Location Serviceallows you to select the POI (point-of-interest) categories relevant to your use case. Learn more about the standard map style, Rich POI Dynamic maps 209 Amazon Location Service Filter POI Developer Guide In this example, you display an interactive map that allows users to filter on POI categories. Index.html <!DOCTYPE html> <html lang="en"> <head> <title>POI demo</title> <meta property="og:description" content="" /> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="https://unpkg.com/maplibre-gl@4.5.0/dist/ maplibre-gl.css" /> <link rel='stylesheet' href='style.css' /> <script src="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.js"></script> </head> <body> <div id="map"></div> <ul id="buttons"></ul> <script> // ------------------------------------------------------------------------------------------- // Function to set layer state // ------------------------------------------------------------------------------------------- const initialLayerState = { Buildings: { layers: ['poi_900_areas_buildings'], visibility: 'visible' }, 'Business & Services': { layers: ['poi_700_business_services'], visibility: 'visible' }, Shopping: { layers: ['poi_600_shopping'], visibility: 'visible' }, 'Leisure & Outdoors': { layers: ['poi_550_leisure_outdoor'], visibility: 'visible' }, Dynamic maps 210 Amazon Location Service Developer Guide Facilities: { layers: ['poi_800_facilities'], visibility: 'visible' }, Transit: { layers: ['poi_400_transit'], visibility: 'visible' }, 'Sights & Museums': { layers: ['poi_300_sights_museums'], visibility: 'visible' }, 'Food & Drink': { layers: ['poi_100_food_drink'], visibility: 'visible' }, 'Going Out & Entertainment': { layers: ['poi_200_going_out_entertainment'], visibility: 'visible' }, Accommodations: { layers: ['poi_500_accommodations'], visibility: 'visible' }, Parks: { layers: ['poi_landuse_park'], visibility: 'visible' }, 'Public Complexes': { layers: ['poi_landuse_public_complex'], visibility: 'visible' } }; // ------------------------------------------------------------------------------------------- // Setup auth and state // ------------------------------------------------------------------------------------------- let state = { ...initialLayerState }; const API_KEY = "<api key>"; // check how to create api key for Amazon Location const AWS_REGION = "eu-central-1"; // Replace with your AWS region const mapStyle = "Standard"; const colorScheme = "Light"; // Style URL const styleUrl = `https://maps.geo.${AWS_REGION}.amazonaws.com/v2/styles/ ${mapStyle}/descriptor?key=${API_KEY}&color-scheme=${colorScheme}`; Dynamic maps 211 Amazon Location Service Developer Guide // Render the map with the stylesheet map = new maplibregl.Map({ container: 'map', style: styleUrl, center: [-73.966148, 40.781803], zoom: 17 }); const buttonContainer = document.getElementById('buttons'); for (const category of Object.keys(state)) { const newButton = document.createElement('li'); newButton.classList.add('button'); newButton.classList.add('active'); newButton.id = category; // Each config has a label newButton.textContent = category; // On click, we want to switch the value between 'on' and 'off' // We could check the config for available options in more complex cases newButton.onclick = () => { onClickCategory(category); }; // Append the button to our button container buttonContainer.appendChild(newButton); } // ------------------------------------------------------------------------------------------- // LAYER VISIBILITY FUNCTION // ------------------------------------------------------------------------------------------- // On click, get the stylesheet, update the language, and set the style const onClickCategory = category => { const categoryState = state[category]; const { visibility, layers } = categoryState; let nextState; Dynamic maps 212 Amazon Location Service Developer Guide // For active button styling const activeButton = document.getElementById(category); if (visibility === 'visible') { nextState = 'none'; activeButton.classList.remove('active'); } else { nextState = 'visible'; activeButton.classList.add('active'); } layers.forEach(id => map.setLayoutProperty(id, 'visibility', nextState) ); state[category].visibility = nextState; }; </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } #buttons { display: flex; flex-direction: column; justify-content: space-between; position: absolute; top: 0; min-width: 100px; max-height: calc(100% - 2rem); Dynamic maps 213 Amazon Location Service Developer Guide overflow: auto; padding: 1rem; background-color: white; margin: 0; } .button { display: inline-block; cursor: pointer; padding: 8px; border-radius: 3px; margin-top: 10px; font-size: 12px; text-align: center; color: #fff; background: #8a8a8a; font-family: sans-serif; font-weight: bold;
amazon-location-developer-guide-058
amazon-location-developer-guide.pdf
58
{ nextState = 'none'; activeButton.classList.remove('active'); } else { nextState = 'visible'; activeButton.classList.add('active'); } layers.forEach(id => map.setLayoutProperty(id, 'visibility', nextState) ); state[category].visibility = nextState; }; </script> </body> </html> style.css body { margin: 0; padding: 0; } html, body, #map { height: 100%; } #buttons { display: flex; flex-direction: column; justify-content: space-between; position: absolute; top: 0; min-width: 100px; max-height: calc(100% - 2rem); Dynamic maps 213 Amazon Location Service Developer Guide overflow: auto; padding: 1rem; background-color: white; margin: 0; } .button { display: inline-block; cursor: pointer; padding: 8px; border-radius: 3px; margin-top: 10px; font-size: 12px; text-align: center; color: #fff; background: #8a8a8a; font-family: sans-serif; font-weight: bold; } .button:first-child { margin-top: 0; } .active { background: #ee8a65; } How to use static maps These how-to topics offer step-by-step guidance for customizing static maps with overlays and visual elements, utilizing the mapping capabilities of Amazon Location Service. Each guide walks you through key tasks, such as adjusting map dimensions, choosing between zoom or radius, and adding various geo-spatial elements like markers, polygons, lines, and proximity circles. These guides use both compact and GeoJSON formats to ensure flexibility in styling and configuration. Whether you're optimizing maps for customer-facing applications or performing geospatial analysis, these topics provide clear instructions on tailoring your static maps to fit specific requirements. By following the detailed examples, you’ll learn how to enhance map presentations and efficiently manage geographical data for a variety of business needs. Static maps 214 Developer Guide Amazon Location Service Topics • How to get a static map of a specific position • How to get a static map of a specific dimension • How to decide between radius and zoom for a static map • How to add scale for a static map • How to add a marker to a static map • How to add a line to a static map • How to add a route to a static map • How to add a polygon to a static map • How to set language for static maps • How to add a proximity circle to a static map How to get a static map of a specific position In this topic, you will learn how to retrieve static maps from Amazon Location Service based on specific parameters. You will learn how to generate a static map for a center position, a bounding box, and a set of bounded positions. The examples provided will help you customize the width, height, and style of the map. Note You must pass either map or map@2x when generating a static map. Get map image for a center position In this example, you will create a map image with a width of 1024 and a height of 1024 with the center coordinates set at -123.1143,49.2763, where longitude=-123.1143 and latitude=49.2763, and a zoom level of 15. Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&zoom=15&center=-123.1156126,49.2767046&key=API_KEY Static maps 215 Amazon Location Service Response image Developer Guide Get map image for bounding box In this example, you'll generate a map image of Southeast Asia by setting the bounding box for the area. Static maps 216 Amazon Location Service Developer Guide The bbox format is {southwest_longitude},{southwest_latitude}, {northeast_longitude},{northeast_latitude}. Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/ map?style=Satellite&width=1024&height=1024&bounding- box=90.00,-21.94,146.25,31.95&key=API_KEY Static maps 217 Amazon Location Service Response image Developer Guide Get map image for bounded positions In this example, you will generate a map that covers several must-see places in Paris, each specified by its coordinates (longitude, latitude). The bounded positions include: Eiffel Tower, Static maps 218 Amazon Location Service Developer Guide Louvre Museum, Notre-Dame Cathedral, Champs-Élysées, Arc de Triomphe, Sacré-Cœur Basilica, Luxembourg Gardens, Musée d'Orsay, Place de la Concorde, and Palais Garnier. The format for bounding positions is {longitude1},{latitude1},{longitude2}, {latitude2} ... {longitudeN},{latitudeN}. Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&bounded- positions=2.2945,48.8584,2.3376,48.8606,2.3500,48.8529,2.3076,48.8698,2.2950,48.8738,2.3431,48.8867,2.3372,48.8462,2.3266,48.8600,2.3212,48.8656,2.3317,48.8719&key=API_KEY Static maps 219 Amazon Location Service Response image Developer Guide How to get a static map of a specific dimension In this topic, you will learn how to set the dimensions (height and width) for static maps using Amazon Location Service. Customizing the dimensions of a map image allows you to balance Static maps 220 Amazon Location Service Developer Guide performance, visual quality, and usability. The maximum values for both width and height are 1400 pixels, while the minimum values are 64 pixels. The maximum result size is 6 MB. Additionally, you can use the bbox and bounds parameters along with padding to ensure that important map features near the edges are fully visible and not cut off. Get map image with specific height and width In this example, you will create a low-resolution and mid-resolution map image of Helsinki, Finland. Request URL for low-resolution thumbnail https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=200&height=200&zoom=11.5&center=24.9460,60.1690&key=API_KEY Response (Thumbnail 200x200) Request URL for mid-resolution image https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=700&height=700&zoom=13&center=24.9460,60.1690&key=API_KEY Static maps 221 Amazon Location Service Response image (700x700) Developer Guide Get map image with padding on all sides In this example, you will generate a map using several must-see places in
amazon-location-developer-guide-059
amazon-location-developer-guide.pdf
59
Additionally, you can use the bbox and bounds parameters along with padding to ensure that important map features near the edges are fully visible and not cut off. Get map image with specific height and width In this example, you will create a low-resolution and mid-resolution map image of Helsinki, Finland. Request URL for low-resolution thumbnail https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=200&height=200&zoom=11.5&center=24.9460,60.1690&key=API_KEY Response (Thumbnail 200x200) Request URL for mid-resolution image https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=700&height=700&zoom=13&center=24.9460,60.1690&key=API_KEY Static maps 221 Amazon Location Service Response image (700x700) Developer Guide Get map image with padding on all sides In this example, you will generate a map using several must-see places in Helsinki, Finland, with their coordinates (longitude, latitude), both with and without padding. Static maps 222 Amazon Location Service Request URL with padding Developer Guide https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&padding=150&bounded- positions=24.9526,60.1692,24.9850,60.1465,24.9270,60.1725,24.9226,60.1826,24.9509,60.1675,24.9566,60.1685,24.9457,60.1674,24.9397,60.1719,24.9414,60.1715,24.9387,60.1720&key=API_KEY Response image (with padding) Static maps 223 Amazon Location Service Request URL without padding Developer Guide https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&bounded- positions=24.9526,60.1692,24.9850,60.1465,24.9270,60.1725,24.9226,60.1826,24.9509,60.1675,24.9566,60.1685,24.9457,60.1674,24.9397,60.1719,24.9414,60.1715,24.9387,60.1720&key=API_KEY Response image (without padding) Static maps 224 Amazon Location Service Developer Guide How to decide between radius and zoom for a static map In this topic, you will learn how to choose between using radius or zoom when generating static maps with Amazon Location Service. The radius parameter provides more precise control over the area of coverage, making it ideal for customer-facing applications where you know the exact coverage area. The zoom parameter is better suited for geospatial analysis when you want to adjust the level of detail displayed. With radius In this example, you will create a map image of Sri Lanka using the radius parameter with a center location. Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=700&height=700&center=80.60596,7.76671&radius=235000&scale- unit=KilometersMiles&key=API_KEY Static maps 225 Amazon Location Service Response image Developer Guide With zoom In this example, you will create a map image of Sri Lanka using the zoom parameter with a center location. Static maps 226 Amazon Location Service Request URL Developer Guide https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=700&height=700&zoom=8&center=80.60596,7.76671&scale- unit=KilometersMiles&key=API_KEY Response image Static maps 227 Amazon Location Service Developer Guide How to add scale for a static map In this topic, you will learn how to display a scale on the bottom-right corner of a static map generated with Amazon Location Service. The scale can show a single unit, such as Miles or Kilometers, or both units, such as KilometersMiles or MilesKilometers, with one unit displayed at the top and the other at the bottom. Add scale with single unit In this example, you will display a map of Helsinki, Finland with the scale set to Kilometers in the bottom-right corner. Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&zoom=13.5&center=24.9189564,60.1645772&scale- unit=Kilometers&key=API_KEY Static maps 228 Amazon Location Service Response image Developer Guide Add scale with both units In this example, you will display a map of Helsinki, Finland with both Kilometers and Miles shown on the scale in the bottom-right corner, with one unit displayed above the other. Static maps 229 Amazon Location Service Request URL Developer Guide https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&zoom=14&center=24.9189564,60.1645772&scale- unit=KilometersMiles&key=API_KEY Response image Static maps 230 Amazon Location Service Developer Guide How to add a marker to a static map In this topic, you will learn how to add markers to static maps generated with Amazon Location Service. You can customize the marker's icon, label, size, color, and other styling options. This allows you to highlight specific locations with visual cues that align with your map's purpose. Marker styling Name style Type String Default marker icon String pin label String <empty> Description The style of the Point geometry. To create a marker, set the value to marker or do not include the style attribute in the properties object of the GeoJSON. The marker icon type. Available values include: cp (proximit y circle), diamond, pin, poi, square, triangle, bubble. The text to display at the coordinates. To set automatic labels, use the following values: $alpha (Latin alphabet) or $num (Arabic numerals). color outline-color Color Color Style-dependent The icon color. Style-dependent The icon outline color. Static maps 231 Amazon Location Service Name text-color text-outline- color Type Color Color Developer Guide Default Description Style-dependent The label text color. Style-dependent The text outline color. outline-width Integer 0 (turned off) size String medium The text outline width. The label and icon size. Available values: small, medium, large. Add a Marker to a Map Image In this example, you will place a marker with a label on the map image of BC Place, Vancouver. Geo JSON: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -123.11210, 49.2767875 ] }, "properties": { "color":"#EE4B2B", "size":"large", "label":"BC Place, Vancouver", "text-color":"#0000FF" } } ] Static maps 232 Developer Guide Amazon Location Service } Compact: point: -123.11210,49.27678; label=BC Place, Vancouver; size=large; text-color=#0000FF; color=#EE4B2B Request URL With the GeoJSON overlay https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&zoom=15&scale-unit=KilometersMiles&geojson- overlay=%7B%22type%22%3A%22FeatureCollection%22,%22features%22%3A%5B%7B %22type%22%3A%22Feature%22,%22properties%22%3A%7B%22color%22%3A%22%23EE4B2B %22,%22size%22%3A%22large%22,%22label%22%3A%22BC%20Place,%20Vancouver%22, %22text-color%22%3A%22%230000FF%22%7D,%22geometry%22%3A%7B%22coordinates%22%3A %5B-123.11210974152168,49.27678753813112%5D,%22type%22%3A%22Point%22%7D%7D%5D %7D&key=API_KEY Static maps 233 Amazon Location Service Response image Developer Guide Add multiple markers to a map image In this example, you will add markers for must-see places in
amazon-location-developer-guide-060
amazon-location-developer-guide.pdf
60
label on the map image of BC Place, Vancouver. Geo JSON: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -123.11210, 49.2767875 ] }, "properties": { "color":"#EE4B2B", "size":"large", "label":"BC Place, Vancouver", "text-color":"#0000FF" } } ] Static maps 232 Developer Guide Amazon Location Service } Compact: point: -123.11210,49.27678; label=BC Place, Vancouver; size=large; text-color=#0000FF; color=#EE4B2B Request URL With the GeoJSON overlay https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&zoom=15&scale-unit=KilometersMiles&geojson- overlay=%7B%22type%22%3A%22FeatureCollection%22,%22features%22%3A%5B%7B %22type%22%3A%22Feature%22,%22properties%22%3A%7B%22color%22%3A%22%23EE4B2B %22,%22size%22%3A%22large%22,%22label%22%3A%22BC%20Place,%20Vancouver%22, %22text-color%22%3A%22%230000FF%22%7D,%22geometry%22%3A%7B%22coordinates%22%3A %5B-123.11210974152168,49.27678753813112%5D,%22type%22%3A%22Point%22%7D%7D%5D %7D&key=API_KEY Static maps 233 Amazon Location Service Response image Developer Guide Add multiple markers to a map image In this example, you will add markers for must-see places in Helsinki, Finland using their coordinates (longitude, latitude). You can also apply padding to ensure the map accommodates all markers properly. Static maps 234 Amazon Location Service Developer Guide Note The available marker icon type include: cp for proximity circle, diamond, pin, poi, square, triangle, bubble. Geo JSON: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "MultiPoint", "coordinates": [ [24.9526, 60.1692], [24.9270, 60.1725], [24.9226, 60.1826], [24.9509, 60.1675], [24.9566, 60.1685], [24.9457, 60.1674], [24.9397, 60.1719], [24.9414, 60.1715], [24.9387, 60.1720] ] }, "properties": { "icon":"diamond", "label":"$num", "size":"large", "text-color":"%23972E2B", "text-outline-color":"%23FFF", "text-outline-width":2 } } ] } Static maps 235 Amazon Location Service Request URL Developer Guide https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&padding=150&geojson-overlay=%7B %22type%22%3A%22FeatureCollection%22,%22features%22%3A%5B%7B%22type%22%3A %22Feature%22,%22geometry%22%3A%7B%22type%22%3A%22MultiPoint%22,%22coordinates %22%3A%5B%5B24.9526,60.1692%5D,%5B24.927,60.1725%5D,%5B24.9226,60.1826%5D, %5B24.9509,60.1675%5D,%5B24.9566,60.1685%5D,%5B24.9457,60.1674%5D, %5B24.9397,60.1719%5D,%5B24.9414,60.1715%5D,%5B24.9387,60.172%5D%5D%7D,%22properties %22%3A%7B%22icon%22%3A%22diamond%22,%22label%22%3A%22%24num%22,%22size%22%3A%22large %22,%22text-color%22%3A%22%23972E2B%22,%22text-outline-color%22%3A%22%23FFF%22, %22text-outline-width%22%3A2%7D%7D%5D%7D&key=API_KEY Static maps 236 Amazon Location Service Response image Developer Guide Change color of marker in a map image In this example, you will use bubble markers of different colors to represent cities across the world. You can customize the marker’s color, label, and other properties to suit the context of your map. Geo JSON: Static maps 237 Amazon Location Service Developer Guide { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [85.1376, 25.5941] }, "properties": { "label": "Patna", "icon": "bubble", "color": "#FF5722", "outline-color": "#D74D3D", "text-color": "#FFFFFF" } }, .....redacted..... { "type": "Feature", "geometry": { "type": "Point", "coordinates": [2.3522, 48.8566] }, "properties": { "label": "Paris, France", "icon": "bubble", "color": "#FF9800", "outline-color": "#D76B0B", "text-color": "#FFFFFF" } } ] } Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1400&height=1024&padding=150&geojson-overlay=%7B %22type%22%3A%22FeatureCollection%22,%22features%22%3A%5B%7B%22type%22%3A %22Feature%22,%22geometry%22%3A%7B%22type%22%3A%22Point%22,%22coordinates %22%3A%5B85.1376,25.5941%5D%7D,%22properties%22%3A%7B%22label%22%3A%22Patna %22,%22icon%22%3A%22bubble%22,%22color%22%3A%22%23FF5722%22,%22outline-color Static maps 238 Amazon Location Service Developer Guide %22%3A%22%23D74D3D%22,%22text-color%22%3A%22%23FFFFFF%22%7D%7D,%7B%22type%22%3A %22Feature%22,%22geometry%22%3A%7B%22type%22%3A%22Point%22,%22coordinates%22%3A %5B105.8542,21.0285%5D%7D,%22properties%22%3A%7B%22label%22%3A%22Hanoi,%20Vietnam %22,%22icon%22%3A%22bubble%22,%22color%22%3A%22%232196F3%22,%22outline-color %22%3A%22%231A78C2%22,%22text-color%22%3A%22%23FFFFFF%22%7D%7D,%7B%22type%22%3A %22Feature%22,%22geometry%22%3A%7B%22type%22%3A%22Point%22,%22coordinates%22%3A %5B116.4074,39.9042%5D%7D,%22properties%22%3A%7B%22label%22%3A%22Beijing,%20China %22,%22icon%22%3A%22bubble%22,%22color%22%3A%22%23FF9800%22,%22outline-color %22%3A%22%23D76B0B%22,%22text-color%22%3A%22%23FFFFFF%22%7D%7D,%7B%22type%22%3A %22Feature%22,%22geometry%22%3A%7B%22type%22%3A%22Point%22,%22coordinates%22%3A %5B106.9101,47.918%5D%7D,%22properties%22%3A%7B%22label%22%3A%22Ulaanbaatar, %20Mongolia%22,%22icon%22%3A%22bubble%22,%22color%22%3A%22%239C27B0%22,%22outline- color%22%3A%22%237B1FA2%22,%22text-color%22%3A%22%23FFFFFF%22%7D%7D,%7B%22type %22%3A%22Feature%22,%22geometry%22%3A%7B%22type%22%3A%22Point%22,%22coordinates %22%3A%5B151.2093,-33.8688%5D%7D,%22properties%22%3A%7B%22label%22%3A%22Sydney, %20Australia%22,%22icon%22%3A%22bubble%22,%22color%22%3A%22%234CAF50%22,%22outline- color%22%3A%22%23388E3C%22,%22text-color%22%3A%22%23FFFFFF%22%7D%7D,%7B%22type %22%3A%22Feature%22,%22geometry%22%3A%7B%22type%22%3A%22Point%22,%22coordinates %22%3A%5B174.7633,-41.2865%5D%7D,%22properties%22%3A%7B%22label%22%3A%22Wellington, %20New%20Zealand%22,%22icon%22%3A%22bubble%22,%22color%22%3A%22%23FFC107%22, %22outline-color%22%3A%22%23FFA000%22,%22text-color%22%3A%22%23000000%22%7D%7D%5D %7D&key=API_KEY Static maps 239 Amazon Location Service Response image Developer Guide How to add a line to a static map In this topic, you'll learn how to add a line to a static map using Amazon Location Service. We'll cover the supported styling options, how to define a line using GeoJSON, and how to apply custom styles such as color, width, and outline. We'll also explore how to use different measurement units for properties like line width. Supported styling Name color Static maps Type Color Default Description style-dependent The line color. 240 Amazon Location Service Developer Guide Name width Type Default Description Integer/String 2 The line width. For more information, see the section called “Add a line to a static map”. outline-color Color style-dependent The line outline color. outline-width Integer/String 0 (turned off) The width of the outline. For more information, see the section called “Add a line to a static map”. Supported unit Unit Description Integer, for example, 5 String with no unit, for example "5" "px" "m" "km" "mi" "ft" "yd" "%" Pixels Pixels Pixels Meters Kilometers Miles Feet Yards The percentage of the default value for a specific property, in pixels. For example, if the default value for width is 2 pixels, then 200% Static maps 241 Amazon Location Service Unit Add a line Developer Guide Description is 4 pixels. % is a sensitive character that must be encoded in the request URL as %25. In this example, you will add a line from a place in Vancouver to Stanley Park. The line is created using a GeoJSON format with defined coordinates. Request { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [-123.11813, 49.28246], [-123.11967, 49.28347], [-123.12108, 49.28439], [-123.12216, 49.28507], [-123.12688, 49.28812], [-123.1292, 49.28964], [-123.13216, 49.2916], [-123.13424, 49.29291], [-123.13649, 49.2944], [-123.13678, 49.29477], [-123.13649, 49.29569], [-123.13657, 49.29649], [-123.13701, 49.29715], [-123.13584, 49.29847], [-123.13579, 49.29935], [-123.13576, 49.30018], [-123.13574, 49.30097] ] }, "properties": { "name": "To Stanley Park", "description": "An evening walk to Stanley Park." Static maps 242 Amazon Location Service Developer Guide } } ] } Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&padding=200&scale- unit=KilometersMiles&geojson-overlay=%7B%22type%22%3A%22FeatureCollection %22,%22features%22%3A%5B%7B%22type%22%3A%22Feature%22,%22geometry%22%3A%7B %22type%22%3A%22LineString%22,%22coordinates%22%3A%5B%5B-123.11813,49.28246%5D, %5B-123.11967,49.28347%5D,%5B-123.12108,49.28439%5D,%5B-123.12216,49.28507%5D, %5B-123.12688,49.28812%5D,%5B-123.1292,49.28964%5D,%5B-123.13216,49.2916%5D, %5B-123.13424,49.29291%5D,%5B-123.13649,49.2944%5D,%5B-123.13678,49.29477%5D, %5B-123.13649,49.29569%5D,%5B-123.13657,49.29649%5D,%5B-123.13701,49.29715%5D, %5B-123.13584,49.29847%5D,%5B-123.13579,49.29935%5D,%5B-123.13576,49.30018%5D, %5B-123.13574,49.30097%5D%5D%7D,%22properties%22%3A%7B%22name%22%3A%22To%20Stanley %20Park%22,%22description%22%3A%22An%20evening%20walk%20to%20Stanley%20Park.%22%7D %7D%5D%7D&key=API_KEY Static maps 243 Amazon Location Service Response image Developer Guide Add styling to the line In this example, you will style the line added in the previous example. This includes defining the line's color, width, outline color, and outline width to customize the visual appearance of the line on the map. Static maps 244 Amazon Location Service Developer Guide Request { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "LineString", "coordinates":
amazon-location-developer-guide-061
amazon-location-developer-guide.pdf
61
Static maps 242 Amazon Location Service Developer Guide } } ] } Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&padding=200&scale- unit=KilometersMiles&geojson-overlay=%7B%22type%22%3A%22FeatureCollection %22,%22features%22%3A%5B%7B%22type%22%3A%22Feature%22,%22geometry%22%3A%7B %22type%22%3A%22LineString%22,%22coordinates%22%3A%5B%5B-123.11813,49.28246%5D, %5B-123.11967,49.28347%5D,%5B-123.12108,49.28439%5D,%5B-123.12216,49.28507%5D, %5B-123.12688,49.28812%5D,%5B-123.1292,49.28964%5D,%5B-123.13216,49.2916%5D, %5B-123.13424,49.29291%5D,%5B-123.13649,49.2944%5D,%5B-123.13678,49.29477%5D, %5B-123.13649,49.29569%5D,%5B-123.13657,49.29649%5D,%5B-123.13701,49.29715%5D, %5B-123.13584,49.29847%5D,%5B-123.13579,49.29935%5D,%5B-123.13576,49.30018%5D, %5B-123.13574,49.30097%5D%5D%7D,%22properties%22%3A%7B%22name%22%3A%22To%20Stanley %20Park%22,%22description%22%3A%22An%20evening%20walk%20to%20Stanley%20Park.%22%7D %7D%5D%7D&key=API_KEY Static maps 243 Amazon Location Service Response image Developer Guide Add styling to the line In this example, you will style the line added in the previous example. This includes defining the line's color, width, outline color, and outline width to customize the visual appearance of the line on the map. Static maps 244 Amazon Location Service Developer Guide Request { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [-123.11813, 49.28246], [-123.11967, 49.28347], [-123.12108, 49.28439], [-123.12216, 49.28507], [-123.12688, 49.28812], [-123.1292, 49.28964], [-123.13216, 49.2916], [-123.13424, 49.29291], [-123.13649, 49.2944], [-123.13678, 49.29477], [-123.13649, 49.29569], [-123.13657, 49.29649], [-123.13701, 49.29715], [-123.13584, 49.29847], [-123.13579, 49.29935], [-123.13576, 49.30018], [-123.13574, 49.30097] ] }, "properties": { "color": "#6d34b3", "width": "9m", "outline-color": "#a8b9cc", "outline-width": "2px" } } ] } Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&padding=200&scale- Static maps 245 Amazon Location Service Developer Guide unit=KilometersMiles&geojson-overlay=%7B%22type%22%3A%22FeatureCollection%22, %22features%22%3A%5B%7B%22type%22%3A%22Feature%22,%22geometry%22%3A%22LineString %22,%22coordinates%22%3A%5B%5B-123.11813,49.28246%5D,%5B-123.11967,49.28347%5D, %5B-123.12108,49.28439%5D,%5B-123.12216,49.28507%5D,%5B-123.12688,49.28812%5D, %5B-123.1292,49.28964%5D,%5B-123.13216,49.2916%5D,%5B-123.13424,49.29291%5D, %5B-123.13649,49.2944%5D,%5B-123.13678,49.29477%5D,%5B-123.13649,49.29569%5D, %5B-123.13657,49.29649%5D,%5B-123.13701,49.29715%5D,%5B-123.13584,49.29847%5D, %5B-123.13579,49.29935%5D,%5B-123.13576,49.30018%5D,%5B-123.13574,49.30097%5D%5D %7D,%22properties%22%3A%7B%22color%22%3A%22%236d34b3%22,%22width%22%3A%229m%22, %22outline-color%22%3A%22%23a8b9cc%22,%22outline-width%22%3A%222px%22%7D%7D%5D %7D&key=API_KEY Static maps 246 Amazon Location Service Response image Developer Guide How to add a route to a static map In this topic, you'll learn how to add a route to a static map using Amazon Location Service. You'll go through the steps to obtain a route using the CalculateRoutes API and then visualize it on a static map using GeoJSON and custom styling for points and lines. Static maps 247 Amazon Location Service Steps to add a route Developer Guide 1. Get routes from the CalculateRoutes API. Remove coordinates that fall on the same straight line to optimize the LineString, preventing the query string from reaching its limit. 2. Create a GeoJSON object based on the optimized set of coordinates. 3. Take the first and last points of the LineString and add Point geometries to mark the start and end locations. 4. Style the points and the LineString according to your business needs, adjusting properties like color, size, and labels. Add a route using compact style In this example, you will add a route with start and end points to the line created in the section called “Add a line to a static map”. The route will be defined with custom styling, including color, size, and labels for the start and end points. { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [-123.11813, 49.28246], [-123.11967, 49.28347], [-123.12108, 49.28439], [-123.12216, 49.28507], [-123.12688, 49.28812], [-123.1292, 49.28964], [-123.13216, 49.2916], [-123.13424, 49.29291], [-123.13649, 49.2944], [-123.13678, 49.29477], [-123.13649, 49.29569], [-123.13657, 49.29649], [-123.13701, 49.29715], [-123.13584, 49.29847], [-123.13579, 49.29935], [-123.13576, 49.30018], [-123.13574, 49.30097] Static maps 248 Developer Guide Amazon Location Service ] }, "properties": { "color": "#000000", "width": "20m", "outline-color": "#a8b9cc", "outline-width": "2px" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-123.11813, 49.28246] }, "properties": { "label": "Pacific Centre", "icon": "bubble", "size": "large", "color": "#34B3A4", "outline-color": "#006400", "text-color": "#FFFFFF" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-123.13574, 49.30097] }, "properties": { "label": "Stanley Park", "icon": "bubble", "size": "large", "color": "#B3346D", "outline-color": "#FF0000", "text-color": "#FFFFFF" } } ] } Static maps 249 Amazon Location Service Request URL Developer Guide https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&padding=200&scale- unit=KilometersMiles&geojson-overlay=%7B%22type%22%3A%22FeatureCollection %22,%22features%22%3A%5B%7B%22type%22%3A%22Feature%22,%22geometry%22%3A%7B %22type%22%3A%22LineString%22,%22coordinates%22%3A%5B%5B-123.11813,49.28246%5D, %5B-123.11967,49.28347%5D,%5B-123.12108,49.28439%5D,%5B-123.12216,49.28507%5D, %5B-123.12688,49.28812%5D,%5B-123.1292,49.28964%5D,%5B-123.13216,49.2916%5D, %5B-123.13424,49.29291%5D,%5B-123.13649,49.2944%5D,%5B-123.13678,49.29477%5D, %5B-123.13649,49.29569%5D,%5B-123.13657,49.29649%5D,%5B-123.13701,49.29715%5D, %5B-123.13584,49.29847%5D,%5B-123.13579,49.29935%5D,%5B-123.13576,49.30018%5D, %5B-123.13574,49.30097%5D%5D%7D,%22properties%22%3A%7B%22color%22%3A%22%23000000%22, %22width%22%3A%2220m%22,%22outline-color%22%3A%22%23a8b9cc%22,%22outline-width %22%3A%222px%22%7D%7D,%7B%22type%22%3A%22Feature%22,%22geometry%22%3A%22Point%22, %22coordinates%22%3A%5B-123.11813,49.28246%5D%7D,%22properties%22%3A%7B%22label %22%3A%22Pacific%20Centre%22,%22icon%22%3A%22bubble%22,%22size%22%3A%22large%22, %22color%22%3A%22%2334B3A4%22,%22outline-color%22%3A%22%23006400%22,%22text-color %22%3A%22%23FFFFFF%22%7D%7D,%7B%22type%22%3A%22Feature%22,%22geometry%22%3A%22Point %22,%22coordinates%22%3A%5B-123.13574,49.30097%5D%7D,%22properties%22%3A%7B%22label %22%3A%22Stanley%20park%22,%22icon%22%3A%22bubble%22,%22size%22%3A%22large%22, %22color%22%3A%22%23B3346D%22,%22outline-color%22%3A%22%23FF0000%22,%22text-color %22%3A%22%23FFFFFF%22%7D%7D%5D%7D&key=API_KEY Static maps 250 Amazon Location Service Response image Developer Guide How to add a polygon to a static map Buildings and locations can be highlighted on a map by designating a polygon around them, for example, the Pentagon (located in Washington, D.C.). Static maps 251 Amazon Location Service Add a single polygon Developer Guide In this example, you add a polygon (a pentagon) for the Pentagon building on the map. Geo JSON { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "coordinates": [ [ [ -77.0579282196337, 38.87264268371487 ], [ -77.05868880963534, 38.87003145971428 ], [ -77.05560979468949, 38.86876862025221 ], [ -77.05305311263672, 38.87059509268525 ], [ -77.0546384387842, 38.872985132206225 ], [ -77.0579282196337, 38.87264268371487 ] ] ], "type": "Polygon" } } ] Static maps 252 Amazon Location Service } Request URL Developer Guide https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=600&height=1024&padding=200&scale- unit=KilometersMiles&geojson-overlay=%7B%22type%22%3A%22FeatureCollection %22,%22features%22%3A%5B%7B%22type%22%3A%22Feature%22,%22geometry%22%3A %7B%22coordinates%22%3A%5B%5B%5B-77.0579282196337,38.87264268371487%5D, %5B-77.05868880963534,38.87003145971428%5D, %5B-77.05560979468949,38.86876862025221%5D, %5B-77.05305311263672,38.87059509268525%5D, %5B-77.0546384387842,38.872985132206225%5D,%5B-77.0579282196337,38.87264268371487%5D %5D%5D,%22type%22%3A%22Polygon%22%7D%7D%5D%7D&key=your_API_Key Static maps 253 Amazon Location Service Response image Developer Guide Add a style polygon In this example, we restyle the polygon shown in the previous example. We draw the polygon in a different color (#E3F70550). The color components are as follows. Static maps 254 Amazon Location Service Developer Guide • E3 represents the red component. • F7 represents the green component. • 05 represents the blue component. • 50 represents the alpha (opacity) component. Geo JSON { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "coordinates": [ [ [ -77.0579282196337, 38.87264268371487 ], [ -77.05868880963534, 38.87003145971428 ], [ -77.05560979468949, 38.86876862025221 ], [ -77.05305311263672, 38.87059509268525 ], [ -77.0546384387842, 38.872985132206225 ], [ -77.0579282196337, 38.87264268371487 ] ] ], Static maps
amazon-location-developer-guide-062
amazon-location-developer-guide.pdf
62
we restyle the polygon shown in the previous example. We draw the polygon in a different color (#E3F70550). The color components are as follows. Static maps 254 Amazon Location Service Developer Guide • E3 represents the red component. • F7 represents the green component. • 05 represents the blue component. • 50 represents the alpha (opacity) component. Geo JSON { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "coordinates": [ [ [ -77.0579282196337, 38.87264268371487 ], [ -77.05868880963534, 38.87003145971428 ], [ -77.05560979468949, 38.86876862025221 ], [ -77.05305311263672, 38.87059509268525 ], [ -77.0546384387842, 38.872985132206225 ], [ -77.0579282196337, 38.87264268371487 ] ] ], Static maps 255 Amazon Location Service Developer Guide "type": "Polygon" }, "properties": { "color": "#E3F70550" } } ] } Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&padding=100&scale- unit=KilometersMiles&geojson-overlay=%7B%22type%22%3A%22FeatureCollection %22,%22features%22%3A%5B%7B%22type%22%3A%22Feature%22,%22geometry%22%3A %7B%22coordinates%22%3A%5B%5B%5B-77.0579282196337,38.87264268371487%5D, %5B-77.05868880963534,38.87003145971428%5D, %5B-77.05560979468949,38.86876862025221%5D, %5B-77.05305311263672,38.87059509268525%5D, %5B-77.0546384387842,38.872985132206225%5D,%5B-77.0579282196337,38.87264268371487%5D %5D%5D,%22type%22%3A%22Polygon%22%7D,%22properties%22%3A%7B%22color%22%3A %22%23E3F70550%22%7D%7D%5D%7D&key=your_API_Key Static maps 256 Amazon Location Service Response image Developer Guide Add multiple polygons In this example, we add multiple polygons, to highlight multiple parks in New York City. Static maps 257 Amazon Location Service Geo JSON Developer Guide { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "color": "#00800050" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.95824708489555, 40.80055774655358 ], [ -73.9818875523859, 40.76810261850716 ], [ -73.9729556303776, 40.7642422333698 ], [ -73.94916953372382, 40.79699323614054 ], [ -73.95824708489555, 40.80055774655358 ] ] ] } }, { "type": "Feature", "properties": { "color": "#FF000050" }, "geometry": { Static maps 258 Amazon Location Service Developer Guide "type": "Polygon", "coordinates": [ [ [ -73.94432602794981, 40.80634757577718 ], [ -73.94607200977896, 40.803869579741644 ], [ -73.94301654157768, 40.80263972513214 ], [ -73.94127055974795, 40.805099411561145 ], [ -73.94432602794981, 40.80634757577718 ] ] ] } }, { "type": "Feature", "properties": { "color": "#0000FF50" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.9947948382843, 40.7691390468232 ], [ -73.99564708262241, 40.76802192177411 ], Static maps 259 Developer Guide Amazon Location Service [ -73.99372953286147, 40.76723992306512 ], [ -73.99289367783732, 40.76835706126087 ], [ -73.9947948382843, 40.7691390468232 ] ] ] } } ] } Request URL https://maps.geo.eu-central-1.amazonaws.com/v2/static/map? style=Satellite&width=1024&height=1024&padding=100&scale- unit=KilometersMiles&geojson-overlay=%7B%22type%22%3A%22FeatureCollection %22,%22features%22%3A%5B%7B%22type%22%3A%22Feature%22,%22properties%22%3A%7B %22color%22%3A%22%2300800050%22%7D,%22geometry%22%3A%7B%22type%22%3A%22Polygon %22,%22coordinates%22%3A%5B%5B%5B-73.95824708489555,40.80055774655358%5D, %5B-73.9818875523859,40.76810261850716%5D,%5B-73.9729556303776,40.7642422333698%5D, %5B-73.94916953372382,40.79699323614054%5D, %5B-73.95824708489555,40.80055774655358%5D%5D%5D%7D%7D,%7B %22type%22%3A%22Feature%22,%22properties%22%3A%7B%22color%22%3A %22%23FF000050%22%7D,%22geometry%22%3A%7B%22type%22%3A%22Polygon%22, %22coordinates%22%3A%5B%5B%5B-73.94432602794981,40.80634757577718%5D, %5B-73.94607200977896,40.803869579741644%5D, %5B-73.94301654157768,40.80263972513214%5D, %5B-73.94127055974795,40.805099411561145%5D, %5B-73.94432602794981,40.80634757577718%5D%5D%5D%7D%7D,%7B%22type%22%3A %22Feature%22,%22properties%22%3A%7B%22color%22%3A%22%230000FF50%22%7D, %22geometry%22%3A%7B%22type%22%3A%22Polygon%22,%22coordinates%22%3A%5B%5B %5B-73.9947948382843,40.7691390468232%5D,%5B-73.99564708262241,40.76802192177411%5D, %5B-73.99372953286147,40.76723992306512%5D, %5B-73.99289367783732,40.76835706126087%5D,%5B-73.9947948382843,40.7691390468232%5D %5D%5D%7D%7D%5D%7D&key=your_API_Key Static maps 260 Amazon Location Service Response image Developer Guide How to set language for static maps You can set the language for a static map, in case you don't want to use the default language. Static maps 261 Amazon Location Service Developer Guide In this example, a location in Tokyo which would generally default to Japanese text is requested in English, overwriting the regional default. The example shows the response image for a request where language is provided, and one where the language is not provided. The corresponding labels reflect the difference between a map showing the requested language and a map that shows the default language. Request URL - English set as the language https://maps.geo.us-east-1.amazonaws.com/v2/static/map? center=139.4575,35.539&style=Standard&lang=en&height=700&width=700&zoom=14 Static maps 262 Amazon Location Service Response image Developer Guide Request URL - default language https://maps.geo.us-east-1.amazonaws.com/v2/static/map? center=139.4575,35.539&style=Standard&height=700&width=700&zoom=14 Static maps 263 Amazon Location Service Response image Developer Guide How to add a proximity circle to a static map Proximity circles offer important insights into the accuracy of a reported or estimated device or user location. By showing a circle around the reported point, users are informed that the actual Static maps 264 Amazon Location Service Developer Guide position could fall anywhere within the circle, due to various factors affecting positioning precision. This added clarity helps with decision-making and enhances navigation safety. In this example, you add a proximity circle of 500 meters near the Eiffel Tower in Paris. Request { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 2.298151, 48.855921 ] }, "properties": { "style": "circle", "color": "#007BFF50", "width": "500m" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 2.298151, 48.855921 ] }, "properties": { "icon": "cp", "color": "#007BFF", "text-color":"#DC3545", "text-outline-color":"#007BFF", "outline-width":"20px", "label": "You are here", "size": "large" } } Static maps 265 Amazon Location Service ] } Request URL Developer Guide https://maps.geo.eu-central-1.amazonaws.com/v2/static/map@2x? style=Satellite&width=700&height=700&zoom=17&center=2.2958,48.8570&geojson- overlay=%7B%20%20%22type%22%3A%20%22FeatureCollection%22,%20%20%22features %22%3A%20%5B%20%20%20%20%7B%20%20%20%20%20%20%22type%22%3A%20%22Feature%22, %20%20%20%20%20%20%22geometry%22%3A%20%7B%20%20%20%20%20%20%20%20%22type %22%3A%20%22Point%22,%20%20%20%20%20%20%20%20%22coordinates%22%3A%20%5B %20%20%20%20%20%20%20%20%20%202.298151, %20%20%20%20%20%20%20%20%20%2048.855921%20%20%20%20%20%20%20%20%5D %20%20%20%20%20%20%7D,%20%20%20%20%20%20%22properties%22%3A %20%7B%20%20%20%20%20%20%20%20%22style%22%3A%20%22circle%22, %20%20%20%20%20%20%20%20%22color%22%3A%20%22%23007BFF50%22, %20%20%20%20%20%20%20%20%22width%22%3A%20%22500m%22%20%20%20%20%20%20%7D %20%20%20%20%7D,%20%20%20%20%7B%20%20%20%20%20%20%22type%22%3A%20%22Feature %22,%20%20%20%20%20%20%22geometry%22%3A%20%7B%20%20%20%20%20%20%20%20%22type %22%3A%20%22Point%22,%20%20%20%20%20%20%20%20%22coordinates%22%3A%20%5B %20%20%20%20%20%20%20%20%20%202.298151, %20%20%20%20%20%20%20%20%20%2048.855921%20%20%20%20%20%20%20%20%5D %20%20%20%20%20%20%7D,%20%20%20%20%20%20%22properties%22%3A%20%7B %20%20%20%20%20%20%20%20%22icon%22%3A%20%22cp%22,%20%20%20%20%20%20%20%20%22color %22%3A%20%22%23007BFF%22,%20%20%20%20%20%20%20%20%22text-color%22%3A %22%23DC3545%22,%20%20%20%20%20%20%20%20%22text-outline-color%22%3A %22%23007BFF%22,%20%20%20%20%20%20%20%20%22outline-width%22%3A%2220px %22,%20%20%20%20%20%20%20%20%22label%22%3A%20%22You%20are%20here%22, %20%20%20%20%20%20%20%20%22size%22%3A%20%22large%22%20%20%20%20%20%20%7D %20%20%20%20%7D%20%20%5D%7D&key=your_API_Key Static maps 266 Amazon Location Service Response image Developer Guide Manage costs and usage As you continue learning about Amazon Location maps, it's important to understand how to manage service capacity, ensure you follow usage limits, and get the best results through quota Manage costs and usage 267 Amazon Location Service Developer Guide and API optimizations. By applying best practices for performance and accuracy, you can tailor your application to handle place-related queries efficiently and maximize your API requests. Topics • Best practices for Amazon Location Service • Maps pricing • Map quotas and usage Best practices for Amazon Location Service When working with Amazon Location Service, adhering to best practices ensures your maps are optimized for performance, accuracy, and user experience. This section outlines key considerations for working with static maps, geographical bounds, and GeoJSON data
amazon-location-developer-guide-063
amazon-location-developer-guide.pdf
63
get the best results through quota Manage costs and usage 267 Amazon Location Service Developer Guide and API optimizations. By applying best practices for performance and accuracy, you can tailor your application to handle place-related queries efficiently and maximize your API requests. Topics • Best practices for Amazon Location Service • Maps pricing • Map quotas and usage Best practices for Amazon Location Service When working with Amazon Location Service, adhering to best practices ensures your maps are optimized for performance, accuracy, and user experience. This section outlines key considerations for working with static maps, geographical bounds, and GeoJSON data to enhance map functionality and visualization. Dynamic maps The following are a few best practices for working with dynamic maps in Amazon Location Service. Rendering optimization with MapLibre The following are few features of MapLibre which help optimize rendering for AWS map styles. For more information, see the section called “Map styles”. Skip validation of style If you are using the AWS map style, set validateStyle to false. This will turn off load-time style validation, speeding up the initial map load. Style validation is not needed with AWS map styles, because they are pre-validated. Example const map = new maplibregl.Map({ container: 'map', // ID of the div where the map will render style: 'https://maps.geo.${awsRegion}.amazonaws.com/v2/styles/${mapStyle}/ descriptor?key=${apiKey}', // Map style URL center: [0, 0], // Starting position [lng, lat] zoom: 2, // Starting zoom validateStyle: false, // Disable style validation for faster map load }); Best practices 268 Amazon Location Service Explanation Developer Guide • validateStyle: true: This enables validation of the map style against the MapLibre GL style specification. If there are any issues in the style, they'll be logged in the console. • If you set this to false, the map will skip the style validation process, which might result in faster loading, but without error checking. Pre-warm the map For single-page applications (SPAs) that may create and destroy the map many times as the user navigates through the app, the pre-warm function can reduce delays in re-creating the map after it has been destroyed. This feature is only recommended for SPAs. Static maps Bounds, bounding box (box) When working with maps and geographical data, defining the bounding box (bbox) and bounds parameters accurately is crucial, as they determine the geographic area of interest. Any inaccuracies can lead to undesirable results. Ensure precise bounds Ensure the specified bounds precisely represent the region you want to display. Even slight inaccuracies can crop or exclude portions of the desired area, defeating the visualization's purpose. Verify appropriate zoom level The map's zoom level is automatically calculated based on the specified bounds or bbox. Verify that the resulting zoom level provides appropriate detail and visibility for the entire area of interest. If the zoom is too high or low, the map may fail to convey the desired information effectively. Check for custom overlay visibility When using bbox or bounds with custom overlays like GeoJSON features, make sure the features' extent falls within the resulting map image. Features extending beyond the bounds may be clipped or omitted, leading to incomplete or misleading visualizations. Best practices 269 Amazon Location Service Use padding with bbox Developer Guide Use the bbox along with the padding parameter to ensure map features near the edges are fully visible and not cut off. By accurately defining the bbox and bounds parameters, you can ensure your maps represent the desired geographic area correctly, provide an appropriate level of detail, and effectively incorporate custom overlays or data layers. GeoJSON When using GeoJSON data, optimizing the query string by minifying the GeoJSON can help you stay within query string limits, especially for large datasets. Maps pricing Amazon Location Service offers competitive pricing for its Maps API based on the type of map request and the number of API calls made. This section provides an overview of the pricing structure for dynamic and static maps. For detailed pricing information, see Amazon Location Service pricing. Dynamic maps Pricing for the Maps API is based on the number of requests made to the GetTiles API. Other map-related APIs, such as GetGlyphs, GetStyleDescriptor, and GetSprites are free of charge. Static map images Pricing for static map images is based on the number of requests made to the GetStaticMap API. Each request for a static map image is counted towards the pricing calculation. Map quotas and usage Amazon Location Service imposes specific service quotas and usage limits for both dynamic and static maps. These limits are put in place to ensure fair usage and performance efficiency across all users. Below are the service quotas and adjustable limits for each service. Pricing 270 Amazon Location Service Service quotas Developer Guide Amazon Location Service sets default quotas for APIs to help manage service capacity, which can be viewed in the AWS
amazon-location-developer-guide-064
amazon-location-developer-guide.pdf
64
based on the number of requests made to the GetStaticMap API. Each request for a static map image is counted towards the pricing calculation. Map quotas and usage Amazon Location Service imposes specific service quotas and usage limits for both dynamic and static maps. These limits are put in place to ensure fair usage and performance efficiency across all users. Below are the service quotas and adjustable limits for each service. Pricing 270 Amazon Location Service Service quotas Developer Guide Amazon Location Service sets default quotas for APIs to help manage service capacity, which can be viewed in the AWS service quotas management console. You can request an increase in quotas through the self-service console, for up to twice the default limit for each API. For quota limits exceeding twice the default limit, request through the self service console and it will automatically submit a support ticket. Alternately, connect with your premium support team. There are no direct charges for quota increase requests, but higher usage levels may lead to increased service costs based on the additional resources consumed. For more information, see the section called “Manage quotas”. Dynamic map API name Default Max adjustable limit More than Adjustabl GetTiles 2000 4000 e Max limit Request on service quota console or contact support team Static map API name Default Max adjustable limit More than Adjustabl GetStaticMap 50 100 e Max limit Request on service quota console or contact support team Usage limits API name Limit GetStyleDescriptor Max requests, per second, per IP address. Value 5000 Quotas and usage 271 Amazon Location Service Developer Guide API name Limit Value 5000 Max requests, per second, per IP address. Max requests, per second, per IP address. 5000 Response payload size after compression. Response payload size after compression. 6MB 6MB GetGlyphys GetSprites GetStaticMap GetTiles Terms For more information, see the section called “Terms of use and data attribution”. Quotas and usage 272 Amazon Location Service Developer Guide Amazon Location Service Places With Amazon Location Places, you can add location-based capabilities to your application. Using Places APIs, you can search or geocode locations by querying a comprehensive place database containing over 400 million addresses and points of interest (POIs) across 108 countries. What is a Place? A place refers to any specific location, including administrative areas, addresses, POIs, geographic areas, and more. Places have various associated information such as name, address, coordinates, type, and details like business hours, contacts, access points, and POI categories. • Address: Includes specific point addresses (like offices, homes, apartments), street addresses, and interpolated addresses. • Points of Interest (POI): Includes businesses (like restaurants, stores) and landmarks (like parks, monuments). • Administrative Areas: Includes regions like countries, states, provinces, districts, and postal areas. • Geographic Areas: Includes locations like cities, neighborhoods, and localities. Features Search APIs enable users to discover places, points of interest (POIs), and addresses by querying based on names, categories, or locations. • Geocode APIs: Convert physical locations or addresses into geographic coordinates (longitude and latitude). • Intended use: Places APIs allow users to retrieve and utilize location data for various applications, from one-time uses to storing data for future reference. By default, data is retrieved for single-use, but options are available to store data persistently for analysis or further use. What is a Place? 273 Amazon Location Service Use cases Enhance your checkout experience Developer Guide Provide real-time suggestions for valid street addresses as customers enter their location on websites or apps. This helps ensure accurate delivery or pickup locations, reducing errors and creating a seamless checkout experience. Enhance cart completion rates by validating addresses to improve user satisfaction and drive conversions. For more information, refer to the related APIs: Autocomplete and Suggest. Discover local places Assist customers in finding the nearest, most relevant places. Real estate clients, for example, can locate nearby schools, grocery stores, and parks. Build lists of target businesses to market services and gain insights by searching by category and retrieving essential information like addresses and geocodes. For more information, refer to the related APIs: SearchNearby and SearchText. Provide customers with up-to-date business details Deliver the latest information on local businesses. Enable users to search by business name or category within a specific area, enhancing customer experience and supporting business decision-making. For example, help gym members locate health food stores nearby, or ensure delivery drivers arrive during open hours. For more information, refer to the related APIs: SearchNearby, SearchText, Suggest, and GetPlace. Enrich customer addresses with detailed insights Enhance existing customer address data with additional insights like postal codes, geo- coordinates, contact details, and business categories. Use the perpetual storage option to save this data in your database for strategic use in marketing and decision-making. For more information, refer to the related APIs: Geocode, Reverse Geocode, SearchText, and SearchNearby. Find geospatial coordinates of
amazon-location-developer-guide-065
amazon-location-developer-guide.pdf
65
area, enhancing customer experience and supporting business decision-making. For example, help gym members locate health food stores nearby, or ensure delivery drivers arrive during open hours. For more information, refer to the related APIs: SearchNearby, SearchText, Suggest, and GetPlace. Enrich customer addresses with detailed insights Enhance existing customer address data with additional insights like postal codes, geo- coordinates, contact details, and business categories. Use the perpetual storage option to save this data in your database for strategic use in marketing and decision-making. For more information, refer to the related APIs: Geocode, Reverse Geocode, SearchText, and SearchNearby. Find geospatial coordinates of addresses to calculate routes and driving directions Convert addresses or business names into geospatial coordinates and calculate optimal routes for tasks like food delivery or rideshare services. Use waypoint sequencing to create efficient paths for multiple stops. Use cases 274 Amazon Location Service Developer Guide For more information, refer to the related APIs: Suggest and SearchText. Identify time zones for locations Determine the correct time zone for specific locations (city, address, coordinates, or place ID). This feature is ideal for travel applications that require accurate time zones for itineraries and scheduling applications. Ensure that billing and compliance records use the appropriate timestamps. For more information, refer to the related APIs: Geocode, Reverse Geocode, SearchText, and GetPlace. Places APIs overview API name Description Additional resources Autocomplete Autocomplete completes potential search places or addresses as the user types, based the section called “Autocomplete” on the partial input. Autocomplete is not available in Japan. Geocode Geocode or forward geocode is converting a textual address or place into geographic the section called “Geocode” coordinates. Reverse Geocode Reverse geocode is converting geographic coordinates into a human-readable address or the section called “Reverse Geocode” place. GetPlace Suggest Get Place retrieves detailed information about a specific place, such as its address, opening hours, contacts, and other metadata. the section called “GetPlace” Suggest provides intelligent predictions or recommendations based on the user’s input or context, such as relevant places, points of interest or query term the section called “Suggest” Places APIs overview 275 Amazon Location Service Developer Guide API name Description Additional resources Search Text Search Text provides an ability to search for places, addresses or point of interest using the section called “Search Text” textual input, and it returns information such as a place name, address, phone, category, food type, contact, opening hours. Search Nearby Search nearby provides an ability to search for points of interest within a specified radius or the section called “Search Nearby” distance from a geographic coordinates. Places concepts The following topics provide foundational knowledge and best practices for using the Amazon Location Service Places API. These concepts are essential for effectively implementing the Places features within your application. Topics • Places terminology • Querying and biasing • Filtering • Localization and internationalization • Contacts and opening hours • Additional features • IntendedUse Places terminology This section provides essential definitions to understand core concepts within Amazon Location Service Places, such as location data types, geographic boundaries, and filtering options. These terms enable accurate use of the Places API capabilities. Places concepts 276 Amazon Location Service Location Developer Guide A specific point on Earth's surface, typically defined by geographic coordinates (longitude and latitude). Locations can represent any place or area, such as a city, building, or point of interest. Places Any location that includes administrative areas, addresses, points of interest (POI), geographic areas, and more. Places often have associated information, such as name, address, coordinates, types, business hours, contacts, and categories. Address Includes point-based addresses (like offices, homes), street addresses, and interpolated addresses, providing precise location data. See the definition of interpolation below. Point of Interest (POI) A POI refers to notable locations, such as businesses (like restaurants, stores) or landmarks (like parks, monuments). Administrative areas Regions such as countries, provinces, states, districts, blocks, and postal areas that organize geographical data. Geographic area Areas including cities, localities, and neighborhoods, offering additional levels of granularity in geographical data. Position A precise set of coordinates (longitude and latitude) that pinpoints where a place is located on a map. Bias position A reference point in geographic data that helps prioritize search results closer to this location, enhancing relevance in searches. Bounding box A rectangular geographic area defined by southwest and northeast coordinates, used to narrow down searches or display content within the area on a map. Places terminology 277 Amazon Location Service Place type Developer Guide A classification for places based on function or characteristics. Types include country, region, locality, district, postal area, block, intersection, street address, point address, interpolated address, or POI. Category A grouping for businesses and landmarks based on the type of services or activities they offer, such as restaurants, hotels, schools, and parks. Categories make it easier for users to find specific types
amazon-location-developer-guide-066
amazon-location-developer-guide.pdf
66
relevance in searches. Bounding box A rectangular geographic area defined by southwest and northeast coordinates, used to narrow down searches or display content within the area on a map. Places terminology 277 Amazon Location Service Place type Developer Guide A classification for places based on function or characteristics. Types include country, region, locality, district, postal area, block, intersection, street address, point address, interpolated address, or POI. Category A grouping for businesses and landmarks based on the type of services or activities they offer, such as restaurants, hotels, schools, and parks. Categories make it easier for users to find specific types of POIs in searches. Match score An indicator of how closely a search result aligns with the input, aiding in determining relevance. Interpolation The method of estimating unknown addresses by using known address locations as reference points. ISO 3166 country codes Amazon Location Service Places use International Organization for Standardization (ISO) 3166 country codes for identifying countries or regions. Find the code for each country on the ISO Online Browsing Platform. Querying and biasing Amazon Location Service Places API offers querying and biasing options to retrieve and search location data. Querying A query refers to the input parameters used to retrieve and search location data. The way APIs returns results is determined by these queries types. Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest QueryText Yes No Yes N/A Yes No Yes Querying and biasing 278 Amazon Location Service Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Developer Guide Suggest No Yes Yes No No No No No No No N/A No No N/A No Yes N/A No Yes N/A Yes No No No No No No No No No Query component Yes Query Position Query Radius No No Query Id No Place Id No Biasing The "bias position" is a location that influences search results, giving priority to places near biased position. It doesn't restrict results, but biases them toward the specified area. This feature prioritizes relevant location results when multiple places have similar names. Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest Yes No Yes N/A Yes No Yes BiasPosit ion Filtering Amazon Location Service Places API offers filtering options to narrow down search results based on specific criteria. These parameters refine results by including or excluding criteria such as geographic constraints, administrative areas, business chains, POI categories, and food types. This section details filtering parameters and options available in Amazon Location Service Places API. Each filter is explained below, including its impact on search results. Filtering 279 Amazon Location Service Geographic filters Developer Guide Geographic filters restrict search results within specified geographic boundaries, such as circles or bounding boxes. This allows users to target specific areas in their search queries. Filter Type Circle Bounding Box Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest No No No No Yes Yes N/A N/A Yes Yes No Yes Yes Yes Administrative area filters These filters allow users to limit search results to specific administrative areas, such as countries or place types. Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest Yes No Yes N/A Yes Yes Yes Yes Yes Yes N/A No No No Include Countries Include Place Types POI category filters POI category filters refine search results based on Points of Interest (POI) categories, such as specific business chains or food types. Filtering 280 Amazon Location Service Developer Guide Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest No No No N/A No Yes No No No No N/A No Yes No No No No N/A No Yes No No No No N/A No Yes No No No No N/A No Yes No No No No N/A No Yes No Include Categorie s Exclude Categorie s Include Business Chains Exclude Business Chains Include Food Type Exclude Food Type Definitions of filters Filtering for place types can be performed using the following criteria: FoodType, Category, and BusinessChainId. Circle A circular geographic area defined by a center point (longitude and latitude) and a radius. This filter restricts results to locations within the circle. Filtering 281 Amazon Location Service Bounding box Developer Guide A rectangular geographic region defined by two sets of coordinates (southwest and northeast corners), restricting results to locations within this box. Include countries Limits results to specific countries, allowing only locations within the specified countries to be included. Include place types Limits results to specific types of places, such as country, city, or neighborhood. Include and exclude categories Refines results based on specific POI categories, such as restaurants or shops. You can include or exclude categories to adjust search results. Include and exclude business chains Refines results based
amazon-location-developer-guide-067
amazon-location-developer-guide.pdf
67
within the circle. Filtering 281 Amazon Location Service Bounding box Developer Guide A rectangular geographic region defined by two sets of coordinates (southwest and northeast corners), restricting results to locations within this box. Include countries Limits results to specific countries, allowing only locations within the specified countries to be included. Include place types Limits results to specific types of places, such as country, city, or neighborhood. Include and exclude categories Refines results based on specific POI categories, such as restaurants or shops. You can include or exclude categories to adjust search results. Include and exclude business chains Refines results based on specific business chains, such as Starbucks or McDonald's. You can include or exclude business chains in your search criteria. Include and exclude food type Filters results by specific types of food-related places, such as Italian or Chinese cuisine. You can include or exclude food types as per your requirements. Place type filters These place types provide different levels of granularity in geographic searches, allowing users to refine results to return only specific types, such as country, region, street, or individual address level. Amazon Location Service supports the following Places types: Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest PostalCod e Yes No Yes N/A No Locality Yes Yes Yes N/A No No No No No Filtering 282 Amazon Location Service Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Developer Guide Suggest Yes No No No No No N/A No N/A N/A No No N/A No No No No No No No No No Yes Yes Yes Intersect ion Street PointAddr ess Yes Yes Interpola tedAddres Yes s Categories filters This section details the various point of interest (POI) categories available within Amazon Location Service. These categories enable users to filter search results to specific types of places, enhancing relevance and user experience for location-based applications. Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest Categorie s In Response In Response Not available In Response In Response In Request In Response only only only only and Response only Amazon Location Service supports a variety of place categories, which allow applications to filter POIs according to user needs. The categories enhance search precision by narrowing down results based on the type of location, such as restaurants, hospitals, or schools. To retrieve information on place categories, use the relevant Place API with filtering parameters for categories. For more information, refer to the Amazon Location Service API documentation. Filtering 283 Amazon Location Service Developer Guide Category name Category ID Adult Entertainment adult_entertainment Adult Shop adult_shop Advertising-Marketing, PR and Market Research advertising-marketing,_pr_and_market _research Aerial Tramway Airport Airport Cargo Airport Terminal aerial_tramway airport airport_cargo airport_terminal Ambulance Services ambulance_services Amusement Park Animal Park amusement_park animal_park Apartment Rental-Flat Rental apartment_rental-flat_rental Aquarium Art Museum aquarium art_museum Arts and Crafts Supplies arts_and_crafts_supplies Ashram ATM Attorney Auto Parts ashram atm attorney auto_parts Automobile Club automobile_club Automobile Dealership-New Cars automobile_dealership-new_cars Filtering 284 Amazon Location Service Category name Category ID Developer Guide Automobile Dealership-Used Cars automobile_dealership-used_cars Aviation aviation B2B Restaurant Services b2b_restaurant_services B2B Sales and Services b2b_sales_and_services Badminton badminton Bakery and Baked Goods Store bakery_and_baked_goods_store Bank Banquet Hall Bar or Pub Barber Basketball Bay-Harbor Beach bank banquet_hall bar_or_pub barber basketball bay-harbor beach Bed and Breakfast bed_and_breakfast Beer Garden beer_garden Bicycle and Bicycle Accessories Shop bicycle_and_bicycle_accessories_shop Bicycle Parking Bicycle Service bicycle_parking bicycle_service Bicycle Service and Maintenance bicycle_service_and_maintenance Bicycle Sharing Location bicycle_sharing_location Filtering 285 Amazon Location Service Category name Bike Park Category ID bike_park Bill Payment Service bill_payment_service Billiards-Pool Hall billiards-pool_hall Developer Guide Bistro Blood Bank BMX Shop BMX Track Boat Ferry Boating bistro blood_bank bmx_shop bmx_track boat_ferry boating Body of Water body_of_water Body Piercing and Tattoos body_piercing_and_tattoos Bookstore Border Crossing Bowling Center Brewery Building bookstore border_crossing bowling_center brewery building Bus Rapid Transit bus_rapid_transit Bus Station Bus Stop bus_station bus_stop Business Facility business_facility Filtering 286 Amazon Location Service Category name Business Service Butcher Cafeteria Campground Developer Guide Category ID business_service butcher cafeteria campground Camping-Hiking Shop camping-hiking_shop Campsite Canal campsite canal Canoe-Kayak Shop canoe-kayak_shop Car Repair Car Repair-Service Car Wash-Detailing Cargo Center car_repair car_repair-service car_wash-detailing cargo_center Cargo Transportation cargo_transportation Carshare Location carshare_location Casino Castle casino castle Casual Dining casual_dining Catering and Other Food Services catering_and_other_food_services Cellphone Parking Lot cellphone_parking_lot Cemetery cemetery Filtering 287 Amazon Location Service Category name Category ID Developer Guide Check Cashing Service-Currency Exchange check_cashing_service-currency_exchange Children's Apparel Children's Museum Chiropractor Church children's_apparel children's_museum chiropractor church Cigar and Tobacco Shop cigar_and_tobacco_shop Cinema City Hall cinema city_hall Civic-Community Center civic-community_center Clothing and Accessories clothing_and_accessories Clubhouse Coaching Institute Cocktail Lounge Coffee Shop Coffee-Tea clubhouse coaching_institute cocktail_lounge coffee_shop coffee-tea Collective Community collective_community Commercial Services commercial_services Communication-Media communication-media Commuter Rail Station commuter_rail_station Commuter Train commuter_train Filtering 288 Amazon Location Service Category name Category ID Developer Guide Complete Rest Area complete_rest_area Computer and
amazon-location-developer-guide-068
amazon-location-developer-guide.pdf
68
Catering and Other Food Services catering_and_other_food_services Cellphone Parking Lot cellphone_parking_lot Cemetery cemetery Filtering 287 Amazon Location Service Category name Category ID Developer Guide Check Cashing Service-Currency Exchange check_cashing_service-currency_exchange Children's Apparel Children's Museum Chiropractor Church children's_apparel children's_museum chiropractor church Cigar and Tobacco Shop cigar_and_tobacco_shop Cinema City Hall cinema city_hall Civic-Community Center civic-community_center Clothing and Accessories clothing_and_accessories Clubhouse Coaching Institute Cocktail Lounge Coffee Shop Coffee-Tea clubhouse coaching_institute cocktail_lounge coffee_shop coffee-tea Collective Community collective_community Commercial Services commercial_services Communication-Media communication-media Commuter Rail Station commuter_rail_station Commuter Train commuter_train Filtering 288 Amazon Location Service Category name Category ID Developer Guide Complete Rest Area complete_rest_area Computer and Software computer_and_software Construction construction Consumer Electronics Store consumer_electronics_store Consumer Goods Consumer Services Convenience Store consumer_goods consumer_services convenience_store Convention-Exhibition Center convention-exhibition_center County Council county_council Couriers Courthouse couriers courthouse COVID-19 Testing Site covid-19_testing_site Crematorium crematorium Cross Country Ski Shop cross_country_ski_shop Customer Care-Service Center customer_care-service_center Dairy Goods Dancing Deli dairy_goods dancing deli Delivery Entrance delivery_entrance Dentist-Dental Office dentist-dental_office Filtering 289 Amazon Location Service Category name Category ID Developer Guide Department Store department_store Discount Store Distillery Diving Center Doughnut Shop Drugstore discount_store distillery diving_center doughnut_shop drugstore Drugstore or Pharmacy drugstore_or_pharmacy Dry Cleaning and Laundry dry_cleaning_and_laundry Education Facility education_facility Electrical Embassy electrical embassy Emission Testing emission_testing Engineering and Scientific Services engineering_and_scientific_services Entertainment and Recreation entertainment_and_recreation Entertainment Electronics entertainment_electronics EV Battery Swap Station ev_battery_swap_station EV Charging Station ev_charging_station Event Spaces Facilities event_spaces facilities Family Restaurant family_restaurant Filtering 290 Amazon Location Service Category name Category ID Developer Guide Family-General Practice Physicians family-general_practice_physicians Farming Fast Food farming fast_food Ferry Terminal ferry_terminal Finance and Insurance finance_and_insurance Financial Investment Firm financial_investment_firm Fine Arts Fine Dining fine_arts fine_dining Fire Department fire_department Fitness-Health Club fitness-health_club Floor and Carpet floor_and_carpet Florist florist Flowers and Jewelry flowers_and_jewelry Food Market-Stall Food Production food_market-stall food_production Food-Beverage Specialty Store food-beverage_specialty_store Forest, Heath or Other Vegetation forest,_heath_or_other_vegetation Fueling Station fueling_station Fulfillment and Distribution Center fulfillment_and_distribution_center Funeral Director funeral_director Filtering 291 Amazon Location Service Category name Furniture Store Gallery Developer Guide Category ID furniture_store gallery Gambling-Lottery-Betting gambling-lottery-betting Garden Garden Center garden garden_center General Merchandise general_merchandise Gift, Antique and Art gift,_antique_and_art Glass and Window glass_and_window Golf Course golf_course Golf Practice Range golf_practice_range Golf Shop golf_shop Government Office government_office Government or Community Facility government_or_community_facility Grocery Guest House Gurdwara Hair and Beauty Hair Salon grocery guest_house gurdwara hair_and_beauty hair_salon Hardware, House and Garden hardware,_house_and_garden Healthcare and Healthcare Support Services healthcare_and_healthcare_support_services Filtering 292 Amazon Location Service Category name Higher Education Highway Exit Developer Guide Category ID higher_education highway_exit Historical Monument historical_monument History Museum history_museum Hockey Holiday Park hockey holiday_park Home Improvement home_improvement Home Specialty Store home_specialty_store Hospital hospital Hospital Emergency Room hospital_emergency_room Hospital or Health Care Facility hospital_or_health_care_facility Hostel Hot Spring Hotel hostel hot_spring hotel Hotel or Motel hotel_or_motel Human Resources and Recruiting Services human_resources_and_recruiting_services Hunting-Fishing Shop hunting-fishing_shop Hydrogen Fuel Station hydrogen_fuel_station Ice Skating Rink Inclined Rail ice_skating_rink inclined_rail Filtering 293 Amazon Location Service Category name Indoor Ski Indoor Sports Industrial Zone Developer Guide Category ID indoor_ski indoor_sports industrial_zone Interior and Exterior Design interior_and_exterior_design Internet Cafe internet_cafe Investigation Services investigation_services Island island IT and Office Equipment Services it_and_office_equipment_services Jazz Club Jeweler Karaoke jazz_club jeweler karaoke Kindergarten and Childcare kindergarten_and_childcare Lake lake Landmark-Attraction landmark-attraction Landscaping Services landscaping_services Language Studies Legal Services Leisure Library Lightrail Filtering language_studies legal_services leisure library lightrail 294 Amazon Location Service Category name Category ID Developer Guide Live Entertainment-Music live_entertainment-music Loading Dock Loading Zone Local Transit loading_dock loading_zone local_transit Locksmiths and Security Systems Services locksmiths_and_security_systems_services Lodging Lottery Booth Lumber Maid Services Major Appliance lodging lottery_booth lumber maid_services major_appliance Management and Consulting Services management_and_consulting_services Manufacturing manufacturing Marina Market marina market Marriage and Match Making Services marriage_and_match_making_services Medical Services-Clinics medical_services-clinics Meeting Point Men's Apparel Military Base meeting_point men's_apparel military_base Mining, Quarrying and Other Extraction mining,_quarrying_and_other_extraction Filtering 295 Amazon Location Service Category name Mobile Retailer Developer Guide Category ID mobile_retailer Mobile Service Center mobile_service_center Modeling Agencies modeling_agencies Money Transferring Service money_transferring_service Monorail Mosque Motel monorail mosque motel Motorcycle Accessories motorcycle_accessories Motorcycle Dealership motorcycle_dealership Motorcycle Service and Maintenance motorcycle_service_and_maintenance Motorcycle, Moped and Scooter Parking motorcycle,_moped_and_scooter_parking Motorway Service Rest Area motorway_service_rest_area Mountain or Hill Mountain Passes Mountain Peaks Mover Museum Nail Salon mountain_or_hill mountain_passes mountain_peaks mover museum nail_salon Named Intersection-Chowk named_intersection-chowk Natural and Geographical natural_and_geographical Filtering 296 Developer Guide Amazon Location Service Category name Night Club Category ID night_club Nightlife-Entertainment nightlife-entertainment Non-Store Retailers non-store_retailers Nursing Home nursing_home Off Road Trailhead off_road_trailhead Off-Road Vehicle Area off-road_vehicle_area Office Supply and Services Store office_supply_and_services_store Optical optical Organizations and Societies organizations_and_societies Other Bookshop Other Library other_bookshop other_library Other Place of Worship other_place_of_worship Outdoor Area-Complex outdoor_area-complex Outdoor Service outdoor_service Outdoor-Recreation outdoor-recreation Pagoda Paint Store Park and Ride pagoda paint_store park_and_ride Park-Recreation Area park-recreation_area Parking parking Filtering 297 Amazon Location Service Category name Category ID Developer Guide Parking and Restroom Only Rest Area parking_and_restroom_only_rest_area Parking Garage-Parking House parking_garage-parking_house Parking Lot parking_lot Parking Only Rest Area parking_only_rest_area Pawnshop Performing Arts Pet Care Pet
amazon-location-developer-guide-069
amazon-location-developer-guide.pdf
69
Category ID night_club Nightlife-Entertainment nightlife-entertainment Non-Store Retailers non-store_retailers Nursing Home nursing_home Off Road Trailhead off_road_trailhead Off-Road Vehicle Area off-road_vehicle_area Office Supply and Services Store office_supply_and_services_store Optical optical Organizations and Societies organizations_and_societies Other Bookshop Other Library other_bookshop other_library Other Place of Worship other_place_of_worship Outdoor Area-Complex outdoor_area-complex Outdoor Service outdoor_service Outdoor-Recreation outdoor-recreation Pagoda Paint Store Park and Ride pagoda paint_store park_and_ride Park-Recreation Area park-recreation_area Parking parking Filtering 297 Amazon Location Service Category name Category ID Developer Guide Parking and Restroom Only Rest Area parking_and_restroom_only_rest_area Parking Garage-Parking House parking_garage-parking_house Parking Lot parking_lot Parking Only Rest Area parking_only_rest_area Pawnshop Performing Arts Pet Care Pet Supply pawnshop performing_arts pet_care pet_supply Petrol-Gasoline Station petrol-gasoline_station Pharmacy Photography Plumbing Police Box pharmacy photography plumbing police_box Police Services-Security police_services-security Police Station Post Office police_station post_office Postal Collection Box postal_collection_box Power Equipment Dealer power_equipment_dealer Primary School primary_school Printing and Publishing printing_and_publishing Filtering 298 Amazon Location Service Category name Category ID Developer Guide Property Management property_management Psychiatric Institute psychiatric_institute Public Administration public_administration Public Restroom-Toilets public_restroom-toilets Public Sports Airport public_sports_airport Public Transit Access public_transit_access Race Track race_track Racquetball Court racquetball_court Rail Ferry Rail Yard rail_ferry rail_yard Ranger Station ranger_station Real Estate Services real_estate_services Record, CD and Video record,_cd_and_video Recreation Center Recycling Center Registration Office Religious Place Rental and Leasing Rental Car Agency recreation_center recycling_center registration_office religious_place rental_and_leasing rental_car_agency Repair and Maintenance Services repair_and_maintenance_services Filtering 299 Amazon Location Service Category name Repair Service Reservoir Developer Guide Category ID repair_service reservoir Residential Area-Building residential_area-building Rest Area Restaurant rest_area restaurant Rideshare Pickup rideshare_pickup River Road Assistance Roadside Station Rugby Running Track river road_assistance roadside_station rugby running_track Running-Walking Shop running-walking_shop RV Parks Ryokan rv_parks ryokan Scenic Overlook Rest Area scenic_overlook_rest_area Scenic Point School Science Museum Seaport-Harbour Secondary School scenic_point school science_museum seaport-harbour secondary_school Filtering 300 Amazon Location Service Category name Shoes-Footwear Shooting Range Shopping Mall Developer Guide Category ID shoes-footwear shooting_range shopping_mall Short-Time Motel short-time_motel Shrine Skate Shop Ski Lift Ski Resort Ski Shop shrine skate_shop ski_lift ski_resort ski_shop Snowboard Shop snowboard_shop Soccer Club Social Service soccer_club social_service Specialty Clothing Store specialty_clothing_store Specialty Food Store specialty_food_store Specialty Store specialty_store Specialty Trade Contractors specialty_trade_contractors Sporting Goods Store sporting_goods_store Sporting Instruction and Camps sporting_instruction_and_camps Sports Activities sports_activities Sports Complex-Stadium sports_complex-stadium Filtering 301 Amazon Location Service Category name Category ID Developer Guide Sports Facility-Venue sports_facility-venue Sports Field Squash Court Storage sports_field squash_court storage Student Housing student_housing Surf Shop Sweet Shop surf_shop sweet_shop Swimming Pool swimming_pool Synagogue Tack Shop synagogue tack_shop Tailor and Alteration tailor_and_alteration Take Out and Delivery Only take_out_and_delivery_only Tanning Salon tanning_salon Taqueria Tax Service Taxi Stand Tea House taqueria tax_service taxi_stand tea_house Telephone Service telephone_service Temple Tennis Court temple tennis_court Filtering 302 Amazon Location Service Category name Category ID Developer Guide Theatre, Music and Culture theatre,_music_and_culture Therapist Tire Repair Tollbooth therapist tire_repair tollbooth Tourist Attraction tourist_attraction Tourist Information tourist_information Towing Service towing_service Toy Store Trailhead Train Station toy_store trailhead train_station Training and Development training_and_development Translation and Interpretation Services translation_and_interpretation_services Transportation Service transportation_service Travel Agent-Ticketing travel_agent-ticketing Truck Dealership truck_dealership Truck Parking Truck Repair Truck Stop-Plaza Truck Wash truck_parking truck_repair truck_stop-plaza truck_wash Truck-Semi Dealer-Services truck-semi_dealer-services Filtering 303 Amazon Location Service Category name Category ID Developer Guide Underground Train-Subway underground_train-subway Undersea Feature undersea_feature Urgent Care Center urgent_care_center Used-Second Hand Merchandise Stores used-second_hand_merchandise_stores Utilities Vaccination Site Van Repair Vaping Store Variety Store Veterinarian utilities vaccination_site van_repair vaping_store variety_store veterinarian Video and Game Rental video_and_game_rental Video Arcade-Game Room video_arcade-game_room Warehouse warehouse Waste and Sanitary waste_and_sanitary Water Park Water Transit Waterfall water_park water_transit waterfall Wedding Services and Bridal Studio wedding_services_and_bridal_studio Weigh Station weigh_station Wellness Center and Services wellness_center_and_services Filtering 304 Amazon Location Service Developer Guide Category name Wholesale Store Wild Animal Park Wildlife Refuge Wine and Liquor Winery Category ID wholesale_store wild_animal_park wildlife_refuge wine_and_liquor winery Women's Apparel women's_apparel Zoo zoo Food Type filters This section provides an overview of supported food type filters in Amazon Location Service. These filters allow you to narrow down search results for places, focusing specifically on types of cuisine or food-related points of interest (POIs), enhancing location-based searches for users seeking specific dining options. The food type filter feature in Amazon Location Service helps refine search results by specific types of cuisine or food establishments, supporting user preferences for targeted location searches. Below are the supported food types and their IDs. To apply food type filters, use the Place APIs with the `foodType` parameter set to the desired cuisine. For detailed guidance on implementing these filters, see the Amazon Location Service API documentation. Name American FoodType ID american American-Barbecue/Southern american-barbecue/southern American-Cajun american-cajun American-Californian american-californian Filtering 305 Amazon Location Service Name American-Creole Developer Guide FoodType ID american-creole American-Native American american-native_american American-Soul Food american-soul_food American-Southern american-southern American-Southwestern american-southwestern Argentinean Armenian Asian Australian Austrian Azerbaijani Balkan Baltic Belgian Belorusian Bistro Bohemian Brazilian argentinean armenian asian australian austrian azerbaijani balkan baltic belgian belorusian bistro bohemian brazilian Brazilian-Baiana Brazilian-Bakery brazilian-baiana brazilian-bakery Filtering 306
amazon-location-developer-guide-070
amazon-location-developer-guide.pdf
70
and their IDs. To apply food type filters, use the Place APIs with the `foodType` parameter set to the desired cuisine. For detailed guidance on implementing these filters, see the Amazon Location Service API documentation. Name American FoodType ID american American-Barbecue/Southern american-barbecue/southern American-Cajun american-cajun American-Californian american-californian Filtering 305 Amazon Location Service Name American-Creole Developer Guide FoodType ID american-creole American-Native American american-native_american American-Soul Food american-soul_food American-Southern american-southern American-Southwestern american-southwestern Argentinean Armenian Asian Australian Austrian Azerbaijani Balkan Baltic Belgian Belorusian Bistro Bohemian Brazilian argentinean armenian asian australian austrian azerbaijani balkan baltic belgian belorusian bistro bohemian brazilian Brazilian-Baiana Brazilian-Bakery brazilian-baiana brazilian-bakery Filtering 306 Amazon Location Service Name Brazilian-Capixaba Brazilian-Mineira Breakfast BrewPub British Isles Brunch Bruneian Burgers Burmese Cambodian Canadian Caribbean Caucasian Chicken Chilean Chinese Developer Guide FoodType ID brazilian-capixaba brazilian-mineira breakfast brewpub british_isles brunch bruneian burgers burmese cambodian canadian caribbean caucasian chicken chilean chinese Chinese-Beijing chinese-beijing Chinese-Cantonese chinese-cantonese Chinese-Guangxi Chinese-Hot Pot chinese-guangxi chinese-hot_pot Filtering 307 Amazon Location Service Name FoodType ID Developer Guide Chinese-Hunan/Hubei chinese-hunan/hubei Chinese-Inner Mongolian chinese-inner_mongolian Chinese-Islamic chinese-islamic Chinese-Jiangsu/Zhejiang chinese-jiangsu/zhejiang Chinese-Jiangxi chinese-jiangxi Chinese-Northeastern chinese-northeastern Chinese-Northwestern chinese-northwestern Chinese-Porridge Chinese-Shandong Chinese-Shanghai Chinese-Szechuan Chinese-Taiwanese chinese-porridge chinese-shandong chinese-shanghai chinese-szechuan chinese-taiwanese Chinese-Yunnan/Guizhou chinese-yunnan/guizhou Continental Creperie Cuban Danish Dinner Dutch continental creperie cuban danish dinner dutch East European east_european Filtering 308 Amazon Location Service Developer Guide Name Egyptian Ethiopian European Fast Food Filipino Finnish Fondue French FoodType ID egyptian ethiopian european fast_food filipino finnish fondue french French-Alsatian french-alsatian French-Auvergnate french-auvergnate French-Basque French-Corse French-Lyonnaise French-Provencale French-Sud-ouest Fusion German Greek Grill Halal french-basque french-corse french-lyonnaise french-provencale french-sud-ouest fusion german greek grill halal Filtering 309 Amazon Location Service Name FoodType ID Developer Guide Hawaiian/Polynesian hawaiian/polynesian Hot Dogs Hungarian Ice Cream Indian Indian-Bengali Indian-Goan Indian-Gujarati hot_dogs hungarian ice_cream indian indian-bengali indian-goan indian-gujarati Indian-Hyderabadi indian-hyderabadi Indian-Jain Indian-Konkani indian-jain indian-konkani Indian-Maharashtrian indian-maharashtrian Indian-Malvani Indian-Mughlai indian-malvani indian-mughlai Indian-North Indian indian-north_indian Indian-Parsi Indian-Punjabi indian-parsi indian-punjabi Indian-Rajasthani indian-rajasthani Indian-South Indian indian-south_indian Indian-Tandoori indian-tandoori Filtering 310 Amazon Location Service Developer Guide Name Indonesian International Irish Italian Japanese Japanese-Chanko Japanese-Curry FoodType ID indonesian international irish italian japanese japanese-chanko japanese-curry Japanese-Fish/Other Seafood japanese-fish/other_seafood Japanese-Gyoza Japanese-Hibachi Japanese-Izakaya japanese-gyoza japanese-hibachi japanese-izakaya Japanese-Jingisukan japanese-jingisukan Japanese-Kaiseki japanese-kaiseki Japanese-Okonomiyaki japanese-okonomiyaki Japanese-Ramen japanese-ramen Japanese-Rice Bowl japanese-rice_bowl Japanese-Shabushabu japanese-shabushabu Japanese-Sukiyaki Japanese-Sushi japanese-sukiyaki japanese-sushi Japanese-Sushi Train japanese-sushi_train Filtering 311 Amazon Location Service Name FoodType ID Developer Guide Japanese-Takoyaki japanese-takoyaki Japanese-Tempura/Other Fried Food japanese-tempura/other_fried_food Japanese-Tonkatsu japanese-tonkatsu Japanese-Udon/Other Noodles japanese-udon/other_noodles Japanese-Unagi/Anago japanese-unagi/anago Japanese-Yakiniku japanese-yakiniku Japanese-Yakitori/Chicken japanese-yakitori/chicken Jewish/Kosher jewish/kosher Kebab Korean kebab korean Latin American latin_american Lebanese Lunch Malaysian Maltese Mediterranean Mexican lebanese lunch malaysian maltese mediterranean mexican Mexican-Oaxaquena mexican-oaxaquena Mexican-Poblana mexican-poblana Mexican-Veracruzana mexican-veracruzana Filtering 312 Amazon Location Service Name FoodType ID Developer Guide Mexican-Yucateca mexican-yucateca Middle Eastern Moroccan Natural/Healthy Noodles North African Norwegian Oceanic Organic Pakistani Pastries Peruvian Pizza Polish Portuguese Romanian Russian Sandwich Scandinavian Seafood middle_eastern moroccan natural/healthy noodles north_african norwegian oceanic organic pakistani pastries peruvian pizza polish portuguese romanian russian sandwich scandinavian seafood Filtering 313 Amazon Location Service Developer Guide Name Seychellois Sicilian Singaporean FoodType ID seychellois sicilian singaporean Snacks and Beverages snacks_and_beverages Soup South African South American Southeast Asian Spanish Spanish-Tapas Sri Lankan Steak House Surinamese Swedish Swiss Thai Tibetan Turkish Ukrainian Vegan soup south_african south_american southeast_asian spanish spanish-tapas sri_lankan steak_house surinamese swedish swiss thai tibetan turkish ukrainian vegan Filtering 314 Amazon Location Service Developer Guide Name Vegetarian Venezuelan Vietnamese Yemeni Business Chains filter FoodType ID vegetarian venezuelan vietnamese yemeni This section explains how to filter search results using business chain identifiers within Amazon Location Service's Places API. This feature allows users to refine location searches based on well- known business chains, helping enhance the search experience for brand-specific requests. The business chains filter enables focused search results by allowing users to specify one or more chain identifiers, useful for finding specific brand locations (for example, coffee shops, gas stations). To apply business chain filters, use the Place APIs with the `businessChain` parameter set to the desired chain identifier. For implementation details, see the Amazon Location Service API documentation. Localization and internationalization Localization (L10n) and Internationalization (I18n) are key processes in adapting software, content, or applications for different languages, regions, and views. Here's an overview in the context of specific factors: Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest Language Yes Political View Yes Yes Yes Yes Yes N/A N/A Yes Yes Yes Yes Yes Yes Localization and internationalization 315 Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Developer Guide Suggest No No N/A Yes Yes Yes N/A Yes Yes Yes Amazon Location Service Filter Type Time Zone Yes Yes Phonemes No No Language The feature allows you to select a preferred response language from BCP47-compliant codes. It detects the query language based on name variants and uses the preferred language for unmatched tokens and ambiguous cases. If no requested language, Places API provides results in the official country language, but it prioritizes the regional language in
amazon-location-developer-guide-071
amazon-location-developer-guide.pdf
71
Yes Yes Yes Yes Yes Yes Localization and internationalization 315 Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Developer Guide Suggest No No N/A Yes Yes Yes N/A Yes Yes Yes Amazon Location Service Filter Type Time Zone Yes Yes Phonemes No No Language The feature allows you to select a preferred response language from BCP47-compliant codes. It detects the query language based on name variants and uses the preferred language for unmatched tokens and ambiguous cases. If no requested language, Places API provides results in the official country language, but it prioritizes the regional language in regions where it differs. As a fallback strategy, Places APIs return addresses in the default language if some address elements are unavailable in the requested language. Political view Places APIs allow you to adapt results to reflect local political sensitivities or guidelines of the local government. By default, Places APIs show an international perspective on disputed political boundaries. • AR: Argentina's view on the Southern Patagonian Ice Field and Tierra Del Fuego, including the Falkland Islands, South Georgia, and South Sandwich Islands. • EG: Egypt's view on Bir Tawil. • IN: India's view on Gilgit-Baltistan. • KE: Kenya's view on the Ilemi Triangle. • MA: Morocco's view on Western Sahara. • RU: Russia's view on Crimea. • SD: Sudan's view on the Halaib Triangle. • RS: Serbia's view on Kosovo, Vukovar, and Sarengrad Islands. • SR: Suriname's view on the Courantyne Headwaters and Lawa Headwaters. • SY: Syria's view on the Golan Heights. • TR: Turkey's view on Cyprus and Northern Cyprus. Localization and internationalization 316 Amazon Location Service Developer Guide • TZ: Tanzania's view on Lake Malawi. • UY: Uruguay's view on Rincon de Artigas. • VN: Vietnam's view on the Paracel Islands and Spratly Islands. Time zone The feature provides additional time zone information. This includes time zone names and UTC offsets. Phonemes The feature provides additional phoneme information on how to pronounce the various components of the address or place. Contacts and opening hours Amazon Location Service provides details on contacts and opening hours for various points of interest (POIs), enabling applications to offer comprehensive information about business operations. This section covers contact and business hours information and how to retrieve and interpret these details effectively. Amazon Location Service can provide structured data on the contact details and business hours of points of interest (POIs), enabling applications to display accurate information. This data is valuable for applications where real-time availability or business operations influence customer experience. Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest No No No No Yes Yes Yes Yes Yes Yes No No Contacts No Opening Hours No Contact details Contact details for a place include structured information such as phone numbers, email addresses, and websites. These details are available for businesses listed in place data. Contacts and opening hours 317 Amazon Location Service Phone Number Developer Guide The primary contact number for a business. This field may include international dialing codes to ensure accurate connection, regardless of the caller’s location. Email Address The primary contact email for inquiries. It may be available for businesses that provide an email address in their public listing. Website A link to the official website, providing users with additional information or access to services such as online booking or support. Opening hours Opening hours indicate the regular business hours for a location, providing users with insights into availability. This information is crucial for applications where users need to know when a business is open or closed. Regular Hours The standard weekly opening hours, typically provided as daily ranges (e.g., Monday to Friday, 9 AM to 5 PM). These indicate the usual operating schedule. Special Hours Exceptional hours for holidays or special events, provided as overrides to regular hours. For example, holiday hours or closures can be indicated to inform users of temporary changes in schedule. Open Now An indicator of whether a location is currently open, based on the local time. This information is helpful for users looking for businesses that are open at the time of their query. For further details, refer to the Amazon Location Service API documentation to explore options for retrieving contact details and opening hours for points of interest. Contacts and opening hours 318 Amazon Location Service Additional features Developer Guide This section provides an overview of additional features supported by the Place APIs. These features provide additional location information by including requested details such as contact information, accessibility, and phonemes. You need to request additional feature by adding AdditionalFeatures: [ <Value1>, <Value 2>, ..] in your request payload. Note Review the section called “Places pricing” for additional information about cost. Valid Values Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest Core Default
amazon-location-developer-guide-072
amazon-location-developer-guide.pdf
72
options for retrieving contact details and opening hours for points of interest. Contacts and opening hours 318 Amazon Location Service Additional features Developer Guide This section provides an overview of additional features supported by the Place APIs. These features provide additional location information by including requested details such as contact information, accessibility, and phonemes. You need to request additional feature by adding AdditionalFeatures: [ <Value1>, <Value 2>, ..] in your request payload. Note Review the section called “Places pricing” for additional information about cost. Valid Values Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest Core Default Default Yes Default Default Default Yes Time Zone Yes Yes Phonemes No Contacts No Opening Hours Access Points No No No No No Yes No No No No No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No No Yes Yes Yes Yes To use these additional features, set the additionalFeatures parameter in the Place API requests. Refer to the Amazon Location Service API documentation for details. For additional information on Time Zone and Phonemes, see the section called “Localization and internationalization”. For additional information on Contacts and Opening Hours, see the section called “Contacts and opening hours”. Additional features 319 Amazon Location Service Definitions Time Zone Displays the time zone of a given place. Phonemes Developer Guide Offers phonetic representations for place names, aiding pronunciation. Contacts Provides contact details such as phone numbers and email addresses for places. Opening Hours An indicator of whether a location is currently open, based on the local time. This information is helpful for users looking for businesses that are open at the time of their query. Access Points Includes access point information, such as entrances. IntendedUse Note If results are stored, then they will be billed at the higher storage pricing tier. Use request parameter IntendedUse to specify whether the results are for single use or storage. See the section called “Places pricing” to understand costs associated with stored results. When you call a place API, specify IntendedUse by setting the value to be either SingleUse or Storage, based on the intended use of the results. If you are going to store the results (even for caching purposes), you must choose the storage option, not the single use option. Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Suggest SingleUse Yes Yes Yes Yes Yes Yes Yes IntendedUse 320 Amazon Location Service Filter Type Geocode Reverse Geocode Autocompl ete Get Place Search Text Search Nearby Developer Guide Suggest Storage Yes Yes No Yes Yes Yes No Get Started Places enable applications to search, find, and retrieve details about points of interest, addresses, and specific locations. These capabilities enhance location-based services by providing context and improving user experience in search functions. • Geocode: Converts addresses or place names into geographic coordinates (longitude, latitude), supporting applications that require address-to-location transformation for mapping and spatial analysis. For more information, see the section called “Reverse Geocode”. • Reverse Geocode: Converts geographic coordinates to the nearest address or place name, providing context for a location. For more information, See the section called “Reverse Geocode”. • Autocomplete: Suggests potential completions for user-entered text, improving efficiency in search input. For more information, See the section called “Autocomplete”. • GetPlace: Retrieves detailed information about a specified place, including attributes like address, contact details, and opening hours. For more information, See the section called “GetPlace”. • SearchNearby: Finds places within a specified radius of a given geographic point, suitable for "near me" searches. For more information, See the section called “Search Nearby”. • SearchText: Allows text-based searching for places or points of interest based on a keyword or phrase, ideal for finding locations by name or description. For more information, See the section called “Search Text”. • Suggest: Provides search term suggestions as users type, enhancing search relevance and user experience. For more information, See the section called “Suggest”. The following table presents a number of business use cases that are best solved with Places APIs. Places use cases The following section presents a number of business use cases that are best solved with Places APIs. Get Started 321 Amazon Location Service Developer Guide Business need Useful API Examples SearchNearBy Add a neighbourhood business information in an application Also returns business information, such as categorie s and food types. Proximity Search for business chain Search Text Suggest Also returns business information, such as categorie s, food types, and access points. Search by phone name Search Text Suggest Also returns business information, such as categorie s, food types, and access points. Search by name of place, POI, category Search Text Suggest the section called “Search for a place, POI, or business using a name” Also returns business information, such as categorie s, food
amazon-location-developer-guide-073
amazon-location-developer-guide.pdf
73
Developer Guide Business need Useful API Examples SearchNearBy Add a neighbourhood business information in an application Also returns business information, such as categorie s and food types. Proximity Search for business chain Search Text Suggest Also returns business information, such as categorie s, food types, and access points. Search by phone name Search Text Suggest Also returns business information, such as categorie s, food types, and access points. Search by name of place, POI, category Search Text Suggest the section called “Search for a place, POI, or business using a name” Also returns business information, such as categorie s, food types, and access points. Predict suggestions as user key query Suggest the section called “Predict suggestions based on input” Also returns business information, such as categorie Places 322 Amazon Location Service Developer Guide Business need Useful API Examples s, food types, and access points. Autocomplete or suggest for autofill an address on checkout page Normalizes and standardizes addresses. Autocomplete, Suggest the section called “How to complete an address” Convert a specific address to longitude and latitude Geocode coordinates Normalizes and standardizes addresses. Convert longitude and latitude coordinates into a corresponding address Normalizes and standardizes addresses. Reverse Geocode the section called “Reverse geocode for a position” Get Timezone of a City Geocode Supports UTC offset and time zone name. Get Timezone for longitude and latitude Reverse Geocode Supports UTC offset and time zone name. Places 323 Amazon Location Service Developer Guide Business need Useful API Examples Get place by place id Get Place the section called “Get results for a PlaceId” Returns business information, such as categories, contacts, opening hours, and access points. Get name, contacts, and opening hours of a point of Search Text, Search Nearby, Suggestion interest Returns business informati on, such as categories, food types, and access points. Provide places type for a place name Supports pre-filtering. Geocode Autocomplete Provide places type for a latitude/longitude coordinat Reverse Geocode es Supports pre-filtering. Provide poi categories (such as hospital, store, museum and 500 more) for an address or POI Supports pre-filtering. Search Text, Search Nearby, Suggestion Places 324 Amazon Location Service Developer Guide Business need Useful API Examples Autocomplete Suggest the section called “Predict suggestions based on input” Add the type-ahead search behavior for completion or predictions Supports cost efficient, label- only, and address component. Visualize Places search and/ or geocode result on a map All APIs return geocoordi nates, except autocomplete. GetTile and GetStyleD escriptor with rendering engine (MapLibre) with Places API Geocode, Reverse Geocode Enhance, clean, normalize and standardize your address database Supports address label, components, timezone, and more. Geocode Note Stored results incur higher Storage pricing. Use the IntendedUse parameter to indicate single-use or storage. Refer to the the section called “Places pricing” to understand cost implications for stored results. Geocoding transforms textual addresses or place names into geographic coordinates, along with detailed address components and additional information. This API supports flexible queries, including both free-form text and structured queries with street names, postal codes, and regions. Optional features include time zone data and political view adjustments. Geocode 325 Amazon Location Service Use cases Developer Guide • Add supplementary data to customer addresses: Improve address records by including zip codes, coordinates, and utilizing persistent storage to support informed business and marketing decisions. • Address Data Standardization: Apply geocoding in data pipelines or batch processes to standardize address data, utilizing persistent storage for ongoing reference. • Determine Time Zones: Identify the time zone for cities or addresses to provide accurate timestamps for applications like travel, scheduling, and invoicing. Understand the request The request accepts optional parameters, such as AdditionalFeatures, BiasPosition, and Filter, to refine the search results. Additional options, like Language, MaxResults, and PoliticalView, provide further customization of the response. The required parameter is Query, which can be provided as free-form text or structured as QueryComponents. For more information, refer to the Geocode API Reference. The request includes the following key parameters: Authentication For authentication, the Key parameter is optional if other methods are in use. • Key: Optional parameter for authentication. For more information, see Authentication Querying and biasing Parameters used for querying and geographic biasing of results. • QueryText: Free-form text query for searching locations. • QueryComponents: Structured components such as address number, country, locality, or postal code for precise searching. • BiasPosition: Geographic position to bias search results towards. For more information, see the section called “Querying and biasing” Refining Results Apply filters to refine the results. Geocode 326 Amazon Location Service Developer Guide • Filter: Filter to include specific countries or place types. For more information, see the section called “Filtering”. Internationalization and localization Specify language and apply political view for localized results. • Language: Language for the results. • PoliticalView: Applies a political view reflecting territorial claims. For more information, see the section
amazon-location-developer-guide-074
amazon-location-developer-guide.pdf
74
QueryComponents: Structured components such as address number, country, locality, or postal code for precise searching. • BiasPosition: Geographic position to bias search results towards. For more information, see the section called “Querying and biasing” Refining Results Apply filters to refine the results. Geocode 326 Amazon Location Service Developer Guide • Filter: Filter to include specific countries or place types. For more information, see the section called “Filtering”. Internationalization and localization Specify language and apply political view for localized results. • Language: Language for the results. • PoliticalView: Applies a political view reflecting territorial claims. For more information, see the section called “Localization and internationalization” Additional Features Request additional information like time zone details. • AdditionalFeatures: Option to request additional details such as time zone. For more information, see the section called “Additional features”. Understand the response The response provides ResultItems, which contain detailed location data such as Address, PlaceId, Position, and other relevant attributes. Additional features like TimeZone information or match scores for each query component may also be included. Each ResultItem represents a matched location or geocoding result based on the specified request parameters. For further details, see the Geocode API Reference. The response includes the following key parameters: Address and related details Details about the returned location, including address components. • Address: Full address including country, region, postal code, and street details. • PostalCodeDetails: Additional information related to postal codes. • StreetComponents: Street details including base name and type. Place types and categories Information on the type and category of place returned. • Categories: List of categories describing the place, for example Restaurants, Schools. • PlaceType: Specifies the type of place, such as city, address, or region. Geocode 327 Amazon Location Service Result analysis Developer Guide Scores indicating how closely results match the input query. • MatchScores: Scores for matching precision. Additional details Includes extra location-related information as needed. • AccessPoints: Geographic coordinates representing access points. • TimeZone: Time zone information for the location. Reverse Geocode Note If results are stored, they will be billed at the higher Storage pricing tier. Use the IntendedUse parameter to specify whether the results are for single use or storage. Refer to the section called “Places pricing” for cost implications associated with stored results. Reverse Geocode converts geographic coordinates into a human-readable address or place. It provides detailed address components, place type, category, and street information, with filtering options based on place type to refine results. The API can also include additional features, such as time zone information and political view adjustments. Use cases • Add supplementary data to customer position data: Improve position data records by including zip codes, coordinates, and utilizing persistent storage to support informed business and marketing decisions. • Position data standardization: Apply geocoding in data pipelines or batch processes to standardize position data, utilizing persistent storage for ongoing reference. • Determine time zones: Identify the time zone for cities or addresses to provide accurate timestamps for applications like travel, scheduling, and invoicing. Reverse Geocode 328 Amazon Location Service Understand the request Developer Guide The Reverse Geocode API request accepts a combination of required and optional parameters to customize results. The required parameter QueryPosition (longitude and latitude) specifies the coordinates to reverse geocode. Optional parameters include AdditionalFeatures for extra data, Filter to refine results, and MaxResults to limit the number of returned results. Additional options like Language, PoliticalView, and IntendedUse allow for further customization. For more details, refer to the Reverse Geocode API Reference. The request accepts the following key parameters: Authentication The Key parameter is optional if other authentication methods are used. • Key: Optional parameter for authentication. For more information, see Authentication. Querying Parameters used for defining the geographic location and search radius. • QueryPosition: Specifies the longitude and latitude for the reverse geocode request. • QueryRadius: Defines the search radius around the coordinates. For more information, see the section called “Querying and biasing”. Refining results Apply filters to limit the search results to specific countries or place types. • Filter: Filter for results based on country or place type. For more details, see the section called “Filtering”. Internationalization and localization Options to customize the language and apply a political view to the results. • Language: Specifies the language of the results. • PoliticalView: Applies a political view reflecting territorial claims. For more information, see the section called “Localization and internationalization”. Reverse Geocode 329 Amazon Location Service Additional features Developer Guide Requests extra data, such as time zone information. • AdditionalFeatures: Option to request additional data such as time zone details. For more information, see the section called “Additional features”. Understand the response The response from the Reverse Geocode API provides detailed information about locations at the specified coordinates. The ResultItems array includes a list of place objects, each containing address details, categories, and geographic position.
amazon-location-developer-guide-075
amazon-location-developer-guide.pdf
75
Specifies the language of the results. • PoliticalView: Applies a political view reflecting territorial claims. For more information, see the section called “Localization and internationalization”. Reverse Geocode 329 Amazon Location Service Additional features Developer Guide Requests extra data, such as time zone information. • AdditionalFeatures: Option to request additional data such as time zone details. For more information, see the section called “Additional features”. Understand the response The response from the Reverse Geocode API provides detailed information about locations at the specified coordinates. The ResultItems array includes a list of place objects, each containing address details, categories, and geographic position. Additional data such as TimeZone, FoodTypes, and PostalCodeDetails offer further context. The response also includes bounding box information for mapping and the distance from the query position. For more details, see the Reverse Geocode API Reference. The response includes the following key data: Address and related details Detailed address information for the returned location. • Address: Complete address information, including country, region, postal code, and street details. • PostalCodeDetails: Additional details related to postal codes, such as classifications and postal authorities. • StreetComponents: Additional details about the street, including base name and type. Place types and categories Describes the type and category of the returned place. • Categories: Categories describing the place, such as Restaurants or Schools. • PlaceType: Specifies the type of place, such as a city, address, or region. Result analysis Information on how closely each result matches the input query. • MatchScores: Scores indicating the accuracy of each match to the input query. Additional details Provides extra location-related data. Reverse Geocode 330 Amazon Location Service Developer Guide • TimeZone: Time zone information for the location. • AccessPoints: Geographic coordinates representing entry points to the location. Autocomplete Note By default, Autocomplete returns only the ID and Title fields, providing a cost-effective option. Additional address components and highlights can be requested by setting additionalFeatures to Core. Refer to the section called “Places pricing” for cost details associated with stored results. Note that Autocomplete does not return geocodes, and this feature is currently unavailable in Japan. The Autocomplete API completes potential places and addresses as the user types, based on partial input. It enhances the efficiency and accuracy of address entry by completing queries with valid address information after a few keystrokes. Additionally, Autocomplete supports result filtering based on geographic location, country, or specific place types and can be tailored using optional parameters such as language and political view. Use cases • Enhance checkout experience: Provide real-time address completion as customers enter their location on websites or apps. Ensure that delivery or pickup locations match known addresses to streamline address validation, reduce errors, and create a seamless checkout experience. • Support customer services: Offer real-time address suggestions for customer services such as contact centers or emergency services, streamlining the process of locating accurate addresses and improving user satisfaction by reducing the time needed to obtain correct address information. Understand the request The Autocomplete request uses optional parameters to refine search results. For more details, refer to the Autocomplete API Reference. The request accepts the following key parameters: Autocomplete 331 Amazon Location Service Authentication Developer Guide The Key parameter is optional if other authentication methods are used. • Key: Optional parameter for authentication. For more information, see Authentication Querying Defines the partial text query and geographic bias for result suggestions. • QueryText: The free-form text query used to find location results, this parameter is required. • BiasPosition: Suggests results closest to specified longitude and latitude coordinates, this parameter is optional. For more information, see the section called “Querying and biasing” Refine results Applies filters to restrict results to specific countries or place types. • Filter: Allows filtering based on specified countries or place types. For more details, see the section called “Filtering” Understand the response The Autocomplete API returns results as ResultItems, each representing a matched location based on the request parameters. For further details, refer to the Autocomplete API Reference. The response includes the following key data: Address and related details Contains detailed address components for each location. • Address: Provides full address components, including street, postal code, and country. Result analysis Provides analysis data for each result in relation to the input query. • Distance: Distance from the specified bias position to the result. • Highlights: Highlights portions of the query within the result for clarity. Autocomplete 332 Amazon Location Service GetPlace Note Developer Guide If results are stored, they will be billed at the higher Storage pricing tier. Use the IntendedUse parameter to specify whether the results are for single use or storage. Refer to the section called “Places pricing” for cost details associated with stored results. GetPlace retrieves detailed information about a place using its unique PlaceId. The request supports optional parameters for additional features, such as
amazon-location-developer-guide-076
amazon-location-developer-guide.pdf
76
to the input query. • Distance: Distance from the specified bias position to the result. • Highlights: Highlights portions of the query within the result for clarity. Autocomplete 332 Amazon Location Service GetPlace Note Developer Guide If results are stored, they will be billed at the higher Storage pricing tier. Use the IntendedUse parameter to specify whether the results are for single use or storage. Refer to the section called “Places pricing” for cost details associated with stored results. GetPlace retrieves detailed information about a place using its unique PlaceId. The request supports optional parameters for additional features, such as time zone data or phonemes, and language localization. The API returns information like address, coordinates, business details, contact methods, and time zone information. Use cases • Refresh stored data: Regularly refresh stored data to ensure your application provides accurate, current information. Use the GetPlace API to update details about businesses and places, ensuring users have the latest information. For example, refresh opening hours, contact details, and user reviews for local restaurants or shops to enhance user trust and application functionality. • Retrieve place details after typeahead suggestions: Improve user experience by integrating the GetPlace API with autocomplete or suggestion features. As users type an address, business name, or point of interest, suggestions provide relevant places, and GetPlace enables access to more detailed information once a selection is made. Understand the request The GetPlace API request requires specific parameters, such as the PlaceId, and supports optional parameters for additional features or language localization. These parameters help tailor the results based on language, intended use, and geographic context. For more details, refer to the GetPlace API Reference. The request accepts the following key parameters: Authentication The Key parameter is optional if other authentication methods are used. GetPlace 333 Amazon Location Service Developer Guide • Key: API key for authorization. For more information, see Authentication. Querying Defines the unique identifier for retrieving place information. • PlaceId: The unique identifier for the place. (required) For more information, see the section called “Querying and biasing”. Internationalization and Localization Options to customize the language and apply a political view to the results. • Language: Specifies the language of the results. • PoliticalView: Applies a political view reflecting territorial claims. For more information, see the section called “Localization and internationalization”. Additional Features Requests additional data, such as time zone details. • AdditionalFeatures: Option to request additional information like time zone or phoneme details. For more information, see the section called “Additional features”. Understand the response The response from the GetPlace API includes basic data, such as the address, coordinates, and business details, as well as additional data based on the request parameters. Information like access restrictions, time zones, and phoneme details for pronunciation can also be provided. For further details, refer to the GetPlace API Reference. The response includes the following key data: Address and Related Details Provides complete address details for the location. • Address: Full address information, including country, region, and postal code. GetPlace 334 Amazon Location Service Developer Guide • PostalCodeDetails: Additional information about postal codes and authorities. Place Types and Categories Describes the type and category of the place. • BusinessChains: Information on any associated business chains. • Categories: Categories to which the place belongs, such as food or retail. • PlaceType: Type of the place, such as point of interest or locality. Additional Details Provides additional data about the place, as specified in the request. • Contacts: Contact methods, including phone numbers, emails, and websites. • OpeningHours: Business hours or access times. • AccessPoints: Geographic coordinates (longitude and latitude) of access points. • Phonemes: Pronunciations for various address components. • TimeZone: Time zone information, including offset. Search Nearby Note If results are stored, they will be billed at the higher Storage pricing tier. Use the IntendedUse parameter to specify whether the results are for single use or storage. Refer to the section called “Places pricing” for cost implications associated with stored results. The Search Nearby API allows developers to query for points of interest within a specified radius from central coordinates. The API provides place results with optional filters, including categories, business chains, food types, and more. Response details include place name, address, phone, category, food type, contact, and opening hours. Additional features, such as phonemes, time zones, and others, are available based on requested parameters. Use cases • Real Estate Applications: Provide potential homebuyers or renters with a list of amenities and services near a property, such as schools, hospitals, and shopping centers. Search Nearby 335 Amazon Location Service Developer Guide • Local Business Discovery: Enable users to locate businesses, restaurants, or shops within a specific radius from their current location. For example, a food delivery app can display nearby restaurants based on real-time location. • Travel and Tourism Apps: Help
amazon-location-developer-guide-077
amazon-location-developer-guide.pdf
77
address, phone, category, food type, contact, and opening hours. Additional features, such as phonemes, time zones, and others, are available based on requested parameters. Use cases • Real Estate Applications: Provide potential homebuyers or renters with a list of amenities and services near a property, such as schools, hospitals, and shopping centers. Search Nearby 335 Amazon Location Service Developer Guide • Local Business Discovery: Enable users to locate businesses, restaurants, or shops within a specific radius from their current location. For example, a food delivery app can display nearby restaurants based on real-time location. • Travel and Tourism Apps: Help travelers explore attractions, landmarks, hotels, and services near their location or a destination. A travel app might suggest nearby points of interest such as museums, parks, and historic sites. • Emergency Services: Assist users in finding the nearest hospitals, police stations, or pharmacies during emergencies, especially valuable for apps focused on health, safety, or disaster response. • Transportation and Logistics: Help users find the nearest gas stations, EV charging points, or public transit stops. Ride-hailing services can display nearby available drivers. Understand the request The Search Nearby API request includes required parameters such as QueryPosition and optional parameters like filters to refine the search. Additional options, like Language and PoliticalView, customize results for specific needs. For more information, refer to the Search Nearby API Reference. The request includes the following key parameters: Authentication The Key parameter is optional if other authentication methods are used. • Key: API key for authorization. For more information, see Authentication Querying Defines the location and search radius for the query. • QueryPosition: Specifies the longitude and latitude coordinates. • QueryRadius: Defines the search radius around the specified coordinates. For more information, see the section called “Querying and biasing” Refining Results Filters results to narrow down search criteria. • Filter: Applies filters such as categories, business chains, or food types. Search Nearby 336 Amazon Location Service Developer Guide For more details, see the section called “Filtering” Internationalization and Localization Options to customize the language and apply a political view to the results. • Language: Specifies the language of the results. • PoliticalView: Applies a political view reflecting territorial claims. For more information, see the section called “Localization and internationalization” Additional Features Requests additional data, such as time zone information. • AdditionalFeatures: Option to request additional details like time zone information. For more information, see the section called “Additional features” Understand the response The response from the Search Nearby API provides detailed results matching the query, including location, address details, business chains, contacts, phonemes, time zone, and opening hours. For more details, refer to the Search Nearby API Reference. The response includes the following key data: Address and Related Details Comprehensive address information for the returned location. • Address: Includes full address details, such as country and street. Place Types and Categories Describes the type and category of the returned place. • Categories: Categories describing the place, such as Restaurants or Schools. • FoodTypes: Types of food available at restaurants or eateries. • BusinessChains: Indicates any associated business chains. Additional Details Additional information related to the place, as requested. • Contacts: Lists emails, phone numbers, and websites. • OpeningHours: Specifies operational hours for the place. Search Nearby 337 Amazon Location Service Developer Guide • Phonemes: Provides phonetic representations of address components. • TimeZone: Includes time zone information for the place. Search Text Note If results are stored, they will be billed at the higher Storage pricing tier. Use the IntendedUse parameter to specify whether the results are for single use or storage. Refer to the section called “Places pricing” for cost implications associated with stored results. Search Text allows you to query location data using a single free-form text input, returning place results with optional filters like country, geographic circle, or bounding box. The API also enables searching by QueryId returned from the Suggest API. The response includes details such as place name, address, phone number, category, food type, contact information, and opening hours. Optional features like phonemes, time zones, and more are also available based on specified parameters. Use cases • Neighborhood search by text: Help customers locate the nearest relevant place. Customers can find the closest address, business, or attraction such as museums, shops, or parks. • Business discovery: Allow users to find specific businesses or types of places by entering keywords like "Italian restaurant" or "coffee shop." This feature is particularly useful for food delivery or restaurant recommendation apps. • Place search in travel apps: Enable users to search for locations, landmarks, or businesses using free-form text, such as "hotels near Eiffel Tower," to receive relevant suggestions quickly. • Educational institutions search: Allow users to search for schools, colleges, or training centers (for example, "elementary schools" or "universities"), a helpful tool for parents or
amazon-location-developer-guide-078
amazon-location-developer-guide.pdf
78
closest address, business, or attraction such as museums, shops, or parks. • Business discovery: Allow users to find specific businesses or types of places by entering keywords like "Italian restaurant" or "coffee shop." This feature is particularly useful for food delivery or restaurant recommendation apps. • Place search in travel apps: Enable users to search for locations, landmarks, or businesses using free-form text, such as "hotels near Eiffel Tower," to receive relevant suggestions quickly. • Educational institutions search: Allow users to search for schools, colleges, or training centers (for example, "elementary schools" or "universities"), a helpful tool for parents or students. Understand the request The Search Text API request allows various parameters to refine the search. Optional parameters enable additional features, location biasing, filtering criteria, language preferences, and result limits. For more details, refer to the Search Text API Reference. Search Text 338 Amazon Location Service Developer Guide The request includes the following key parameters: Authentication The Key parameter is optional if other authentication methods are used. • Key: API key for authorization. For more information, see Authentication. Querying Parameters used for specifying the text search and location bias. • QueryText: Free-form text for searching places. • QueryId: Enables completion of suggested queries from the Suggest API. • BiasPosition: Prioritizes results near a specific longitude and latitude. For more information, see the section called “Querying and biasing”. Refining Results Filters results to narrow down search criteria. • Filter: Allows filtering by bounding box or circular area to limit search results. For more details, see the section called “Filtering”. Internationalization and Localization Options for customizing the language and applying a political view to the results. • Language: Specifies the language of the results. • PoliticalView: Applies a political view reflecting territorial claims. For more information, see the section called “Localization and internationalization”. Additional Features Requests extra data such as time zone information. • AdditionalFeatures: Option to request additional data such as time zone details. For more information, see the section called “Additional features”. Search Text 339 Amazon Location Service Understand the response Developer Guide The response from the Search Text API includes detailed results that match the query, with information on location, address details, business chains, contacts, phonemes, time zone, and opening hours. For more details, refer to the Search Text API Reference. The response includes the following key data: Address and Related Details Comprehensive address information for the returned location. • Address: Includes country, street, and other address details. Place Types and Categories Describes the type and category of the place. • Categories: A list of categories describing the place, such as Restaurants or Schools. • PlaceType: Specifies the type of place, such as a city, address, or region. • BusinessChains: Indicates any associated business chains. Additional Details Additional data related to the place, as requested. • Contacts: Provides emails, phone numbers, and websites. • OpeningHours: Operational hours of the place. • AccessPoints: Geographic coordinates associated with the place. • Phonemes: Phonetic representations of address components. • TimeZone: Time zone information, including offset. Suggest Note By default, the Suggest API returns only ID and Title fields, providing a cost-effective option. Additional address components and highlights can be requested by setting additionalFeatures to Core. Refer to the section called “Places pricing” for cost implications related to stored results. Suggest 340 Amazon Location Service Developer Guide Suggest provides predictions or recommendations based on user input or context, such as relevant places, points of interest, query terms, or search categories. It assists users in finding places, points of interest, or identifying follow-up queries based on incomplete or misspelled input. The API returns a list of possible matches or refinements, which can be used to formulate a more accurate query. Users can select the appropriate suggestion for further searching. The API supports filtering results by location and other attributes and offers additional features like phonemes and time zones. The response includes refined query terms and detailed place information. Use cases • Ride-Hailing Services: Provide real-time suggestions to quickly complete addresses for pick-up and drop-off locations, ensuring accuracy and faster ride booking. • Travel and Navigation Services: Offer real-time predictions for locations or landmarks, even for misspelled or partially entered terms, such as "Eifel" for "Eiffel Tower." The API refines suggestions to offer relevant nearby points of interest, helping users locate places accurately. • Restaurant Search Assistance: Anticipate users' interests in restaurants and suggest nearby dining options, enhancing the search experience. Understand the request The Suggest API request uses parameters to generate suggestions based on user input. Optional parameters allow for refined search results using location bias and filtering criteria. For more details, refer to the Suggest API Reference. The request includes the following key parameters: Authentication The Key parameter is optional if other authentication methods are used. • Key: API key for authorization. For
amazon-location-developer-guide-079
amazon-location-developer-guide.pdf
79
"Eiffel Tower." The API refines suggestions to offer relevant nearby points of interest, helping users locate places accurately. • Restaurant Search Assistance: Anticipate users' interests in restaurants and suggest nearby dining options, enhancing the search experience. Understand the request The Suggest API request uses parameters to generate suggestions based on user input. Optional parameters allow for refined search results using location bias and filtering criteria. For more details, refer to the Suggest API Reference. The request includes the following key parameters: Authentication The Key parameter is optional if other authentication methods are used. • Key: API key for authorization. For more information, see Authentication Querying Defines the free-text search and location bias. • QueryText: Free-form text for generating suggestions. (required) • BiasPosition: Prioritizes suggestions near a specific longitude and latitude. Suggest 341 Amazon Location Service Developer Guide For more information, see the section called “Querying and biasing” Refining results Filters results to narrow down search criteria. • Filter: Allows filtering by bounding box or circular area to limit search results. For more details, see the section called “Filtering” Internationalization and Localization Options for customizing the language and applying a political view to the results. • Language: Specifies the language of the results. • PoliticalView: Applies a political view reflecting territorial claims. For more information, see the section called “Localization and internationalization” Additional features Requests extra data, such as time zone information. • AdditionalFeatures: Option to request additional details such as time zone or phonetic data. For more information, see the section called “Additional features” Limiting results Sets limits on the number of results or query refinements returned. • MaxQueryRefinements: Limits the number of query refinement terms returned. • MaxResults: Limits the number of suggestions returned. Understand the response The response provides suggested addresses or places based on the input query, with attributes such as location, address details, business chains, contacts, phonemes, time zone, and opening hours. The API returns ResultItems, representing possible matches for completing the input query. There are two types of results, identified by SuggestResultItemType: results of type Query suggest a follow-up category or chain query, which can be used to obtain focused results for a specified category by passing the QueryID to the SearchText API. Results of type Place Suggest 342 Amazon Location Service Developer Guide provide a final result with an address and additional information about the place. For further details, refer to the API Reference for Suggest API. The response includes the following key data: Result analysis Provides information on refining the input query. • QueryRefinements: Terms that can be used to refine the search query. • Highlights: Highlights parts of the address or title that match the query. Place types and categories Describes the type and category of the place. • Categories: Categories describing the place, such as Restaurants or Schools. • PlaceType: Specifies the type of place, such as a city, address, or region. • BusinessChains: Indicates any associated business chains. Additional details Additional information about the place, as specified in the request. • Contacts: Provides emails, phone numbers, and websites. • OpeningHours: Operational hours of the place. • AccessPoints: Geographic coordinates associated with the place. • Phonemes: Phonetic representations of address components. • TimeZone: Time zone information, including offset. How to This section provides step-by-step instructions for performing specific tasks with the Places APIs. These guides are designed to help you quickly and effectively implement key functionality. Each topic focuses on a distinct use case, ensuring you have the practical knowledge needed to integrate Places API features into your applications. Examples • How to use Geocode How to 343 Developer Guide Amazon Location Service • How to use ReverseGeocode • How to use Autocomplete • How to use Get Place • How to use SearchNearby • How to use SearchText • How to use Suggest How to use Geocode This section contains a variety of how to guides and examples for how to use Geocode APIs. Examples • How to geocode an administrative and postal area • How to geocode an address • How to geocode a point of interest • How to geocode an address number with a postal code • How to geocode using geospatial context • How to geocode using filters • How to geocode for the time zone of a city • How to geocode in a specific language How to geocode an administrative and postal area The Geocode API allows you to perform geocoding for a geographic area using a query text input, such as the name of a country, region (state or province), or city. The API response includes location details like geographic coordinates, bounding boxes for map visualizations, and match scores indicating the result's relevance to the query. Potential use cases • Obtain coordinates for an administrative area: Use coordinates as a bias position or
amazon-location-developer-guide-080
amazon-location-developer-guide.pdf
80
using filters • How to geocode for the time zone of a city • How to geocode in a specific language How to geocode an administrative and postal area The Geocode API allows you to perform geocoding for a geographic area using a query text input, such as the name of a country, region (state or province), or city. The API response includes location details like geographic coordinates, bounding boxes for map visualizations, and match scores indicating the result's relevance to the query. Potential use cases • Obtain coordinates for an administrative area: Use coordinates as a bias position or center in other Places APIs. • Visualize information on a map: Geocoded coordinates can be used to display data visually on a map. Use Geocode 344 Developer Guide Amazon Location Service Examples Geocode a Country Sample request { "QueryText": "Canada" } Sample response { "ResultItems": [ { "PlaceId":"<Redacted>", "PlaceType": "Country", "Title": "Canada", "Address": { "Label": "Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" } }, "Position": [-75.69122, 45.42177], "MapView": [-141.00271, 41.67659, -52.61901, 83.11062], "MatchScores": { "Overall": 1, "Components": { "Address": { "Country": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ Use Geocode 345 Amazon Location Service Developer Guide --data '{ "QueryText": "Canada" }' AWS CLI aws geo-places geocode --key ${YourAPIKey} --query-text "Canada" Geocode a Region Sample request { "QueryText": "BC" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Region", "Title": "BC, Canada", "Address": { "Label": "BC, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" } }, "Position": [-123.36445, 48.42854], "MapView": [-139.04941, 48.22478, -114.05201, 60.00043], "MatchScores": { "Overall": 1, "Components": { Use Geocode 346 Amazon Location Service Developer Guide "Address": { "Region": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "BC" }' AWS CLI aws geo-places geocode --key ${YourAPIKey} --query-text "BC" Geocode a City Sample request { "QueryText": "Vancouver" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Locality", "Title": "Vancouver, BC, Canada", "Address": { "Label": "Vancouver, BC, Canada", "Country": { "Code2": "CA", "Code3": "CAN", Use Geocode 347 Amazon Location Service Developer Guide "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "PostalCode": "V5Y" }, "Position": [-123.11336, 49.26038], "MapView": [-123.26754, 49.19891, -123.02301, 49.33557], "MatchScores": { "Overall": 1, "Components": { "Address": { "Locality": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Vancouver" }' AWS CLI aws geo-places geocode --key ${YourAPIKey} --query-text "Vancouver" Geocode a Postal Code You can geocode a postal code. Use IncludePlaceTypes with ["PostalCode"] for more precise results. Use Geocode 348 Amazon Location Service Sample request Developer Guide { "QueryText": "800006", "Filter": { "IncludePlaceTypes": ["PostalCode"] } } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PostalCodeArea", "Title": "800006, Patna, Bihar, India", "Address": { "Label": "800006, Patna, Bihar, India", "Country": { "Code2": "IN", "Code3": "IND", "Name": "India" }, "Region": { "Code": "BR", "Name": "Bihar" }, "SubRegion": { "Name": "Patna" }, "Locality": "Patna", "PostalCode": "800006" }, "Position": [85.18048, 25.61532], "MapView": [85.16599, 25.60054, 85.19103, 25.6221], "MatchScores": { "Overall": 1, "Components": { "Address": { "PostalCode": 1 } } } } ] } Use Geocode 349 Amazon Location Service cURL Developer Guide curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "800006", "Filter": { "IncludePlaceTypes": ["PostalCode"] } }' AWS CLI aws geo-places geocode --key ${YourAPIKey} --query-text "800006" --filter '{"IncludePlaceTypes": ["PostalCode"]}' Developer tips Use filters like IncludeCountries and IncludePlaceTypes for more targeted results. For example, to ensure results from Vancouver in the USA, set "IncludeCountries": ["USA"]. For more details, see . { "QueryText": "Vancouver", "Filter": { "IncludeCountries": ["USA"] } } How to geocode an address The Geocode API enables you to geocode a specific point address, interpolated address, or street. The API response contains location information, including geographical coordinates and match scores that i ndicate how accurately the result aligns with the query. Potential use cases • Clean address database: Enhance data quality by identifying and correcting errors in address records. • Normalize and standardize addresses: Ensure consistent address formatting across datasets for improved data interoperability. Use Geocode 350 Amazon Location Service Developer Guide • Enrich addresses with additional information: Add geographic coordinates and other relevant details to address records to support location-based analytics and insights. Examples Use query text Sample request { "QueryText": "510 W Georgia St, Vancouver, BC" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Address": { "Label": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British
amazon-location-developer-guide-081
amazon-location-developer-guide.pdf
81
address formatting across datasets for improved data interoperability. Use Geocode 350 Amazon Location Service Developer Guide • Enrich addresses with additional information: Add geographic coordinates and other relevant details to address records to support location-based analytics and insights. Examples Use query text Sample request { "QueryText": "510 W Georgia St, Vancouver, BC" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Address": { "Label": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Downtown Vancouver", "PostalCode": "V6B 0M3", "Street": "W Georgia St", "StreetComponents": [ { "BaseName": "Georgia", Use Geocode 351 Amazon Location Service Developer Guide "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "510" }, "Position": [ -123.11694, 49.28126 ], "MapView": [ -123.11832, 49.28036, -123.11556, 49.28216 ], "AccessPoints": [ { "Position": [ -123.11656, 49.28151 ] } ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Region": 1, "Locality": 1, "Intersection": [ 1 ], "AddressNumber": 1 } } } } ] } Use Geocode 352 Amazon Location Service cURL Developer Guide curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{"QueryText": "510 W Georgia St, Vancouver, BC"}' AWS CLI aws geo-places geocode --key ${YourAPIKey} --query-text "510 W Georgia St, Vancouver, BC" Use query components Sample request { "QueryComponents": { "AddressNumber": "510", "Locality": "Vancouver", "Region": "BC", "Country": "Canada", "Street": "Georgia" } } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Address": { "Label": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, Use Geocode 353 Amazon Location Service Developer Guide "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Downtown Vancouver", "PostalCode": "V6B 0M3", "Street": "W Georgia St", "StreetComponents": [ { "BaseName": "Georgia", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "510" }, "Position": [ -123.11694, 49.28126 ], "MapView": [ -123.11832, 49.28036, -123.11556, 49.28216 ], "AccessPoints": [ { "Position": [ -123.11656, 49.28151 ] } ], "MatchScores": { "Overall": 0.99, "Components": { Use Geocode 354 Amazon Location Service Developer Guide "Address": { "Country": 1, "Region": 1, "Locality": 1, "Intersection": [ 0.78 ], "AddressNumber": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "InterpolatedAddress", "Title": "510 E Georgia St, Vancouver, BC V6A 1Z9, Canada", "Address": { "Label": "510 E Georgia St, Vancouver, BC V6A 1Z9, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Strathcona", "PostalCode": "V6A 1Z9", "Street": "E Georgia St", "StreetComponents": [ { "BaseName": "Georgia", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "E", "Language": "en" } ], Use Geocode 355 Amazon Location Service Developer Guide "AddressNumber": "510" }, "Position": [ -123.0932, 49.27829 ], "MapView": [ -123.09458, 49.27739, -123.09182, 49.27919 ], "AccessPoints": [ { "Position": [ -123.0932, 49.27842 ] } ], "MatchScores": { "Overall": 0.99, "Components": { "Address": { "Country": 1, "Region": 1, "Locality": 1, "Intersection": [ 0.78 ], "AddressNumber": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ Use Geocode 356 Amazon Location Service Developer Guide --data '{"QueryComponents": {"AddressNumber": "510", "Locality": "Vancouver", "Region": "BC", "Country": "Canada", "Street": "Georgia"}}' AWS CLI ./aws geo-places geocode --key ${YourAPIKey} --query-components '{ "AddressNumber" : "510", "Locality": "vancouver", "Region": "BC", "Country": "Canada", "Street": "Georgia"}' Use hybrid query Sample request { "QueryText": "W. 6th St", "QueryComponents": { "AddressNumber": "415", "Locality": "Vancouver" } } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "415 W 6th St, Vancouver, WA 98660-3375, United States", "Address": { "Label": "415 W 6th St, Vancouver, WA 98660-3375, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" Use Geocode 357 Amazon Location Service Developer Guide }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Esther Short", "PostalCode": "98660-3375", "Street": "W 6th St", "StreetComponents": [ { "BaseName": "6th", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "415" }, "Position": [ -122.67543, 45.62527 ], "MapView": [ -122.67672, 45.62437, -122.67414, 45.62617 ], "AccessPoints": [ { "Position": [ -122.67543, 45.62506 ] } ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Locality": 1, "Intersection": [ Use Geocode 358 Amazon Location Service Developer Guide 1 ], "AddressNumber": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{"QueryText": "W. 6th St", "QueryComponents": {"AddressNumber": "415", "Locality": "Vancouver"}}' AWS CLI ./aws geo-places geocode -key ${YourAPIKey} --query-text "W. 6th St" \ --query-components '{"AddressNumber" : "415", "Locality":
amazon-location-developer-guide-082
amazon-location-developer-guide.pdf
82
"Prefix": "W", "Language": "en" } ], "AddressNumber": "415" }, "Position": [ -122.67543, 45.62527 ], "MapView": [ -122.67672, 45.62437, -122.67414, 45.62617 ], "AccessPoints": [ { "Position": [ -122.67543, 45.62506 ] } ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Locality": 1, "Intersection": [ Use Geocode 358 Amazon Location Service Developer Guide 1 ], "AddressNumber": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{"QueryText": "W. 6th St", "QueryComponents": {"AddressNumber": "415", "Locality": "Vancouver"}}' AWS CLI ./aws geo-places geocode -key ${YourAPIKey} --query-text "W. 6th St" \ --query-components '{"AddressNumber" : "415", "Locality": "Vancouver"}' Developer Tips Use filters like IncludeCountries and IncludePlaceTypes to obtain accurate results. For instance, if you need Vancouver from the USA, apply "IncludeCountries": ["USA"] to prioritize results in the USA. To learn more, see How to geocode using filters. { "QueryText": "Vancouver", "Filter": { "IncludeCountries": ["USA"], "IncludePlaceTypes": ["City"] } } How to geocode a point of interest You can use the geocode API to geocode the coordinates of a known place (Point of interest) such as business addresses, landmark, or tourist spot. The API response contains location information, Use Geocode 359 Amazon Location Service Developer Guide including geographical coordinates, and match scores that indicate how well the result matches the query. Potential use cases • Provide geographical coordinates that correspond to points of interest enhances the user experience • Provide geographical coordinates that correspond to points of interest can optimize logistics Examples Geocode a business Sample request { "QueryText": "Starbucks , Vancouver" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 1099 Robson St, Vancouver, BC V6E 1A9, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", Use Geocode 360 Amazon Location Service Developer Guide "District": "West End", "PostalCode": "V6E 1A9", "Street": "Robson St", "StreetComponents": [ { "BaseName": "Robson", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "1099" }, "Position": [ -123.12454, 49.28462 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -123.12463, 49.28447 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, Use Geocode 361 Amazon Location Service { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { Developer Guide "Label": "STARBUCKS, 980 Seymour St, Vancouver, BC V6B 1B5, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Downtown Vancouver", "PostalCode": "V6B 1B5", "Street": "Seymour St", "StreetComponents": [ { "BaseName": "Seymour", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "980" }, "Position": [ -123.12142, 49.2786 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } Use Geocode 362 Amazon Location Service Developer Guide ], "AccessPoints": [ { "Position": [ -123.12185, 49.27873 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 918 SE 164th Ave, Vancouver, WA 98683-9603, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Cascade Highlands", "PostalCode": "98683-9603", "Street": "SE 164th Ave", "StreetComponents": [ { Use Geocode 363 Amazon Location Service Developer Guide "BaseName": "164th", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "SE", "Language": "en" } ], "AddressNumber": "918" }, "Position": [ -122.50495, 45.61409 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.50493, 45.61401 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", Use Geocode 364 Amazon Location Service Developer Guide "Address": { "Label": "STARBUCKS, 304 W 8th St, Vancouver, WA 98660-3112, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Esther Short", "PostalCode": "98660-3112", "Street": "W 8th St", "StreetComponents": [ { "BaseName": "8th", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "304" }, "Position": [ -122.67418, 45.6274 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ Use Geocode 365 Amazon Location Service Developer Guide { "Position": [ -122.67419, 45.62725 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 3707 Main St, Vancouver, WA 98663-2227,
amazon-location-developer-guide-083
amazon-location-developer-guide.pdf
83
"Esther Short", "PostalCode": "98660-3112", "Street": "W 8th St", "StreetComponents": [ { "BaseName": "8th", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "304" }, "Position": [ -122.67418, 45.6274 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ Use Geocode 365 Amazon Location Service Developer Guide { "Position": [ -122.67419, 45.62725 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 3707 Main St, Vancouver, WA 98663-2227, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Shumway", "PostalCode": "98663-2227", "Street": "Main St", "StreetComponents": [ { "BaseName": "Main", "Type": "St", Use Geocode 366 Amazon Location Service Developer Guide "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "3707" }, "Position": [ -122.667, 45.64849 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.66705, 45.64849 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 2811 E Fourth Plain Blvd, Vancouver, WA 98661, United States", Use Geocode 367 Amazon Location Service Developer Guide "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Rose Village", "PostalCode": "98661", "Street": "E Fourth Plain Blvd", "StreetComponents": [ { "BaseName": "Fourth Plain", "Type": "Blvd", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "E", "Language": "en" } ], "AddressNumber": "2811" }, "Position": [ -122.64149, 45.63818 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.64185, Use Geocode 368 Amazon Location Service Developer Guide 45.63828 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 2500 Columbia House Blvd, Vancouver, WA 98661-7758, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Hudson Bay", "PostalCode": "98661-7758", "Street": "Columbia House Blvd", "StreetComponents": [ { "BaseName": "Columbia House", "Type": "Blvd", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" Use Geocode 369 Amazon Location Service Developer Guide } ], "AddressNumber": "2500" }, "Position": [ -122.64584, 45.62036 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.64584, 45.61986 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 8801 NE Hazel Dell Ave, Vancouver, WA 98665-8145, United States", "Country": { "Code2": "US", "Code3": "USA", Use Geocode 370 Amazon Location Service Developer Guide "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Northeast Hazel Dell-Starcrest", "PostalCode": "98665-8145", "Street": "NE Hazel Dell Ave", "StreetComponents": [ { "BaseName": "Hazel Dell", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "8801" }, "Position": [ -122.66834, 45.68623 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.66834, 45.68641 ] } Use Geocode 371 Developer Guide Amazon Location Service ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 7720 NE Highway 99, Vancouver, WA 98665, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Northeast Hazel Dell", "PostalCode": "98665", "Street": "NE Highway 99", "StreetComponents": [ { "BaseName": "Highway 99", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "7720" }, "Position": [ Use Geocode 372 Amazon Location Service Developer Guide -122.66264, 45.67787 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.66293, 45.67793 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 408 NE 81st St, Vancouver, WA 98665-8111, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" Use Geocode 373 Amazon Location Service Developer Guide }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Northeast Hazel Dell-Starcrest", "PostalCode": "98665-8111", "Street": "NE 81st St", "StreetComponents": [ {
amazon-location-developer-guide-084
amazon-location-developer-guide.pdf
84
"Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.66293, 45.67793 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 408 NE 81st St, Vancouver, WA 98665-8111, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" Use Geocode 373 Amazon Location Service Developer Guide }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Northeast Hazel Dell-Starcrest", "PostalCode": "98665-8111", "Street": "NE 81st St", "StreetComponents": [ { "BaseName": "81st", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "408" }, "Position": [ -122.66824, 45.68161 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.66824, 45.68138 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, Use Geocode 374 Amazon Location Service Developer Guide "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 6701 E Mill Plain Blvd, Vancouver, WA 98661-7459, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Vancouver Heights", "PostalCode": "98661-7459", "Street": "E Mill Plain Blvd", "StreetComponents": [ { "BaseName": "Mill Plain", "Type": "Blvd", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "E", "Language": "en" } ], "AddressNumber": "6701" }, "Position": [ -122.6031, 45.62623 Use Geocode 375 Amazon Location Service Developer Guide ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.6031, 45.62635 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 8700 NE Vancouver Mall Dr, Vancouver, WA 98662-6416, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { Use Geocode 376 Amazon Location Service Developer Guide "Name": "Clark" }, "Locality": "Vancouver", "PostalCode": "98662-6416", "Street": "NE Vancouver Mall Dr", "StreetComponents": [ { "BaseName": "Vancouver Mall", "Type": "Dr", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "8700" }, "Position": [ -122.58543, 45.65786 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.58512, 45.65739 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } Use Geocode 377 Amazon Location Service Developer Guide } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 8302 E Mill Plain Blvd, Vancouver, WA 98664-2007, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "North Garrison Heights", "PostalCode": "98664-2007", "Street": "E Mill Plain Blvd", "StreetComponents": [ { "BaseName": "Mill Plain", "Type": "Blvd", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "E", "Language": "en" } ], "AddressNumber": "8302" }, "Position": [ -122.58719, 45.62393 ], "Categories": [ { Use Geocode 378 Amazon Location Service Developer Guide "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.58712, 45.62393 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 7809 NE Vancouver Plaza Dr, Vancouver, WA 98662-6624, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", Use Geocode 379 Amazon Location Service Developer Guide "District": "Ogden", "PostalCode": "98662-6624", "Street": "NE Vancouver Plaza Dr", "StreetComponents": [ { "BaseName": "Vancouver Plaza", "Type": "Dr", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "7809" }, "Position": [ -122.5919, 45.65126 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.59217, 45.65112 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } Use Geocode 380 Amazon Location Service }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { Developer Guide "Label": "STARBUCKS, 2615 NE 112th Ave, Vancouver, WA 98684-4283, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Landover-Sharmel", "PostalCode": "98684-4283", "Street": "NE 112th Ave", "StreetComponents": [ { "BaseName": "112th", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "2615" }, "Position": [ -122.55675, 45.64148 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", Use Geocode 381 Amazon Location
amazon-location-developer-guide-085
amazon-location-developer-guide.pdf
85
Use Geocode 380 Amazon Location Service }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { Developer Guide "Label": "STARBUCKS, 2615 NE 112th Ave, Vancouver, WA 98684-4283, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Landover-Sharmel", "PostalCode": "98684-4283", "Street": "NE 112th Ave", "StreetComponents": [ { "BaseName": "112th", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "2615" }, "Position": [ -122.55675, 45.64148 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", Use Geocode 381 Amazon Location Service Developer Guide "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.55675, 45.64157 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 13719 SE Mill Plain Blvd, Vancouver, WA 98684-6945, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Mountain View", "PostalCode": "98684-6945", Use Geocode 382 Amazon Location Service Developer Guide "Street": "SE Mill Plain Blvd", "StreetComponents": [ { "BaseName": "Mill Plain", "Type": "Blvd", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "SE", "Language": "en" } ], "AddressNumber": "13719" }, "Position": [ -122.53093, 45.61691 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.53093, 45.61714 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { Use Geocode 383 Amazon Location Service Developer Guide "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 6711 NE 63rd St, Vancouver, WA 98661-1997, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Walnut Grove", "PostalCode": "98661-1997", "Street": "NE 63rd St", "StreetComponents": [ { "BaseName": "63rd", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "6711" }, "Position": [ -122.60365, 45.66671 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true Use Geocode 384 Amazon Location Service Developer Guide } ], "AccessPoints": [ { "Position": [ -122.60365, 45.66679 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 8720 NE Centerpointe Dr, Vancouver, WA 98665-1153, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Sunnyside-Walnut Grove", "PostalCode": "98665-1153", "Street": "NE Centerpointe Dr", "StreetComponents": [ Use Geocode 385 Amazon Location Service { Developer Guide "BaseName": "Centerpointe", "Type": "Dr", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "8720" }, "Position": [ -122.6019, 45.68537 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.60189, 45.6852 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", Use Geocode 386 Amazon Location Service Developer Guide "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 7411 NE 117th Ave, Vancouver, WA 98662-4705, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Orchards Area", "PostalCode": "98662-4705", "Street": "NE 117th Ave", "StreetComponents": [ { "BaseName": "117th", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "7411" }, "Position": [ -122.55103, 45.67666 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], Use Geocode 387 Amazon Location Service Developer Guide "AccessPoints": [ { "Position": [ -122.55103, 45.67684 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 11211 NE Fourth Plain Blvd, Vancouver, WA 98662-5770, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Orchards Area", "PostalCode": "98662-5770", "Street": "NE Fourth Plain Blvd", "StreetComponents": [ { "BaseName": "Fourth Plain", Use Geocode 388 Amazon Location Service Developer Guide "Type": "Blvd", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "11211" }, "Position": [ -122.5575, 45.66574 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.55751, 45.66587 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } } ] }
amazon-location-developer-guide-086
amazon-location-developer-guide.pdf
86
"Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Orchards Area", "PostalCode": "98662-5770", "Street": "NE Fourth Plain Blvd", "StreetComponents": [ { "BaseName": "Fourth Plain", Use Geocode 388 Amazon Location Service Developer Guide "Type": "Blvd", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "NE", "Language": "en" } ], "AddressNumber": "11211" }, "Position": [ -122.5575, 45.66574 ], "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "AccessPoints": [ { "Position": [ -122.55751, 45.66587 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } } ] } Use Geocode 389 Amazon Location Service cURL Developer Guide curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Starbucks , Vancouver" }' AWS CLI aws geo-places geocode --key ${YourKey} --query-text "Starbucks , Vancouver" Geocode a tourist spot Sample request { "QueryText": "Eiffel Tower, Paris" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "The Eiffel Tower Romance", "Address": { "Label": "The Eiffel Tower Romance, Rue de Rivoli, 75004 Paris, France", "Country": { "Code2": "FR", "Code3": "FRA", "Name": "France" }, "Region": { "Code": "IDF", "Name": "Île-de-France" }, Use Geocode 390 Amazon Location Service Developer Guide "SubRegion": { "Name": "Paris" }, "Locality": "Paris", "District": "4e Arrondissement", "PostalCode": "75004", "Street": "Rue de Rivoli", "StreetComponents": [ { "BaseName": "Rivoli", "Type": "Rue de", "TypePlacement": "BeforeBaseName", "TypeSeparator": " ", "Language": "fr" } ] }, "Position": [ 2.35284, 48.85702 ], "Categories": [ { "Id": "theatre,_music_and_culture", "Name": "Theatre, Music and Culture", "LocalizedName": "Théâtre, musique et culture", "Primary": true }, { "Id": "historical_monument", "Name": "Historical Monument", "LocalizedName": "Monument historique", "Primary": false } ], "AccessPoints": [ { "Position": [ 2.3529, 48.85714 ] } ], "MatchScores": { Use Geocode 391 Amazon Location Service Developer Guide "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Eiffel Tower", "Address": { "Label": "Eiffel Tower, 2025 S Collegiate Dr, Paris, TX 75460-7853, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "TX", "Name": "Texas" }, "SubRegion": { "Name": "Lamar" }, "Locality": "Paris", "PostalCode": "75460-7853", "Street": "S Collegiate Dr", "StreetComponents": [ { "BaseName": "Collegiate", "Type": "Dr", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "S", "Language": "en" } ], "AddressNumber": "2025" }, "Position": [ Use Geocode 392 Amazon Location Service Developer Guide -95.52403, 33.64055 ], "Categories": [ { "Id": "historical_monument", "Name": "Historical Monument", "LocalizedName": "Historical Monument", "Primary": true }, { "Id": "landmark-attraction", "Name": "Landmark-Attraction", "LocalizedName": "Landmark-Attraction", "Primary": false } ], "AccessPoints": [ { "Position": [ -95.52411, 33.6405 ] } ], "MatchScores": { "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Eiffel Tower", "Address": { "Label": "Eiffel Tower, Northland Dr, Paris, MI 49338, United States", "Country": { "Code2": "US", Use Geocode 393 Amazon Location Service Developer Guide "Code3": "USA", "Name": "United States" }, "Region": { "Code": "MI", "Name": "Michigan" }, "SubRegion": { "Name": "Mecosta" }, "Locality": "Paris", "PostalCode": "49338", "Street": "Northland Dr", "StreetComponents": [ { "BaseName": "Northland", "Type": "Dr", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ] }, "Position": [ -85.50268, 43.78907 ], "Categories": [ { "Id": "outdoor-recreation", "Name": "Outdoor-Recreation", "LocalizedName": "Outdoor/Recreation", "Primary": true } ], "AccessPoints": [ { "Position": [ -85.50282, 43.78907 ] } ], "MatchScores": { Use Geocode 394 Amazon Location Service Developer Guide "Overall": 1, "Components": { "Title": 1, "Address": { "Locality": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Eiffel Tower, Paris" }' AWS CLI aws geo-places geocode --key ${YourKey} --query-text "Eiffel Tower, Paris" Developer tips • Use complete addresses or query component for better results. To learn more, see How to geocode an address. • Use filters like IncludeCountries and IncludePlaceTypes to obtain accurate results. For instance, if you need Vancouver from the USA, apply "IncludeCountries": ["USA"] to prioritize results in the USA. To learn more, see How to geocode using filters. { "QueryText": "Vancouver", "Filter": { "IncludeCountries": ["USA"], "IncludePlaceTypes": ["City"] } } Use Geocode 395 Amazon Location Service Developer Guide How to geocode an address number with a postal code In countries where postal codes are highly specific (linking only a few addresses on the same street), an address can be found using only the house number and postal code. This practice is common in transportation and parcel delivery logistics. This feature is supported in Canada, the United Kingdom, the Netherlands, the United States (ZIP+4), Israel, Ireland, and Singapore. In both Ireland and Singapore, postal codes provide exact location details down to the specific house number. Examples Geocode an address with postal code Sample request Use query component { "QueryComponents": { "AddressNumber": "1368", "PostalCode": "V5N 1T2" } } Use free text { "QueryText": "1368, V5N1T2" } Sample response { "ResultItems": [
amazon-location-developer-guide-087
amazon-location-developer-guide.pdf
87
few addresses on the same street), an address can be found using only the house number and postal code. This practice is common in transportation and parcel delivery logistics. This feature is supported in Canada, the United Kingdom, the Netherlands, the United States (ZIP+4), Israel, Ireland, and Singapore. In both Ireland and Singapore, postal codes provide exact location details down to the specific house number. Examples Geocode an address with postal code Sample request Use query component { "QueryComponents": { "AddressNumber": "1368", "PostalCode": "V5N 1T2" } } Use free text { "QueryText": "1368, V5N1T2" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "1368 E 8th Ave, Vancouver, BC V5N 1T2, Canada", "Address": { "Label": "1368 E 8th Ave, Vancouver, BC V5N 1T2, Canada", "Country": { "Code2": "CA", Use Geocode 396 Amazon Location Service Developer Guide "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Grandview-Woodland", "PostalCode": "V5N 1T2", "Street": "E 8th Ave", "StreetComponents": [ { "BaseName": "8th", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "E", "Language": "en" } ], "AddressNumber": "1368" }, "Position": [ -123.07612, 49.26306 ], "MapView": [ -123.0775, 49.26216, -123.07474, 49.26396 ], "AccessPoints": [ { "Position": [ -123.07611, 49.26333 ] } ], Use Geocode 397 Amazon Location Service Developer Guide "MatchScores": { "Overall": 1, "Components": { "Address": { "PostalCode": 1, "AddressNumber": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryComponents": { "AddressNumber": "1368", "PostalCode": "V5N 1T2" } }' AWS CLI aws geo-places geocode --key ${YourKey} --query-components '{"AddressNumber" : "1368", "PostalCode": "V5N 1T2"}' Geocode an address with postal code in Singapore and Ireland In Ireland, the Eircode system assigns a unique code to every home and business, while in Singapore, postal codes are equally specific. In both countries, a postal code alone can identify an exact address: there is no need for the street name, city, or house number. • Singapore: 6-digit postal code • Ireland: 7-character Eircode Use Geocode 398 Developer Guide Amazon Location Service Sample request Use query component { "QueryComponents": { "PostalCode": "D02 X285" } } Use free text { "QueryText": "D02 X285" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "29-31 Adelaide Road, Dublin, County Dublin, D02 X285, Ireland", "Address": { "Label": "29-31 Adelaide Road, Dublin, County Dublin, D02 X285, Ireland", "Country": { "Code2": "IE", "Code3": "IRL", "Name": "Ireland" }, "SubRegion": { "Code": "D", "Name": "County Dublin" }, "Locality": "Dublin", "District": "Dublin 2", "PostalCode": "D02 X285", "Street": "Adelaide Road", "StreetComponents": [ { Use Geocode 399 Amazon Location Service Developer Guide "BaseName": "Adelaide", "Type": "Road", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "29-31" }, "Position": [ -6.25549, 53.33207 ], "MapView": [ -6.257, 53.33117, -6.25398, 53.33297 ], "AccessPoints": [ { "Position": [ -6.25536, 53.33231 ] } ], "MatchScores": { "Overall": 1, "Components": { "Address": { "PostalCode": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ Use Geocode 400 Amazon Location Service Developer Guide --header 'Content-Type: application/json' \ --data '{ "QueryComponents": { "PostalCode": "D02 X285" } }' AWS CLI aws geo-places geocode --key ${YourKey} --query-components '{"PostalCode": "V5N 1T2"}' Developer tips Learn more about ZIP+4 (United States) and Eircode (Ireland). Also, learn about postal code system in Canada, the United Kingdom, the Netherlands, Singapore, and Israel. How to geocode using geospatial context The Geocode API enables you to use geospatial context (such as bias position) to get desired results. Note "Bias position" refers to a mechanism that prioritizes search results based on a user's specified location or a defined area. It essentially shifts the focus of search results towards locations that are geographically closer to a designated bias point, without necessarily excluding other results. Potential use Use geospatial context to get the correct results based on your business needs. Examples Bias results to a position By biasing to a position, you can change the rankings of your results. Try the following example, with— and then without—the BiasPosition value and compare the results. Use Geocode 401 Developer Guide Amazon Location Service Sample request { "QueryText": "George Street", "BiasPosition": [ 151.2059, -33.8691 ] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Street", "Title": "George St, Sydney NSW, Australia", "Address": { "Label": "George St, Sydney NSW, Australia", "Country": { "Code2": "AU", "Code3": "AUS", "Name": "Australia" }, "Region": { "Code": "NSW", "Name": "New South Wales" }, "Locality": "Sydney", "Street": "George St", "StreetComponents": [ { "BaseName": "George", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ] }, "Position": [ 151.20691, Use Geocode 402 Amazon Location Service Developer Guide -33.86974 ], "Distance": 117, "MapView": [ 151.20225, -33.88406, 151.20912, -33.85635 ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Intersection": [ 1 ] } } } }, ...
amazon-location-developer-guide-088
amazon-location-developer-guide.pdf
88
"ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Street", "Title": "George St, Sydney NSW, Australia", "Address": { "Label": "George St, Sydney NSW, Australia", "Country": { "Code2": "AU", "Code3": "AUS", "Name": "Australia" }, "Region": { "Code": "NSW", "Name": "New South Wales" }, "Locality": "Sydney", "Street": "George St", "StreetComponents": [ { "BaseName": "George", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ] }, "Position": [ 151.20691, Use Geocode 402 Amazon Location Service Developer Guide -33.86974 ], "Distance": 117, "MapView": [ 151.20225, -33.88406, 151.20912, -33.85635 ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Intersection": [ 1 ] } } } }, ... ... ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "George Street", "BiasPosition": [ 151.2059, -33.8691 ] }' AWS CLI aws geo-places geocode --key ${YourKey} --query-text "George Street" --bias-position 151.2059 -33.8691 Use Geocode 403 Amazon Location Service Developer tips Developer Guide For address geocoding, try to use complete addresses or a query component with a combination of bias position, including country and place. To learn more, see How to geocode an address. How to geocode using filters The Geocode API enables you to use filters to get desired results. Potential use Use filters to restrict results based on your business needs. Examples Limit results within a country Specify a value for IncludeCountries to return values for that country in the results. Sample request Without IncludeCountries": ["USA"], the Geocode API will return Vancouver, BC, Canada. { "QueryText": "Vancouver", "Filter" : { "IncludeCountries": ["USA"] } } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Locality", "Title": "Vancouver, WA, United States", "Address": { "Label": "Vancouver, WA, United States", "Country": { "Code2": "US", "Code3": "USA", Use Geocode 404 Amazon Location Service Developer Guide "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "PostalCode": "98660" }, "Position": [ -122.67156, 45.63248 ], "MapView": [ -122.77466, 45.57714, -122.46451, 45.69803 ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Locality": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Vancouver", "Filter" : { "IncludeCountries": ["USA"] Use Geocode 405 Amazon Location Service Developer Guide } }' AWS CLI aws geo-places geocode --key ${YourKey} --query-text "Vancouver" --filter '{"IncludeCountries": ["USA"]}' Refine results with place type filters Specify a value for IncludePlaceTypes to return values for that place in the results. Sample request Without IncludePlaceTypes": ["Street"], the Geocode API will return Georgia, a country. You can further refine the results by adding "IncludeCountries" with values of CAN and USA and compare the results. { "QueryText": "Georgia", "Filter" : { "IncludePlaceTypes": ["Street"] } } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Street", "Title": "Georgia, Benito Juárez, CDMX, México", "Address": { "Label": "Georgia, Benito Juárez, CDMX, México", "Country": { "Code2": "MX", "Code3": "MEX", "Name": "México" }, Use Geocode 406 Amazon Location Service Developer Guide "Region": { "Code": "CDMX", "Name": "Ciudad de México" }, "SubRegion": { "Name": "Ciudad de México" }, "Locality": "Benito Juárez", "Street": "Georgia", "StreetComponents": [ { "BaseName": "Georgia", "Language": "es" } ] }, "Position": [ -99.17754, 19.38887 ], "MapView": [ -99.18133, 19.38755, -99.17374, 19.39016 ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Intersection": [ 1 ] } } } } ] } cURL curl --request POST \ Use Geocode 407 Amazon Location Service Developer Guide --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Georgia", "Filter" : { "IncludePlaceTypes": ["Street"] } }' AWS CLI aws geo-places geocode --key ${YourKey} --query-text "Georgia" --filter '{"IncludePlaceTypes": ["Street"]}' Developer tips For address geocoding, try to use complete addresses or a query component with a combination of bias position, including country and place. To learn more, see How to geocode an address. How to geocode for the time zone of a city You can use the Geocode API to provide time zone information such as UTC offset and time zone name. Potential use Possible uses for geocode time zones: • Create a world clock • Schedule meetings in different geographies Examples Example Geocode in Brussels, with time zone request. Sample request { Use Geocode 408 Amazon Location Service Developer Guide "QueryText": "Brussels", "Filter" : { "IncludePlaceTypes": ["Locality"] }, "AdditionalFeatures": [ "TimeZone" ] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Locality", "Title": "Brussel, België", "Address": { "Label": "Brussel, België", "Country": { "Code2": "BE", "Code3": "BEL", "Name": "België" }, "Region": { "Code": "BRU", "Name": "Brussel" }, "SubRegion": { "Name": "Brussel" }, "Locality": "Brussel", "PostalCode": "1000" }, "Position": [ 4.35609, 50.84439 ], "MapView": [ 4.3139, 50.79628, 4.43709, 50.91397 Use Geocode 409 Developer Guide Amazon Location Service ], "TimeZone": { "Name": "Europe/Brussels", "Offset": "+02:00", "OffsetSeconds": 7200 }, "MatchScores": { "Overall": 1, "Components": { "Address": { "Locality": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type:
amazon-location-developer-guide-089
amazon-location-developer-guide.pdf
89
} Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Locality", "Title": "Brussel, België", "Address": { "Label": "Brussel, België", "Country": { "Code2": "BE", "Code3": "BEL", "Name": "België" }, "Region": { "Code": "BRU", "Name": "Brussel" }, "SubRegion": { "Name": "Brussel" }, "Locality": "Brussel", "PostalCode": "1000" }, "Position": [ 4.35609, 50.84439 ], "MapView": [ 4.3139, 50.79628, 4.43709, 50.91397 Use Geocode 409 Developer Guide Amazon Location Service ], "TimeZone": { "Name": "Europe/Brussels", "Offset": "+02:00", "OffsetSeconds": 7200 }, "MatchScores": { "Overall": 1, "Components": { "Address": { "Locality": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Brussels", "Filter" : { "IncludePlaceTypes": ["Locality"] }, "AdditionalFeatures": [ "TimeZone" ] }' AWS CLI aws geo-places geocode --key ${YourKey} --query-text "Brussels" \ --filter '{"IncludePlaceTypes": ["Locality"]}' \ --additional-features "TimeZone" Use Geocode 410 Amazon Location Service Developer Guide How to geocode in a specific language This feature allows the selection of a preferred response language from BCP47-compliant codes. It detects the query language based on name variants and uses the preferred language for unmatched tokens and ambiguous cases. If there is no requested language, the Places API provides results in the official country language, but prioritizes the regional language in regions where it differs. As a fallback strategy, if any address elements are unavailable in the requested language, Places APIs return addresses in the default language. Potential use cases One potential use case is to localize the query and/or the result. Examples Get result in a specific language Sample request { "QueryText":"Patna, Bihar, Bharat", "Language": "HI" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Locality", "Title": "####, #####, ####", "Address": { "Label": "####, #####, ####", "Country": { "Code2": "IN", "Code3": "IND", "Name": "####" }, "Region": { "Code": "BR", Use Geocode 411 Amazon Location Service Developer Guide "Name": "#####" }, "SubRegion": { "Name": "####" }, "Locality": "####", "PostalCode": "800001" }, "Position": [ 85.13752, 25.60134 ], "MapView": [ 85.03222, 25.55157, 85.27107, 25.65917 ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Country": 1, "Region": 1, "Locality": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText":"Patna, Bihar, Bharat", "Language": "HI" }' Use Geocode 412 Amazon Location Service AWS CLI Developer Guide aws geo-places geocode --key ${YourKey} --query-text "####, #####, ####" --language "HI" Query in a specific language Sample request { "QueryText":"####, #####, ####" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Locality", "Title": "Patana, Bihar, Bharat", "Address": { "Label": "Patana, Bihar, Bharat", "Country": { "Code2": "IN", "Code3": "IND", "Name": "Bharat" }, "Region": { "Code": "BR", "Name": "Bihar" }, "SubRegion": { "Name": "Patana" }, "Locality": "Patana", "PostalCode": "800001" }, "Position": [ 85.13752, 25.60134 ], Use Geocode 413 Amazon Location Service Developer Guide "MapView": [ 85.03222, 25.55157, 85.27107, 25.65917 ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Country": 1, "Region": 1, "Locality": 1 } } } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText":"####, #####, ####" }' AWS CLI aws geo-places geocode --key ${YourKey} --query-text "####, #####, ####" Query and result in a specific language Sample request { "QueryText":"####, #####, ####", "Language": "HI" } Use Geocode 414 Developer Guide Amazon Location Service Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Locality", "Title": "####, #####, ####", "Address": { "Label": "####, #####, ####", "Country": { "Code2": "IN", "Code3": "IND", "Name": "####" }, "Region": { "Code": "BR", "Name": "#####" }, "SubRegion": { "Name": "####" }, "Locality": "####", "PostalCode": "800001" }, "Position": [ 85.13752, 25.60134 ], "MapView": [ 85.03222, 25.55157, 85.27107, 25.65917 ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Country": 1, "Region": 1, "Locality": 1 } } Use Geocode 415 Amazon Location Service } } ] } cURL Developer Guide curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText":"####, #####, ####", "Language": "HI" }' AWS CLI aws geo-places geocode --key ${YourKey} --query-text "####, #####, ####" --language "HI" How to use ReverseGeocode This section contains a variety of how to guides and examples for how to use ReverseGeocode APIs. Topics • How to reverse geocode for a position • How to reverse geocode for correct result • How to reverse geocode in a specific language • How to reverse geocode for the time zone of a city • How to reverse geocode with a political view • How to get intersections How to reverse geocode for a position The Reverse Geocode API allows you to convert a geocode to a geographic area based on a position query. The API response includes place details, providing information about the location associated with specific coordinates. Use ReverseGeocode 416 Amazon Location Service Potential use cases Developer Guide • Store place information: Add place details to a datastore containing geocoordinates. • Map visualization: Use place information
amazon-location-developer-guide-090
amazon-location-developer-guide.pdf
90
in a specific language • How to reverse geocode for the time zone of a city • How to reverse geocode with a political view • How to get intersections How to reverse geocode for a position The Reverse Geocode API allows you to convert a geocode to a geographic area based on a position query. The API response includes place details, providing information about the location associated with specific coordinates. Use ReverseGeocode 416 Amazon Location Service Potential use cases Developer Guide • Store place information: Add place details to a datastore containing geocoordinates. • Map visualization: Use place information to display data on a map. • User location detection: Identify the user's location based on their device position. Reverse geocode a position Sample request { "QueryPosition": [ -123.11694, 49.28126 ] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Address": { "Label": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Downtown Vancouver", "PostalCode": "V6B 0M3", "Street": "W Georgia St", "StreetComponents": [ { "BaseName": "Georgia", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "510" }, "Position": [-123.11694, 49.28126], "Distance": 0, Use ReverseGeocode 417 Amazon Location Service Developer Guide "MapView": [-123.11813, 49.27786, -123.11076, 49.28246], "AccessPoints": [ { "Position": [-123.11656, 49.28151] } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ -123.11694, 49.28126 ] }' AWS CLI aws geo-places reverse-geocode --key ${YourKey} --query-position "-123.11694,49.28126" Reverse geocode a position with multiple results Sample request { "QueryPosition": [ -123.11694, 49.28126 ], "MaxResults": "3" } Sample response { Use ReverseGeocode 418 Amazon Location Service Developer Guide "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Address": { /* Address details */ }, "Position": [-123.11694, 49.28126], "Distance": 0, "MapView": [/* Map view details */], "AccessPoints": [/* Access point details */] }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "ChargePoint", "Address": { /* Address details */ }, "Position": [-123.11663, 49.28116], "Distance": 25, "Categories": [/* Category details */], "AccessPoints": [/* Access point details */] }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Zipcar", "Address": { /* Address details */ }, "Position": [-123.11715, 49.28094], "Distance": 29, "Categories": [/* Category details */], "AccessPoints": [/* Access point details */] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ -123.11694, Use ReverseGeocode 419 Amazon Location Service Developer Guide 49.28126 ], "MaxResults": "3" }' AWS CLI aws geo-places reverse-geocode --key ${YourKey} --query-position "-123.11694,49.28126" --max-results "3" Developer tips For targeted results, use IncludePlaceTypes in the filter. { "QueryPosition": [ -123.11694, 49.28126 ], "Filter": { "IncludePlaceTypes": ["PointAddress"] } } How to reverse geocode for correct result This guide provides methods to refine reverse geocoding results, ensuring that the returned data aligns closely with specific business needs. Using filters, users can narrow down results to more precisely match types like address points, streets, or localities. Potential Use Cases • Restrict results for specific needs: Use filters to retrieve only the most relevant information, such as exact addresses or broader locality data, based on business requirements. Examples Filter for a Point Address By filtering for PointAddress, you can retrieve specific street addresses, enhancing location accuracy. Use ReverseGeocode 420 Developer Guide Amazon Location Service Sample Request { "QueryPosition": [ -97.721, 30.404 ], "Filter": { "IncludePlaceTypes": [ "PointAddress" ] } } Sample Response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "11721 Domain Blvd, Austin, TX 78758-0051, United States", "Address": { "Label": "11721 Domain Blvd, Austin, TX 78758-0051, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "TX", "Name": "Texas" }, "SubRegion": { "Name": "Travis" }, "Locality": "Austin", "District": "North Burnet", "PostalCode": "78758-0051", "Street": "Domain Blvd", "StreetComponents": [ { "BaseName": "Domain", "Type": "Blvd", Use ReverseGeocode 421 Amazon Location Service Developer Guide "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "11721" }, "Position": [ -97.72087, 30.404 ], "Distance": 5, "MapView": [ -97.72219, 30.40273, -97.72057, 30.40649 ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "{ "QueryPosition": [ -97.721, 30.404 ], "Filter": { "IncludePlaceTypes": [ "PointAddress" ] }' AWS CLI aws geo-places reverse-geocode --key ${YourKey} --query-position -97.721 30.404 -- filter '{"IncludePlaceTypes": ["PointAddress"]}' Use ReverseGeocode 422 Amazon Location Service Filter for a Street Developer Guide By filtering for Street, the API returns street-level data without specific address numbers. Sample Request { "QueryPosition": [ -97.721, 30.404 ], "Filter": { "IncludePlaceTypes": [ "Street" ] } } Sample Response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Street", "Title": "Domain Blvd, Austin, TX
amazon-location-developer-guide-091
amazon-location-developer-guide.pdf
91
] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "{ "QueryPosition": [ -97.721, 30.404 ], "Filter": { "IncludePlaceTypes": [ "PointAddress" ] }' AWS CLI aws geo-places reverse-geocode --key ${YourKey} --query-position -97.721 30.404 -- filter '{"IncludePlaceTypes": ["PointAddress"]}' Use ReverseGeocode 422 Amazon Location Service Filter for a Street Developer Guide By filtering for Street, the API returns street-level data without specific address numbers. Sample Request { "QueryPosition": [ -97.721, 30.404 ], "Filter": { "IncludePlaceTypes": [ "Street" ] } } Sample Response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Street", "Title": "Domain Blvd, Austin, TX 78758, United States", "Address": { "Label": "Domain Blvd, Austin, TX 78758, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "TX", "Name": "Texas" }, "SubRegion": { "Name": "Travis" }, "Locality": "Austin", "District": "North Burnet", "PostalCode": "78758", "Street": "Domain Blvd", Use ReverseGeocode 423 Amazon Location Service Developer Guide "StreetComponents": [ { "BaseName": "Domain", "Type": "Blvd", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ] }, "Position": [ -97.72103, 30.40399 ], "Distance": 3, "MapView": [ -97.72219, 30.40273, -97.72057, 30.40649 ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "{ "QueryPosition": [ -97.721, 30.404 ], "Filter": { "IncludePlaceTypes": [ "Street" ] }' Use ReverseGeocode 424 Amazon Location Service AWS CLI Developer Guide aws geo-places reverse-geocode --key ${YourKey} --query-position -97.721 30.404 -- filter '{"IncludePlaceTypes": ["Street"]}' Filter for a Locality By filtering for Locality, you can retrieve broader location data, including city names. Sample Request { "QueryPosition": [ -97.721, 30.404 ], "Filter": { "IncludePlaceTypes": [ "Locality" ] } } Sample Response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Locality", "Title": "Austin, TX, United States", "Address": { "Label": "Austin, TX, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "TX", "Name": "Texas" }, "SubRegion": { Use ReverseGeocode 425 Amazon Location Service Developer Guide "Name": "Travis" }, "Locality": "Austin", "PostalCode": "78701" }, "Position": [ -97.74299, 30.26759 ], "Distance": 0, "MapView": [ -98.06484, 30.06592, -97.55914, 30.51965 ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "{ "QueryPosition": [ -97.721, 30.404 ], "Filter": { "IncludePlaceTypes": [ "Locality" ] }' AWS CLI aws geo-places reverse-geocode --key ${YourKey} --query-position -97.721 30.404 -- filter '{"IncludePlaceTypes": ["Locality"]}' Use ReverseGeocode 426 Amazon Location Service Developer Guide How to reverse geocode in a specific language The feature allows the selection of a preferred response language from BCP47-compliant codes. It detects the query language based on name variants and uses the preferred language for unmatched tokens and ambiguous cases. If no requested language, the Places API provides results in the official country language, but prioritizes the regional language in regions where it differs. As a fallback strategy, if any address elements are unavailable in the requested language, Places APIs return addresses in the default language. Potential use cases One potential use case is to localize the query and/or the result. Examples Get result in a specific language Sample request { "QueryPosition": [ 139.69172, 35.6895 ], "Language": "JA" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "2-8-1 Nishishinjuku, Shinjuku-ku, Tokyo 160-0023, Japan", "Address": { "Label": "2-8-1 Nishishinjuku, Shinjuku-ku, Tokyo 160-0023, Japan", "Country": { "Code2": "JP", "Code3": "JPN", "Name": "Japan" }, Use ReverseGeocode 427 Amazon Location Service Developer Guide "Region": { "Name": "Tokyo" }, "SubRegion": {}, "Locality": "Shinjuku-ku", "SubDistrict": "Nishishinjuku", "PostalCode": "160-0023", "Block": "2 Chome", "SubBlock": "8", "AddressNumber": "1" }, "Position": [ 139.69171, 35.68949 ], "Distance": 1, "MapView": [ 139.69071, 35.68861, 139.69251, 35.69048 ], "AccessPoints": [ { "Position": [ 139.69206, 35.68954 ] } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ 139.69172, Use ReverseGeocode 428 Amazon Location Service Developer Guide 35.6895 ], "Language": "JA" }' AWS CLI aws geo-places reverse-geocode --key ${YourKey} --query-position 139.69172 35.6895 --language "JA" How to reverse geocode for the time zone of a city You can use the Reverse Geocode API to request for time zone information such as UTC offset and time zone name Potential use Possible uses for geocode time zones: • Create a world clock • Schedule meetings in different geographies Examples Example Reverse geocode a location in Tokyo, with time zone request. Sample request { "QueryPosition": [ 139.69172, 35.6895 ], "AdditionalFeatures": [ "TimeZone" ] } Use ReverseGeocode 429 Developer Guide Amazon Location Service Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "#160-0023 #########2##8-1", "Address": { "Label": "#160-0023 #########2##8-1", "Country": { "Code2": "JP", "Code3": "JPN", "Name": "##" }, "Region": { "Name": "###" }, "SubRegion": {}, "Locality": "###", "SubDistrict": "###", "PostalCode": "160-0023", "Block": "2##", "SubBlock": "8", "AddressNumber": "1" }, "Position": [ 139.69171, 35.68949 ], "Distance": 1, "MapView": [ 139.69071, 35.68861, 139.69251, 35.69048 ], "AccessPoints": [ { "Position": [ 139.69206, 35.68954
amazon-location-developer-guide-092
amazon-location-developer-guide.pdf
92
Example Reverse geocode a location in Tokyo, with time zone request. Sample request { "QueryPosition": [ 139.69172, 35.6895 ], "AdditionalFeatures": [ "TimeZone" ] } Use ReverseGeocode 429 Developer Guide Amazon Location Service Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "#160-0023 #########2##8-1", "Address": { "Label": "#160-0023 #########2##8-1", "Country": { "Code2": "JP", "Code3": "JPN", "Name": "##" }, "Region": { "Name": "###" }, "SubRegion": {}, "Locality": "###", "SubDistrict": "###", "PostalCode": "160-0023", "Block": "2##", "SubBlock": "8", "AddressNumber": "1" }, "Position": [ 139.69171, 35.68949 ], "Distance": 1, "MapView": [ 139.69071, 35.68861, 139.69251, 35.69048 ], "AccessPoints": [ { "Position": [ 139.69206, 35.68954 ] } Use ReverseGeocode 430 Developer Guide Amazon Location Service ], "TimeZone": { "Name": "Asia/Tokyo", "Offset": "+09:00", "OffsetSeconds": 32400 } } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ 139.69172, 35.6895 ], "AdditionalFeatures": [ "TimeZone" ] }' AWS CLI aws geo-places reverse-geocode --key ${YourKey} --query-position 139.69172 35.6895 --additional-features "TimeZone" How to reverse geocode with a political view The Amazon Location Service allows you to specify a political view to ensure your application aligns with local regulations. This feature is useful when geocoding locations in disputed areas where place names or borders may vary depending on the political view. Potential Use Cases • Adhere to local policies: Ensure that place names and borders comply with legal requirements of the selected political view. Use ReverseGeocode 431 Developer Guide Amazon Location Service Examples Reverse Geocode a Disputed Position Sample Request { "QueryPosition": [ 33.95876, 45.46824 ], "PoliticalView": "RUS" } Sample Response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "Locality", "Title": "Первомайский район, Южный федеральный округ, Россия", "Address": { "Label": "Первомайский район, Южный федеральный округ, Россия", "Country": { "Code2": "RU", "Code3": "RUS", "Name": "Россия" }, "Region": { "Name": "Южный федеральный округ" }, "SubRegion": { "Name": "Республика Крым" }, "Locality": "Первомайский район" }, "Position": [ 33.85939, 45.7142 ], "Distance": 0, "MapView": [ Use ReverseGeocode 432 Amazon Location Service Developer Guide 33.52692, 45.34303, 34.12277, 45.80953 ], "PoliticalView": "RUS" } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ 33.95876, 45.46824 ], "PoliticalView": "RUS" }' AWS CLI aws geo-places reverse-geocode --key ${YourKey} --query-position 33.95876 45.46824 --political-view "RUS" How to get intersections Geocode API can retrieve nearby intersections to the specified location. Potential use case Retrieve all nearby intersections. This can be used by emergency services and delivery couriers. Emergency response vehicles often need to identify nearby intersections for optimal positioning when responding to calls. This allows them to maintain clear access routes and faster response times while ensuring visibility from multiple approaches. Similarly, delivery couriers can utilize intersection data to find more efficient parking spots, especially in dense urban areas where door- to-door parking may be limited or restricted. Use ReverseGeocode 433 Developer Guide Amazon Location Service Get nearby intersections Sample request { "QueryPosition": [-123.11694, 49.28126], "AdditionalFeatures": ["Intersections"] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>" "PlaceType": "PointAddress", "Title": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Address": { "Label": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Downtown Vancouver", "PostalCode": "V6B 0M3", "Street": "W Georgia St", "StreetComponents": [ { "BaseName": "Georgia", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" Use ReverseGeocode 434 Amazon Location Service Developer Guide } ], "AddressNumber": "510" }, "Position": [ -123.11694, 49.28126 ], "Distance": 0, "MapView": [ -123.11813, 49.27786, -123.11076, 49.28246 ], "Intersections": [ { "PlaceId": "<Redacted>", "Title": "W Georgia St & Richards St, Vancouver, BC V6B, Canada", "Address": { "Label": "W Georgia St & Richards St, Vancouver, BC V6B, Canada", "PostalCode": "V6B", "Intersection": [ "W Georgia St", "Richards St" ] }, "Position": [ -123.11614, 49.28124 ], "Distance": 58 }, { "PlaceId": "<Redacted>", "Title": "W Georgia St & Seymour St, Vancouver, BC V6B, Canada", "Address": { "Label": "W Georgia St & Seymour St, Vancouver, BC V6B, Canada", "PostalCode": "V6B", "Intersection": [ "W Georgia St", Use ReverseGeocode 435 Amazon Location Service Developer Guide "W Georgia St", "Seymour St", "Seymour St" ] }, "Position": [ -123.11712, 49.28186 ], "Distance": 68 } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ -123.11694, 49.28126 ], "AdditionalFeatures": ["Intersections"] } AWS CLI aws geo-places reverse-geocode --key ${YourKey} --query-position -123.11694, 49.28126 --additional-features "Intersections" How to use Autocomplete This topic demonstrates how to use the Autocomplete API to efficiently retrieve address suggestions based on user input. It covers two key applications: basic address autocompletion, which suggests addresses as users type, and filtered autocompletion, allowing users to narrow results by criteria such as region or specific location types. These examples provide practical Use Autocomplete 436 Amazon
amazon-location-developer-guide-093
amazon-location-developer-guide.pdf
93
] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ -123.11694, 49.28126 ], "AdditionalFeatures": ["Intersections"] } AWS CLI aws geo-places reverse-geocode --key ${YourKey} --query-position -123.11694, 49.28126 --additional-features "Intersections" How to use Autocomplete This topic demonstrates how to use the Autocomplete API to efficiently retrieve address suggestions based on user input. It covers two key applications: basic address autocompletion, which suggests addresses as users type, and filtered autocompletion, allowing users to narrow results by criteria such as region or specific location types. These examples provide practical Use Autocomplete 436 Amazon Location Service Developer Guide guidance for integrating Autocomplete into applications to enhance search relevance and user experience. Topics • How to complete an address • How to complete an address with filters How to complete an address The Autocomplete API enables you to complete partially typed addresses, providing standardized input for end users and improving efficiency during data entry. Potential use cases • Complete an address during checkout: Facilitate accurate and fast address input as customers type into a checkout form. • Country-specific address completion: Restrict suggestions to a specific country for compliance or relevance to the user’s location. Examples Complete address with minimal data In this example, minimal data is returned to keep the response concise and cost-effective. Complete place details can be retrieved later using the PlaceId with the GetPlace API. Sample request { "QueryText": "100 McCullum Rd" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "United Kingdom, E3 5JB, London, 100 McCullum Road" Use Autocomplete 437 Amazon Location Service } ], "QueryRefinements": [] } cURL Developer Guide curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/autocomplete?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "100 McCullum Rd" }' AWS CLI aws geo-places autocomplete --key ${YourKey} --query-text "100 McCullum Rd" Complete address with address component This example returns multiple address suggestions, allowing users to select a standardized address format for populating form fields accurately. Sample request { "QueryText": "100 McCullum Rd", "AdditionalFeatures": [ "Core" ] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "United Kingdom, E3 5JB, London, 100 McCullum Road", Use Autocomplete 438 Amazon Location Service Developer Guide "Address": { "Label": "100 McCullum Road, London, E3 5JB, United Kingdom", "Country": { "Code2": "GB", "Code3": "GBR", "Name": "United Kingdom" }, "Region": { "Name": "England" }, "SubRegion": { "Code": "LDN", "Name": "London" }, "Locality": "London", "District": "Bow", "PostalCode": "E3 5JB", "Street": "McCullum Road", "StreetComponents": [ { "BaseName": "McCullum", "Type": "Road", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "100" }, "Language": "en", "Highlights": { "Title": [ { "StartIndex": 32, "EndIndex": 35, "Value": "100" }, { "StartIndex": 36, "EndIndex": 49, "Value": "McCullum Road" } ], "Address": { Use Autocomplete 439 Amazon Location Service Developer Guide "Label": [ { "StartIndex": 0, "EndIndex": 3, "Value": "100" }, { "StartIndex": 4, "EndIndex": 17, "Value": "McCullum Road" } ], "Street": [ { "StartIndex": 0, "EndIndex": 13, "Value": "McCullum Road" } ], "AddressNumber": [ { "StartIndex": 0, "EndIndex": 3, "Value": "100" } ] } } }, ... ], "QueryRefinements": [] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/autocomplete?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "100 McCullum Rd", "AdditionalFeatures": [ Use Autocomplete 440 Amazon Location Service "Core" ] }' AWS CLI Developer Guide aws geo-places autocomplete --key ${YourKey} --query-text "100 McCullum Rd" -- additional-features "Core" How to complete an address with filters The Autocomplete API enables you to complete partially typed addresses, facilitating quick and standardized address input for end users. By using the AdditionalFeatures parameter, you can customize the information provided in the response to meet specific requirements. Potential use cases • Minimize data for cost efficiency: Reduce response size and data transfer costs by requesting only essential address components when a follow-up query is anticipated. • Include necessary details for direct use: Retrieve comprehensive address information to eliminate the need for additional queries. Examples Complete address with country filter This example applies a country filter to refine results, enabling a standardized form of the user- inputted address to populate form fields accurately. Sample request { "QueryText": "100 McCullum Rd", "Filter": { "IncludeCountries": [ "GBR" ] } } Use Autocomplete 441 Amazon Location Service Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", Developer Guide "Title": "United Kingdom, E3 5JB, London, 100 McCullum Road", "Address": { "Label": "100 McCullum Road, London, E3 5JB, United Kingdom", "Country": { "Code2": "GB", "Code3": "GBR", "Name": "United Kingdom" }, "Region": { "Name": "England" }, "SubRegion": { "Code": "LDN", "Name": "London" }, "Locality": "London", "District": "Bow", "PostalCode": "E3 5JB", "Street": "McCullum Road", "StreetComponents": [ { "BaseName": "McCullum", "Type": "Road", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "100" }, "Language": "en", "Highlights": { "Title": [ { "StartIndex": 32, "EndIndex": 35, "Value": "100" Use Autocomplete 442 Amazon Location Service
amazon-location-developer-guide-094
amazon-location-developer-guide.pdf
94
{ "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", Developer Guide "Title": "United Kingdom, E3 5JB, London, 100 McCullum Road", "Address": { "Label": "100 McCullum Road, London, E3 5JB, United Kingdom", "Country": { "Code2": "GB", "Code3": "GBR", "Name": "United Kingdom" }, "Region": { "Name": "England" }, "SubRegion": { "Code": "LDN", "Name": "London" }, "Locality": "London", "District": "Bow", "PostalCode": "E3 5JB", "Street": "McCullum Road", "StreetComponents": [ { "BaseName": "McCullum", "Type": "Road", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "100" }, "Language": "en", "Highlights": { "Title": [ { "StartIndex": 32, "EndIndex": 35, "Value": "100" Use Autocomplete 442 Amazon Location Service Developer Guide }, { "StartIndex": 36, "EndIndex": 49, "Value": "McCullum Road" } ], "Address": { "Label": [ { "StartIndex": 0, "EndIndex": 3, "Value": "100" }, { "StartIndex": 4, "EndIndex": 17, "Value": "McCullum Road" } ], "Street": [ { "StartIndex": 0, "EndIndex": 13, "Value": "McCullum Road" } ], "AddressNumber": [ { "StartIndex": 0, "EndIndex": 3, "Value": "100" } ] } } } ], "QueryRefinements": [] } Use Autocomplete 443 Amazon Location Service cURL Developer Guide curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/autocomplete?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "100 McCullum Rd", "Filter": { "IncludeCountries": [ "GBR" ] } }' AWS CLI aws geo-places autocomplete --key ${YourKey} --query-text "100 McCullum Rd" \ --filter '{"IncludeCountries": ["GBR"]}' Complete address with additional data This example returns additional data, allowing the returned address details to be used without a follow-up query. The Core set of additional features is sufficient for this use case. Sample request { "QueryText": "100 McCullum Rd", "Filter": { "IncludeCountries": [ "GBR" ] }, "AdditionalFeatures": [ "Core" ] } Use Autocomplete 444 Amazon Location Service Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", Developer Guide "Title": "United Kingdom, E3 5JB, London, 100 McCullum Road", "Address": { "Label": "100 McCullum Road, London, E3 5JB, United Kingdom", "Country": { "Code2": "GB", "Code3": "GBR", "Name": "United Kingdom" }, "Region": { "Name": "England" }, "SubRegion": { "Code": "LDN", "Name": "London" }, "Locality": "London", "District": "Bow", "PostalCode": "E3 5JB", "Street": "McCullum Road", "StreetComponents": [ { "BaseName": "McCullum", "Type": "Road", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "100" }, "Language": "en", "Highlights": { "Title": [ { "StartIndex": 32, "EndIndex": 35, "Value": "100" Use Autocomplete 445 Amazon Location Service Developer Guide }, { "StartIndex": 36, "EndIndex": 49, "Value": "McCullum Road" } ], "Address": { "Label": [ { "StartIndex": 0, "EndIndex": 3, "Value": "100" }, { "StartIndex": 4, "EndIndex": 17, "Value": "McCullum Road" } ], "Street": [ { "StartIndex": 0, "EndIndex": 13, "Value": "McCullum Road" } ], "AddressNumber": [ { "StartIndex": 0, "EndIndex": 3, "Value": "100" } ] } } } ], "QueryRefinements": [] } Use Autocomplete 446 Amazon Location Service cURL Developer Guide curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/autocomplete?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "100 McCullum Rd", "Filter": { "IncludeCountries": [ "GBR" ] }, "AdditionalFeatures": [ "Core" ] }' AWS CLI aws geo-places autocomplete --key ${YourKey} --query-text "100 McCullum Rd" \ --additional-features "Core" \ --filter '{"IncludeCountries": ["GBR"]}' How to use Get Place This section contains a variety of how to guides and examples for how to use Get Place APIs. Examples • How to get results for a PlaceId • How to get contacts for a PlaceId • How to get the time zone for a PlaceId • How to get the details for PlaceId in a specific language How to get results for a PlaceId The GetPlace API retrieves detailed information about a place using its unique PlaceId, allowing applications to access comprehensive details about specified locations. Use Get Place 447 Amazon Location Service Potential use cases Developer Guide • Retrieve store locations: Use PlaceId to obtain details about various store locations for improved user experience and efficient resource management. • Access related place details: Fetch details of places that were identified using other PlaceIds returned by previous queries. Examples Get place with a PlaceId Sample request https://places.geo.eu-central-1.amazonaws.com/v2/place/ AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz-_FFnJnzJSQ7JePd- sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP? key=Your_Key Sample response { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "London Eye", "Address": { "Label": "London Eye, County Hall, Westminster Bridge Road, London, SE1 7, United Kingdom", "Country": { "Code2": "GB", "Code3": "GBR", "Name": "United Kingdom" }, "Region": { "Name": "England" }, "SubRegion": { "Code": "LDN", "Name": "London" }, "Locality": "London", "District": "Waterloo", Use Get Place 448 Amazon Location Service Developer Guide "PostalCode": "SE1 7", "Street": "County Hall, Westminster Bridge Road", "StreetComponents": [ { "BaseName": "County Hall, Westminster Bridge Road", "Language": "en-GB" } ] }, "Position": [ -0.11953, 51.50336 ], "Categories": [ { "Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Tourist Attraction", "Primary": true }, { "Id": "landmark-attraction", "Name": "Landmark-Attraction", "LocalizedName": "Landmark-Attraction", "Primary": false }, { "Id": "residential_area-building", "Name": "Residential Area-Building", "LocalizedName": "Residential Area/Building", "Primary": false } ] } cURL curl --request GET \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/place/ AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz-_FFnJnzJSQ7JePd- sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP? key=Your_Key&language=en' Use Get Place 449 Amazon Location Service AWS CLI Developer Guide
amazon-location-developer-guide-095
amazon-location-developer-guide.pdf
95
"London", "District": "Waterloo", Use Get Place 448 Amazon Location Service Developer Guide "PostalCode": "SE1 7", "Street": "County Hall, Westminster Bridge Road", "StreetComponents": [ { "BaseName": "County Hall, Westminster Bridge Road", "Language": "en-GB" } ] }, "Position": [ -0.11953, 51.50336 ], "Categories": [ { "Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Tourist Attraction", "Primary": true }, { "Id": "landmark-attraction", "Name": "Landmark-Attraction", "LocalizedName": "Landmark-Attraction", "Primary": false }, { "Id": "residential_area-building", "Name": "Residential Area-Building", "LocalizedName": "Residential Area/Building", "Primary": false } ] } cURL curl --request GET \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/place/ AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz-_FFnJnzJSQ7JePd- sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP? key=Your_Key&language=en' Use Get Place 449 Amazon Location Service AWS CLI Developer Guide export PLACEID=AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz- _FFnJnzJSQ7JePd-sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIs aws geo-places get-place --key ${YourKey} --place-id ${PLACEID} How to get contacts for a PlaceId The GetPlace API allows retrieval of contact information associated with a specific PlaceId, providing you with details such as phone numbers and website URLs. Potential use cases • Obtain additional contact information for a saved PlaceId: Enhance stored place details by accessing contact data. • Retrieve contact details for addresses from Autocomplete: Use the PlaceId from the Autocomplete API to fetch specific contact details. Examples Get contacts for a PlaceId Sample request https://places.geo.eu-central-1.amazonaws.com/v2/place/ AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz-_FFnJnzJSQ7JePd- sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP? additional-features=Contact&key=Your_Key Sample response { "PlaceId": "AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz- _FFnJnzJSQ7JePd-sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP", "PlaceType": "PointOfInterest", "Title": "London Eye", "Address": { Use Get Place 450 Amazon Location Service Developer Guide "Label": "London Eye, County Hall, Westminster Bridge Road, London, SE1 7, United Kingdom", "Country": { "Code2": "GB", "Code3": "GBR", "Name": "United Kingdom" }, "Region": { "Name": "England" }, "SubRegion": { "Code": "LDN", "Name": "London" }, "Locality": "London", "District": "Waterloo", "PostalCode": "SE1 7", "Street": "County Hall, Westminster Bridge Road", "StreetComponents": [ { "BaseName": "County Hall, Westminster Bridge Road", "Language": "en-GB" } ] }, "Position": [ -0.11953, 51.50336 ], "Categories": [ { "Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Tourist Attraction", "Primary": true }, { "Id": "landmark-attraction", "Name": "Landmark-Attraction", "LocalizedName": "Landmark-Attraction", "Primary": false }, { "Id": "residential_area-building", Use Get Place 451 Amazon Location Service Developer Guide "Name": "Residential Area-Building", "LocalizedName": "Residential Area/Building", "Primary": false } ], "Contacts": { "Phones": [ { "Value": "+44870500600" }, { "Value": "+448709908883" } ], "Websites": [ { "Value": "http://www.londoneye.com" } ] } } cURL curl --request GET \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/place/ AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz-_FFnJnzJSQ7JePd- sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP? key=Your_Key&additional-features=Contact&language=en' AWS CLI export PLACEID=AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz- _FFnJnzJSQ7JePd-sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP aws geo-places get-place --key ${YourKey} --place-id ${PLACEID} --additional- features "Contact" --language "en" Use Get Place 452 Amazon Location Service Developer Guide How to get the time zone for a PlaceId The GetPlace API allows retrieval of contact information associated with a specific PlaceId, providing you with details such as phone numbers, time zones, and website URLs. Potential use cases • Obtain additional time zone information for a saved PlaceId: Create a world clock with store PlaceId. • Retrieve time zone details for addresses from Autocomplete: Track daylight savings time for a PlaceId. Examples Get the time zone for a PlaceId Sample request https://places.geo.eu-central-1.amazonaws.com/v2/place/ AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz-_FFnJnzJSQ7JePd- sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP? additional-features=TimeZone&key=Your_Key Sample response { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "London Eye", "Address": { "Label": "London Eye, County Hall, Westminster Bridge Road, London, SE1 7, United Kingdom", "Country": { "Code2": "GB", "Code3": "GBR", "Name": "United Kingdom" }, "Region": { "Name": "England" }, "SubRegion": { Use Get Place 453 Amazon Location Service Developer Guide "Code": "LDN", "Name": "London" }, "Locality": "London", "District": "Waterloo", "PostalCode": "SE1 7", "Street": "County Hall, Westminster Bridge Road", "StreetComponents": [ { "BaseName": "County Hall, Westminster Bridge Road", "Language": "en-GB" } ] }, "Position": [ -0.11953, 51.50336 ], "Categories": [ { "Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Tourist Attraction", "Primary": true }, { "Id": "landmark-attraction", "Name": "Landmark-Attraction", "LocalizedName": "Landmark-Attraction", "Primary": false }, { "Id": "residential_area-building", "Name": "Residential Area-Building", "LocalizedName": "Residential Area/Building", "Primary": false } ], "TimeZone": { "Name": "Europe/London", "Offset": "+01:00", "OffsetSeconds": 3600 } Use Get Place 454 Amazon Location Service Developer Guide } cURL curl --request GET \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/place/ AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz-_FFnJnzJSQ7JePd- sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP? key=Your_Key&=TimeZone' AWS CLI export PLACEID=AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz- _FFnJnzJSQ7JePd-sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP aws geo-places get-place --key ${YourKey} \ --place-id ${PLACEID} \ --additional-features "TimeZone" How to get the details for PlaceId in a specific language The feature allows you to select a preferred response language from BCP47-compliant codes. It detects the query language based on name variants and uses the preferred language for unmatched tokens and ambiguous cases. If no requested language is stated, the Places API provides results in whatever language the country uses, but it prioritizes the regional language in regions where it differs. As a fallback, Places APIs return addresses in the default language when some address elements are unavailable in the requested language. Potential use cases • Add PlaceId details: Add additional detail in a specified language for a stored place ID. • Retrieve PlaceId details for addresses from Autocomplete: Get additional detail in a specific language for a stored PlaceId. Use Get Place 455 Amazon Location Service Examples Get details for a PlaceId in a specific language Sample request Developer
amazon-location-developer-guide-096
amazon-location-developer-guide.pdf
96
Places API provides results in whatever language the country uses, but it prioritizes the regional language in regions where it differs. As a fallback, Places APIs return addresses in the default language when some address elements are unavailable in the requested language. Potential use cases • Add PlaceId details: Add additional detail in a specified language for a stored place ID. • Retrieve PlaceId details for addresses from Autocomplete: Get additional detail in a specific language for a stored PlaceId. Use Get Place 455 Amazon Location Service Examples Get details for a PlaceId in a specific language Sample request Developer Guide https://places.geo.eu-central-1.amazonaws.com/v2/place/ AQAAAFUAY0R_4qfQ9LZ0j6lpOggbNLAQ31TRf- sESER_bKKjCar9FF6A3UA0HrYWa4yfeUN5V0qkk6NmdrI3y7fB7PZ4vfuo-Z8Wd- u-01an4KNvWaqfYmEh14s22yCV9Nb1yMXl4-HTfpX5D-jWQT14FEIBqoiuKwLq? language=EN&key=Your_Key Sample response { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Parking Area", "Address": { "Label": "Parking Area, Al Nahda Sharjah, United Arab Emirates", "Country": { "Code2": "AE", "Code3": "ARE", "Name": "United Arab Emirates" }, "SubRegion": { "Name": "Sharjah" }, "Locality": "Sharjah", "District": "Al Nahda" }, "Position": [ 55.3733, 25.30388 ], "Categories": [ { "Id": "parking_lot", "Name": "Parking Lot", "LocalizedName": "Parking Lot", "Primary": true } ], Use Get Place 456 Amazon Location Service Developer Guide "Contacts": { "Phones": [ { "Value": "+971507766189" } ] }, "AccessPoints": [ { "Position": [ 55.37348, 25.30398 ] } ] } cURL curl --request GET \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/place/ AQAAAFUAY0R_4qfQ9LZ0j6lpOggbNLAQ31TRf- sESER_bKKjCar9FF6A3UA0HrYWa4yfeUN5V0qkk6NmdrI3y7fB7PZ4vfuo-Z8Wd- u-01an4KNvWaqfYmEh14s22yCV9Nb1yMXl4-HTfpX5D-jWQT14FEIBqoiuKwLq? language=EN&key=Your_Key` AWS CLI export PLACEID=AQAAAFUAcrFHu947JATTY9gIGcfNlNVzD3UftkkI9ayJjtquaC7IquYz- _FFnJnzJSQ7JePd-sY0MSpA64V0w4aXLc- lB2fZLJKk6uoAMSgtwvwxzg1fvPxFM9zXsx77EaLXarl7F4gSPTyQ6fiEnj0b0ipOXpnOoIsP aws geo-places get-place --key ${YourKey} \ --place-id ${PLACEID} \ --language "en" How to use SearchNearby This section contains a variety of how to guides and examples for how to use SearchNearby. Examples Use SearchNearby 457 Amazon Location Service Developer Guide • How to search nearby from a position • How to search nearby places based on category • How to search nearby places based on food type • How to search nearby based on business chain • How to search nearby within a country • How to search nearby using geospatial context How to search nearby from a position The SearchNearby API enables querying for all nearby places and points of interest (POI) without entering any specific text. Users can explore neighborhoods, discover POIs, and more using this API. It requires a QueryPosition, which can represent a device's location, IP-based position, or the map viewport center. Alternatively, users can specify a city or place to bias results based on the geocoordinates of that location. Potential use cases • Explore nearby POIs: View all points of interest near the current position. • Explore nearby places: View all locations or places near a given position. Examples Search nearby from a position In this example, the search is conducted from a position in Dubai with latitude 25.26951 and longitude 55.30884. Sample request { "QueryPosition": [ 55.30884, 25.26951 ] } Use SearchNearby 458 Amazon Location Service Sample response { "ResultItems": [ { Developer Guide "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "###", "Address": { "Label": "####### ######## ,### #### ,##### ## ###### #### ,### ####### ", "Country": { "Code2": "AE", "Code3": "ARE", "Name": "####### ####### ######## " }, "SubRegion": { "Name": "###" }, "Locality": "###", "District": "####", "Street": "##### ## ###### #### ", "StreetComponents": [ { "BaseName": "##### ## ###### ", "Type": "####", "TypePlacement": "BeforeBaseName", "TypeSeparator": " ", "Language": "ar" } ] }, "Position": [ 55.30884, 25.26951 ], "Distance": 0, "Categories": [ { "Id": "department_store", "Name": "Department Store", "LocalizedName": "##### ### ", "Primary": true } Use SearchNearby 459 Developer Guide Amazon Location Service ], "BusinessChains": [ { "Name": "HEMA", "Id": "HEMA" } ] }, { "PlaceId": "<Redacted>", "PlaceType": "Locality", "Title": "####### ####### ######## ,### ", "Address": { "Label": "####### ####### ######## ,### ", "Country": { "Code2": "AE", "Code3": "ARE", "Name": "####### ####### ######## " }, "SubRegion": { "Name": "###" }, "Locality": "###" }, "Position": [ 55.30884, 25.26951 ], "Distance": 0, "MapView": [ 54.64906, 24.62308, 55.7371, 25.36995 ] } ] } cURL curl --request POST \ Use SearchNearby 460 Amazon Location Service Developer Guide --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-nearby? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ 55.30884, 25.26951 ], "MaxResults": 2 }' AWS CLI aws geo-places search-nearby --key ${YourKey} \ --query-position 55.30884 25.26951 \ --max-results 2 How to search nearby places based on category The SearchNearby API enables querying for points of interest (POI) with the inclusion or exclusion of specified categories. This can help users explore neighborhoods, discover local POIs, and more. The API requires a QueryPosition, which can be based on a device's location, IP position, or the center of the map viewport. Alternatively, users can specify a city or place, and the application will bias results based on that location’s coordinates. To learn more about supported categories, see the section called “Categories filters”. Potential use cases • Explore local facilities: Find available facilities within a neighborhood. • Discover tourist attractions: Identify tourist spots within a city. • Plan travel in a city: Organize travel around different POIs within a chosen city. Examples Include category Sample request { Use
amazon-location-developer-guide-097
amazon-location-developer-guide.pdf
97
and more. The API requires a QueryPosition, which can be based on a device's location, IP position, or the center of the map viewport. Alternatively, users can specify a city or place, and the application will bias results based on that location’s coordinates. To learn more about supported categories, see the section called “Categories filters”. Potential use cases • Explore local facilities: Find available facilities within a neighborhood. • Discover tourist attractions: Identify tourist spots within a city. • Plan travel in a city: Organize travel around different POIs within a chosen city. Examples Include category Sample request { Use SearchNearby 461 Amazon Location Service Developer Guide "QueryPosition": [ 4.35609, 50.84439 ], "Filter": { "IncludeCategories": ["airport"] } } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Brussels Airport", "Address": { "Label": "Brussels Airport, A201, 1930 Zaventem, België", "Country": { "Code2": "BE", "Code3": "BEL", "Name": "België" }, "Region": { "Code": "VLG", "Name": "Vlaanderen" }, "SubRegion": { "Name": "Vlaams Brabant" }, "Locality": "Zaventem", "PostalCode": "1930", "Street": "A201", "StreetComponents": [ { "BaseName": "A201", "Language": "nl" } ] }, "Position": [ 4.47767, Use SearchNearby 462 Amazon Location Service Developer Guide 50.89452 ], "Distance": 10191, "Categories": [ { "Id": "airport", "Name": "Airport", "LocalizedName": "Luchthaven", "Primary": true } ] }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Internationale Luchthaven Antwerpen", "Address": { "Label": "Internationale Luchthaven Antwerpen, Luchthavenlei 1, 2100 Antwerpen, België", "Country": { "Code2": "BE", "Code3": "BEL", "Name": "België" }, "Region": { "Code": "VLG", "Name": "Vlaanderen" }, "SubRegion": { "Name": "Antwerpen" }, "Locality": "Antwerpen", "District": "Deurne", "PostalCode": "2100", "Street": "Luchthavenlei", "StreetComponents": [ { "BaseName": "Luchthaven", "Type": "lei", "TypePlacement": "AfterBaseName", "TypeSeparator": "", "Language": "nl" } ], Use SearchNearby 463 Amazon Location Service Developer Guide "AddressNumber": "1" }, "Position": [ 4.45083, 51.18867 ], "Distance": 38852, "Categories": [ { "Id": "airport", "Name": "Airport", "LocalizedName": "Luchthaven", "Primary": true } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-nearby? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ 4.35609, 50.84439 ], "Filter": { "IncludeCategories": ["airport"] }, "MaxResults": 2 } AWS CLI aws geo-places search-nearby --key ${YourKey} \ --query-position 4.35609 50.84439 \ --filter '{"IncludeCategories": ["airport"]}' \ --max-results 2 Use SearchNearby 464 Developer Guide Amazon Location Service Exclude category Sample request { "QueryPosition": [ 4.35609, 50.84439 ], "Filter": { "ExcludeCategories": ["airport"] } } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Socialbrands Module 2", "Address": { "Label": "Socialbrands Module 2, Albertinaplein, 1000 Brussel, België", "Country": { "Code2": "BE", "Code3": "BEL", "Name": "België" }, "Region": { "Code": "BRU", "Name": "Brussel" }, "SubRegion": { "Name": "Brussel" }, "Locality": "Brussel", "District": "Koningswijk", "PostalCode": "1000", "Street": "Albertinaplein", "StreetComponents": [ { Use SearchNearby 465 Amazon Location Service Developer Guide "BaseName": "Albertina", "Type": "plein", "TypePlacement": "AfterBaseName", "TypeSeparator": "", "Language": "nl" } ] }, "Position": [ 4.35609, 50.84439 ], "Distance": 0, "Categories": [ { "Id": "commercial_services", "Name": "Commercial Services", "LocalizedName": "Commerciële diensten", "Primary": true } ], "Contacts": { "Websites": [ { "Value": "https://oneread.net" } ] }, "AccessPoints": [ { "Position": [ 4.35609, 50.84439 ] } ] }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Barman Privé", "Address": { "Label": "Barman Privé, Albertinaplein, 1000 Brussel, België", "Country": { Use SearchNearby 466 Amazon Location Service Developer Guide "Code2": "BE", "Code3": "BEL", "Name": "België" }, "Region": { "Code": "BRU", "Name": "Brussel" }, "SubRegion": { "Name": "Brussel" }, "Locality": "Brussel", "District": "Koningswijk", "PostalCode": "1000", "Street": "Albertinaplein", "StreetComponents": [ { "BaseName": "Albertina", "Type": "plein", "TypePlacement": "AfterBaseName", "TypeSeparator": "", "Language": "nl" } ] }, "Position": [ 4.35609, 50.84439 ], "Distance": 0, "Categories": [ { "Id": "catering_and_other_food_services", "Name": "Catering and Other Food Services", "LocalizedName": "Catering- en horecadiensten", "Primary": true } ], "Contacts": { "Phones": [ { "Value": "+32476891634" } ] Use SearchNearby 467 Amazon Location Service }, "OpeningHours": [ { "Display": [ "ma-zo: 00:00 - 24:00" ], "OpenNow": true, "Components": [ { Developer Guide "OpenTime": "T000000", "OpenDuration": "PT24H00M", "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA,SU" } ] } ], "AccessPoints": [ { "Position": [ 4.35609, 50.84439 ] } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-nearby? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ 4.35609, 50.84439 ], "Filter": { "ExcludeCategories": ["airport"] } } Use SearchNearby 468 Amazon Location Service AWS CLI Developer Guide aws geo-places search-nearby --key ${YourKey} \ --query-position 4.35609 50.84439 \ --filter '{"ExcludeCategories": ["airport"]}' \ --max-results 2 How to search nearby places based on food type The SearchNearby API enables you query nearby restaurants that serve a specific type of food. You can also exclude food types from your results. You can use the SearchNearby API to let end users explore neighborhoods and discover places of interest. The API requires QueryPosition, which can be a device position, IP position, or a map‘s view port center. Another way is to let end users provide the city name or place name and the application can bias results based on the geo-coordinates. For more information on food types, see Food Type
amazon-location-developer-guide-098
amazon-location-developer-guide.pdf
98
to search nearby places based on food type The SearchNearby API enables you query nearby restaurants that serve a specific type of food. You can also exclude food types from your results. You can use the SearchNearby API to let end users explore neighborhoods and discover places of interest. The API requires QueryPosition, which can be a device position, IP position, or a map‘s view port center. Another way is to let end users provide the city name or place name and the application can bias results based on the geo-coordinates. For more information on food types, see Food Type filters. Potential use cases • Explore types of food available in the vicinity. • Exclude restaurant options that serve food types to which you're allergic. Example Search nearby places by food type The following example demonstrates how to search for nearby places based on food type. Sample request This request searches for restaurants that serve Chinese food near the specified coordinates. { "QueryPosition": [ 12.49563, 41.90325 ], "Filter": { Use SearchNearby 469 Amazon Location Service Developer Guide "IncludeFoodTypes": ["chinese"] } } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Bufala e Pachino", "Address": { "Label": "Bufala e Pachino, Via Firenze, 53, 00184 Roma RM, Italia", "Country": { "Code2": "IT", "Code3": "ITA", "Name": "Italia" } }, "Position": [ 12.49409, 41.90237 ], "Distance": 161, "Categories": [ { "Id": "restaurant", "Name": "Restaurant", "LocalizedName": "Ristorante", "Primary": true } ], "FoodTypes": [ { "LocalizedName": "Pizza", "Id": "pizza", "Primary": true }, { "LocalizedName": "Cinese", "Id": "chinese", "Primary": false Use SearchNearby 470 Amazon Location Service } ] } ] } cURL Developer Guide curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-nearby? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [12.49563, 41.90325], "Filter": { "IncludeFoodTypes": ["chinese"] } }' AWS CLI aws geo-places search-nearby --key ${YourKey} \ --query-position 12.49563 41.90325 \ --filter '{"IncludeFoodTypes": ["chinese"]}' Developer Tips • You can use ExludeFoodTypes to exclude certain business chains from your results. • You can exclude or include multiple food types. How to search nearby based on business chain The SearchNearby API enables you to query nearby business chains. You can include or exclude specific business chains in your search. This feature allows end users to explore neighborhoods, discover points of interest, and more. To use the SearchNearby API, you need to provide a QueryPosition, which can be: • A device position • An IP-based position Use SearchNearby 471 Amazon Location Service • A map's viewport center Developer Guide Alternatively, users can provide a city name or place, and the application can bias results based on the geo-coordinates of that location. For more information about supported business chains, see Business Chains filter. Potential use cases • Explore businesses in the vicinity • Expand your business by finding nearby B2B customers Examples Search nearby places by business chain The following example demonstrates how to search for nearby Starbucks locations. Sample request This request searches for Starbucks locations near the specified coordinates. { "QueryPosition": [ 12.49563, 41.90325 ], "Filter" : { "IncludeBusinessChains": ["Starbucks"] } } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Starbucks", "Address": { Use SearchNearby 472 Amazon Location Service Developer Guide "Label": "Starbucks, Via Giovanni Giolitti, 2, 00185 Roma RM, Italia", "Country": { "Code2": "IT", "Code3": "ITA", "Name": "Italia" }, "Region": { "Name": "Lazio" }, "SubRegion": { "Code": "RM", "Name": "Roma" }, "Locality": "Roma", "District": "Esquilino", "PostalCode": "00185", "Street": "Via Giovanni Giolitti", "StreetComponents": [ { "BaseName": "Giovanni Giolitti", "Type": "Via", "TypePlacement": "BeforeBaseName", "TypeSeparator": " ", "Language": "it" } ], "AddressNumber": "2" }, "Position": [ 12.50102, 41.90093 ], "Distance": 515, "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Bar", "Primary": true } ], "BusinessChains": [ { Use SearchNearby 473 Amazon Location Service Developer Guide "Name": "Starbucks", "Id": "Starbucks" } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-nearby? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ 12.49563, 41.90325 ], "Filter" : { "IncludeBusinessChains": ["Starbucks"] } }' AWS CLI aws geo-places search-nearby --key ${YourKey} \ --query-position 12.49563 41.90325 \ --filter '{"IncludeBusinessChains": ["Starbucks"]}' Developer Tips • You can use ExcludeBusinessChains to exclude certain business chains from your results. • You can exclude or include multiple business chains. How to search nearby within a country The SearchNearby API enables you to search for nearby places within a specific country. To use the API, you need to provide a QueryPosition, which can be: Use SearchNearby 474 Amazon Location Service • A device position • An IP-based position • A map's viewport center Developer Guide Alternatively, users can provide a city name or place, and the application can bias results based on the geocoordinates of that location. Potential use cases • Explore businesses within a country • Find nearby B2B customers within a country • Explore tourist places within a country Examples Search for golf courses in
amazon-location-developer-guide-099
amazon-location-developer-guide.pdf
99
The SearchNearby API enables you to search for nearby places within a specific country. To use the API, you need to provide a QueryPosition, which can be: Use SearchNearby 474 Amazon Location Service • A device position • An IP-based position • A map's viewport center Developer Guide Alternatively, users can provide a city name or place, and the application can bias results based on the geocoordinates of that location. Potential use cases • Explore businesses within a country • Find nearby B2B customers within a country • Explore tourist places within a country Examples Search for golf courses in Canada The following example demonstrates how to search for golf courses within Canada near specified coordinates. Sample request This request searches for golf courses in Canada near the specified location. { "QueryPosition": [ -122.741803, 49.002478 ], "Filter" : { "IncludeCategories": ["golf_course"], "IncludeCountries": ["CAN"] } } Sample response { "ResultItems": [ { Use SearchNearby 475 Amazon Location Service Developer Guide "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Peace Portal Golf Course", "Address": { "Label": "Peace Portal Golf Course, 16900 * Ave, Surrey, BC V*Z *P*, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Surrey", "District": "South Surrey", "PostalCode": "V*Z *P*", "Street": "* Ave", "StreetComponents": [ { "BaseName": "4", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "16900" }, "Position": [ -122.75086, 49.00921 ], "Distance": 998, "Categories": [ { "Id": "golf_course", "Name": "Golf Course", "LocalizedName": "Golf Course", "Primary": true Use SearchNearby 476 Amazon Location Service Developer Guide } ], "Contacts": { "Phones": [ { "Value": "+16045384818" } ], "Websites": [ { "Value": "http://www.peaceportalgolf.com" } ] }, "AccessPoints": [ { "Position": [ -122.75087, 49.00935 ] } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-nearby? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ -122.741803, 49.002478 ], "Filter" : { "IncludeCategories": ["golf_course"], "IncludeCountries": ["CAN"] } }' Use SearchNearby 477 Amazon Location Service AWS CLI Developer Guide aws geo-places search-nearby --key ${YourKey} \ --query-position -122.741803 49.002478 \ --filter '{"IncludeCategories": ["golf_course"], "IncludeCountries": ["CAN"]}' How to search nearby using geospatial context The SearchNearby API enables you to explore nearby, while restricting results within geospatial context (such as a circle or bounding box). The SearchNearby API lets you filter results using geospatial contexts such as circles and bounding boxes. By defining these geographic boundaries, you can limit search results to specific areas. Potential use cases • Limit search results to a specific geographic area • Search within custom-defined boundaries • Focus results on targeted neighborhoods or districts Examples Search using query radius The following example demonstrates how to search for schools within a 1000-meter radius of the specified coordinates. Sample request This request searches for schools within a 1000-meter (1-kilometer) radius. { "QueryPosition": [ -122.741803, 49.002478 ], "QueryRadius":1000, "Filter" : { "IncludeCategories": ["school"] } Use SearchNearby 478 Amazon Location Service Developer Guide } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Grace Lutheran Church", "Address": { "Label": "Grace Lutheran Church, 702 G St, Blaine, WA 98230-5125, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Whatcom" }, "Locality": "Blaine", "PostalCode": "98230-5125", "Street": "G St", "StreetComponents": [ { "BaseName": "G", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "702" }, "Position": [ -122.74157, 48.99533 Use SearchNearby 479 Amazon Location Service Developer Guide ], "Distance": 795, "Categories": [ { "Id": "church", "Name": "Church", "LocalizedName": "Church", "Primary": true }, { "Id": "kindergarten_and_childcare", "Name": "Kindergarten and Childcare", "LocalizedName": "Kindergarten & Childcare", "Primary": false }, { "Id": "school", "Name": "School", "LocalizedName": "School", "Primary": false } ] } ... ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/searearch-nearby? key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ -122.741803, 49.002478 ], "QueryRadius": 1000, "Filter": { "IncludeCategories": ["school"] } }' Use SearchNearby 480 Amazon Location Service AWS CLI Developer Guide aws geo-places search-nearby --key ${YourKey} \ --query-position -122.741803 49.002478 \ --query-radius 1000 \ --filter '{"IncludeCategories": ["school"]}' Developer Tips • Alternatively, you can use a bounding box filter. How to use SearchText This section contains a variety of how to guides and examples for how to use SearchText APIs. Examples • How to search for a place, POI, or business using a name • How to search for a place using contact information • How to search using category name or food type • How to search for an address • How to search for a place within a country • How to search for contact and opening hours • How to search places using query ID • How to search in a specific language How to search for a place, POI, or business using a name The SearchText API allows users to
amazon-location-developer-guide-100
amazon-location-developer-guide.pdf
100
for how to use SearchText APIs. Examples • How to search for a place, POI, or business using a name • How to search for a place using contact information • How to search using category name or food type • How to search for an address • How to search for a place within a country • How to search for contact and opening hours • How to search places using query ID • How to search in a specific language How to search for a place, POI, or business using a name The SearchText API allows users to search for a place, POI, or business by name, using free text input. Results can be refined by setting a bias position, which may be based on device location, IP position, or map viewport center. Alternatively, users can provide a specific city or place, with results biased based on the provided geocoordinates. Potential use cases • Locate a place by name: Retrieve locations based on place names, such as "Gas Town". Use SearchText 481 Amazon Location Service Developer Guide • Find points of interest (POIs): Search for places of interest by name, such as "Stanley Park". • Search by business name: Locate businesses by name, like "Starbucks". Examples Search by place name Sample request { "QueryText": "Gas Town", "BiasPosition": [ -123.11336, 49.26038 ] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "District", "Title": "Gastown, Vancouver, BC, Canada", "Address": { "Label": "Gastown, Vancouver, BC, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Gastown", "PostalCode": "V6B" Use SearchText 482 Amazon Location Service Developer Guide }, "Position": [ -123.10647, 49.28363 ], "Distance": 2633, "MapView": [ -123.11193, 49.28141, -123.10217, 49.28648 ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Gas Town", "BiasPosition": [ -123.11336, 49.26038 ] }' AWS CLI aws geo-places search-text --key ${YourKey} --query-text "Gas Town" --bias-position -123.11336 49.26038 Search by POI name Sample request { "QueryText": "Stanley Park", "BiasPosition": [ Use SearchText 483 Amazon Location Service Developer Guide -123.11336, 49.26038 ] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Stanley Park", "Address": { "Label": "Stanley Park, Stanley Park Dr, Vancouver, BC V6G, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Stanley Park", "PostalCode": "V6G", "Street": "Stanley Park Dr", "StreetComponents": [ { "BaseName": "Stanley Park", "Type": "Dr", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ] }, "Position": [ -123.13593, Use SearchText 484 Amazon Location Service Developer Guide 49.29716 ], "Distance": 4405, "Categories": [ { "Id": "park-recreation_area", "Name": "Park-Recreation Area", "LocalizedName": "Park-Recreation Area", "Primary": true }, { "Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Tourist Attraction", "Primary": false } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Stanley Park", "BiasPosition": [ -123.11336, 49.26038 ] }' AWS CLI aws geo-places search-text --key ${YourKey} --query-text "Stanley Park" --bias- position -123.11336 49.26038 Use SearchText 485 Developer Guide Amazon Location Service Search by business name Sample request { "QueryText": "Amazon YVR11", "BiasPosition": [ -123.11336, 49.26038 ] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Amazon YVR11", "Address": { "Label": "Amazon YVR11, 510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Downtown Vancouver", "PostalCode": "V6B 0M3", "Street": "W Georgia St", "StreetComponents": [ { "BaseName": "Georgia", "Type": "St", Use SearchText 486 Amazon Location Service Developer Guide "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "510" }, "Position": [ -123.11694, 49.28126 ], "Distance": 2336, "Categories": [ { "Id": "business_facility", "Name": "Business Facility", "LocalizedName": "Business Facility", "Primary": true } ], "AccessPoints": [ { "Position": [ -123.11656, 49.28151 ] } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Amazon YVR11", "BiasPosition": [ -123.11336, Use SearchText 487 Amazon Location Service 49.26038 ] }' AWS CLI Developer Guide aws geo-places search-text --key ${YourKey} --query-text "Amazon YVR11" --bias- position -123.11336 49.26038 How to search for a place using contact information The SearchText API allows users to search for a place using a phone number, supporting both international and local formats. Users can bias results by setting a position based on device location, IP address, or map viewport center, or by specifying a city or place to refine results based on geocoordinates. Potential use cases • Locate a place with a phone number: Find a POI by using its contact number to retrieve its address. Examples Search
amazon-location-developer-guide-101
amazon-location-developer-guide.pdf
101
CLI Developer Guide aws geo-places search-text --key ${YourKey} --query-text "Amazon YVR11" --bias- position -123.11336 49.26038 How to search for a place using contact information The SearchText API allows users to search for a place using a phone number, supporting both international and local formats. Users can bias results by setting a position based on device location, IP address, or map viewport center, or by specifying a city or place to refine results based on geocoordinates. Potential use cases • Locate a place with a phone number: Find a POI by using its contact number to retrieve its address. Examples Search using phone number In this example, the Vancouver Aquarium is searched using its phone number "+1 778-655-9554" from a bias position in Vancouver, BC. Sample request { "QueryText": "+1 778-655-9554", "BiasPosition": [ -123.11336, 49.26038 ] } Use SearchText 488 Amazon Location Service Sample response { "ResultItems": [ { Developer Guide "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Vancouver Aquarium", "Address": { "Label": "Vancouver Aquarium, 834 Avison Way, Vancouver, BC V6G, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Stanley Park", "PostalCode": "V6G", "Street": "Avison Way", "StreetComponents": [ { "BaseName": "Avison", "Type": "Way", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "834" }, "Position": [ -123.13049, 49.30013 ], "Distance": 4591, "Categories": [ Use SearchText 489 Amazon Location Service { Developer Guide "Id": "aquarium", "Name": "Aquarium", "LocalizedName": "Aquarium", "Primary": true }, { "Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Tourist Attraction", "Primary": false } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "+1 778-655-9554", "BiasPosition": [ -123.11336, 49.26038 ] }' AWS CLI aws geo-places search-text --key ${YourKey} --query-text "+1 778-655-9554" --bias- position -123.11336 49.26038 How to search using category name or food type The SearchText API enables you to search by name of category such as restaurants, schools and more. You can also search by food type. Use SearchText 490 Amazon Location Service Developer Guide One way to use the SearchText API is to let end users search by name (category and food type) and an application set's bias position. These bias positions can be a device position, IP position, or a map‘s view port center. Additionally, end users can provide the city name or place and the application can bias results based on geo-coordinates. For more information, see Categories filters and Food Type filters. Potential use cases • Search for specific POI or place as a part of exploring a neighborhood. • Search for specific tourist spot for travel planning. • Search for restaurants that serve a specific food. Examples Search on a category Sample request { "QueryText": "Nursing Home", "BiasPosition": [ -123.11336, 49.26038 ], } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Diamond Geriatrics Inc", "Address": { "Label": "Diamond Geriatrics Inc, 288 W 8th Ave, Vancouver, BC V5Y 1N5, Canada", "Country": { "Code2": "CA", "Code3": "CAN", Use SearchText 491 Amazon Location Service Developer Guide "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Mt Pleasant", "PostalCode": "V5Y 1N5", "Street": "W 8th Ave", "StreetComponents": [ { "BaseName": "8th", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "288" }, "Position": [ -123.11061, 49.2636 ], "Distance": 410, "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home", "LocalizedName": "Nursing Home", "Primary": true }, { "Id": "social_service", "Name": "Social Service", "LocalizedName": "Social Services", "Primary": false } ] Use SearchText 492 Amazon Location Service }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Para Med Home Health Care", "Address": { Developer Guide "Label": "Para Med Home Health Care, 601 W Broadway, Vancouver, BC V5Z 4C2, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Fairview", "PostalCode": "V5Z 4C2", "Street": "W Broadway", "StreetComponents": [ { "BaseName": "Broadway", "Prefix": "W", "Language": "en" } ], "AddressNumber": "601" }, "Position": [ -123.11772, 49.26343 ], "Distance": 464, "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home", "LocalizedName": "Nursing Home", "Primary": true Use SearchText 493 Amazon Location Service }, Developer Guide { "Id": "hospital_or_health_care_facility", "Name": "Hospital or Health Care Facility", "LocalizedName": "Hospital or Health Care Facility", "Primary": false } ] } ... ... ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Nursing Home", "BiasPosition": [ -123.11336, 49.26038 ] }' AWS CLI aws geo-places search-text --key ${YourKey} --query-text "Nursing Home" --bias- position -123.11336 49.26038 Search on a food type Specify a food type for QueryText to select restaurants by food type. Filtering by food type enables restaurants to be indexed, queried, and displayed by food type. Sample request { Use
amazon-location-developer-guide-102
amazon-location-developer-guide.pdf
102
}, Developer Guide { "Id": "hospital_or_health_care_facility", "Name": "Hospital or Health Care Facility", "LocalizedName": "Hospital or Health Care Facility", "Primary": false } ] } ... ... ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Nursing Home", "BiasPosition": [ -123.11336, 49.26038 ] }' AWS CLI aws geo-places search-text --key ${YourKey} --query-text "Nursing Home" --bias- position -123.11336 49.26038 Search on a food type Specify a food type for QueryText to select restaurants by food type. Filtering by food type enables restaurants to be indexed, queried, and displayed by food type. Sample request { Use SearchText 494 Amazon Location Service Developer Guide "QueryText": "Sushi", "BiasPosition": [ -123.11336, 49.26038 ] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Sushi Tomy", "Address": { "Label": "Sushi Tomy, 555 W 12th Ave, Vancouver, BC V5Z 3X7, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Fairview", "PostalCode": "V5Z 3X7", "Street": "W 12th Ave", "StreetComponents": [ { "BaseName": "12th", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } Use SearchText 495 Amazon Location Service Developer Guide ], "AddressNumber": "555" }, "Position": [ -123.11629, 49.26086 ], "Distance": 219, "Categories": [ { "Id": "deli", "Name": "Deli", "LocalizedName": "Deli", "Primary": true }, { "Id": "restaurant", "Name": "Restaurant", "LocalizedName": "Restaurant", "Primary": false }, { "Id": "casual_dining", "Name": "Casual Dining", "LocalizedName": "Casual Dining", "Primary": false } ], "FoodTypes": [ { "LocalizedName": "Japanese - Sushi", "Id": "japanese-sushi", "Primary": true }, { "LocalizedName": "Canadian", "Id": "canadian", "Primary": false }, { "LocalizedName": "Japanese", "Id": "japanese", "Primary": false } Use SearchText 496 Amazon Location Service ] }, { Developer Guide "PlaceId": "<Redacted>" "PlaceType": "PointOfInterest", "Title": "Shiro Japanese Restaurant", "Address": { "Label": "Shiro Japanese Restaurant, 3096 Cambie St, Vancouver, BC V5Z 2V9, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Mt Pleasant", "PostalCode": "V5Z 2V9", "Street": "Cambie St", "StreetComponents": [ { "BaseName": "Cambie", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "3096" }, "Position": [ -123.11461, 49.25797 ], "Distance": 283, "Categories": [ { "Id": "casual_dining", Use SearchText 497 Amazon Location Service Developer Guide "Name": "Casual Dining", "LocalizedName": "Casual Dining", "Primary": true }, { "Id": "restaurant", "Name": "Restaurant", "LocalizedName": "Restaurant", "Primary": false } ], "FoodTypes": [ { "LocalizedName": "Japanese - Sushi", "Id": "japanese-sushi", "Primary": true }, { "LocalizedName": "Asian", "Id": "asian", "Primary": false }, { "LocalizedName": "Japanese", "Id": "japanese", "Primary": false } ] }, ... ... ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Sushi", "BiasPosition": [ Use SearchText 498 Amazon Location Service Developer Guide -123.11336, 49.26038 ] }' AWS CLI aws geo-places search-text --key ${YourKey} --query-text "Sushi" --bias-position -123.11336 49.26038 How to search for an address The SearchText API enables you to search for an address. One way to use the SearchText API is to let end users search for an address and an application set's bias position. These bias positions can be a device position, IP position, or a map‘s view port center. Additionally, end users can provide the city name or place and the application can bias results based on geo-coordinates. Potential use cases • Search for an address based on a bias position. • Filter results to include or remove specific addresses. Examples Search for an address Sample request { "QueryText":"1368 E 8 Ave Vancouver", "BiasPosition":[ -123.18544, 49.24643 ], "MaxResults":1 } Use SearchText 499 Developer Guide Amazon Location Service Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "1368 E 8th Ave, Vancouver, BC V5N 1T2, Canada", "Address": { "Label": "1368 E 8th Ave, Vancouver, BC V5N 1T2, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Grandview-Woodland", "PostalCode": "V5N 1T2", "Street": "E 8th Ave", "StreetComponents": [ { "BaseName": "8th", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "E", "Language": "en" } ], "AddressNumber": "1368" }, "Position": [ -123.07612, 49.26306 ], "Distance": 8147, "MapView": [ Use SearchText 500 Amazon Location Service Developer Guide -123.07752, 49.26299, -123.05661, 49.26334 ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "1368 E 8 Ave Vancouver", "BiasPosition": [ -123.18544, 49.24643 ], "MaxResults": 1 }' AWS CLI aws geo-places search-text --key ${YourKey} --query-text "1368 E 8 Ave Vancouver" -- bias-position -123.18544 49.24643 --max-results 1 How to search for a place within a country The SearchText API enables you limit search results to within one or more countries. This feature useful for searching in border areas or smaller countries that neighbour each other. One way to use
amazon-location-developer-guide-103
amazon-location-developer-guide.pdf
103
Service Developer Guide -123.07752, 49.26299, -123.05661, 49.26334 ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "1368 E 8 Ave Vancouver", "BiasPosition": [ -123.18544, 49.24643 ], "MaxResults": 1 }' AWS CLI aws geo-places search-text --key ${YourKey} --query-text "1368 E 8 Ave Vancouver" -- bias-position -123.18544 49.24643 --max-results 1 How to search for a place within a country The SearchText API enables you limit search results to within one or more countries. This feature useful for searching in border areas or smaller countries that neighbour each other. One way to use the SearchText API is to let end users do a free-text search and an application set's bias position. These bias positions can be a device position, IP position, or a map‘s view port center. Additionally, end users can provide the city name or place and the application can bias results based on geo-coordinates. Use SearchText 501 Amazon Location Service Potential use cases Developer Guide • Limit the search results to within a country for an area that has a nearby international border. • Filter results to withing multiple countries. Examples Search within a country In this example, the bias position is near the USA and Canada border. Without specifying IncludeCountries": ["CAN"], the API would return results from both Canada and the USA. Sample request { "QueryText": "Starbucks", "BiasPosition": [ -122.741803, 49.002478 ] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 16010 24 Ave, Surrey, BC V3Z 0R5, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { Use SearchText 502 Amazon Location Service Developer Guide "Name": "Metro Vancouver" }, "Locality": "Surrey", "District": "South Surrey", "PostalCode": "V3Z 0R5", "Street": "24 Ave", "StreetComponents": [ { "BaseName": "24", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "16010" }, "Position": [ -122.77867, 49.04482 ], "Distance": 5422, "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ] }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "STARBUCKS", "Address": { "Label": "STARBUCKS, 1730 152 St, Surrey, BC V4A 4N4, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", Use SearchText 503 Amazon Location Service Developer Guide "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Surrey", "District": "South Surrey", "PostalCode": "V4A 4N4", "Street": "152 St", "StreetComponents": [ { "BaseName": "152", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "1730" }, "Position": [ -122.80096, 49.03341 ], "Distance": 5517, "Categories": [ { "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": true } ], "BusinessChains": [ { "Name": "Starbucks", "Id": "Starbucks" } ] }, ... ... ] Use SearchText 504 Amazon Location Service Developer Guide } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Starbucks", "BiasPosition": [ -122.741803, 49.002478 ] }' AWS CLI aws geo-places search-text --key ${YourKey} --query-text "Starbucks" --bias-position -122.741803 49.002478 How to search for contact and opening hours The SearchText API enables you to search for contacts and opening hours of a POI (Point of Interest). One way to use the SearchText API is to get the contact information for a location (phone number, website, email) and opening hours by searching with business name and bias position. These bias positions can be a device position, IP position, map‘s view port center. Another way is to let end users provide the city name or place name and the application can bias results based on the geo- coordinates. For more information, see Contacts and opening hours. Potential use cases You can use the SearchText API to filter on contacts and opening hours. Use SearchText 505 Developer Guide Amazon Location Service Examples Search by category name Sample request { "QueryText": "Nursing Home", "BiasPosition": [ -123.11336, 49.26038 ], "AdditionalFeatures":["Contact"] } Sample response { "PricingBucket": "Advanced", "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Para Med Home Health Care", "Address": { "Label": "Para Med Home Health Care, 601 W Broadway, Vancouver, BC V5Z 4C2, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Fairview", "PostalCode": "V5Z 4C2", Use SearchText 506 Amazon Location Service Developer Guide "Street": "W Broadway", "StreetComponents": [ { "BaseName": "Broadway", "Prefix": "W", "Language": "en" } ], "AddressNumber": "601" }, "Position": [ -123.11771, 49.26341 ], "Distance": 462, "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home", "LocalizedName": "Nursing Home", "Primary": true }, { "Id": "hospital_or_health_care_facility", "Name": "Hospital or Health Care Facility", "LocalizedName": "Hospital or Health Care Facility", "Primary": false } ], "Contacts": { "Phones": [ { "Value": "+16045634663" }, { "Value": "+16047311594", "Categories": [ { "Id": "hospital_or_health_care_facility", "Name": "Hospital or Health Care Facility" } ] } ],
amazon-location-developer-guide-104
amazon-location-developer-guide.pdf
104
Vancouver" }, "Locality": "Vancouver", "District": "Fairview", "PostalCode": "V5Z 4C2", Use SearchText 506 Amazon Location Service Developer Guide "Street": "W Broadway", "StreetComponents": [ { "BaseName": "Broadway", "Prefix": "W", "Language": "en" } ], "AddressNumber": "601" }, "Position": [ -123.11771, 49.26341 ], "Distance": 462, "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home", "LocalizedName": "Nursing Home", "Primary": true }, { "Id": "hospital_or_health_care_facility", "Name": "Hospital or Health Care Facility", "LocalizedName": "Hospital or Health Care Facility", "Primary": false } ], "Contacts": { "Phones": [ { "Value": "+16045634663" }, { "Value": "+16047311594", "Categories": [ { "Id": "hospital_or_health_care_facility", "Name": "Hospital or Health Care Facility" } ] } ], Use SearchText 507 Amazon Location Service Developer Guide "Websites": [ { "Value": "http://www.rightathomecanada.com/vancouver", "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home" } ] }, { "Value": "https://www.facebook.com/507123162974954", "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home" } ] } ] } }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Yaletown House", "Address": { "Label": "Yaletown House, 1099 Cambie St, Vancouver, BC V6B 5A8, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Yaletown", "PostalCode": "V6B 5A8", Use SearchText 508 Amazon Location Service Developer Guide "Street": "Cambie St", "StreetComponents": [ { "BaseName": "Cambie", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "1099" }, "Position": [ -123.11949, 49.27533 ], "Distance": 1721, "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home", "LocalizedName": "Nursing Home", "Primary": true }, { "Id": "restaurant", "Name": "Restaurant", "LocalizedName": "Restaurant", "Primary": false }, { "Id": "clothing_and_accessories", "Name": "Clothing and Accessories", "LocalizedName": "Clothing & Accessories", "Primary": false }, { "Id": "market", "Name": "Market", "LocalizedName": "Market", "Primary": false }, { "Id": "jeweler", Use SearchText 509 Amazon Location Service Developer Guide "Name": "Jeweler", "LocalizedName": "Jeweler", "Primary": false }, { "Id": "advertising-marketing,_pr_and_market_research", "Name": "Advertising-Marketing, PR and Market Research", "LocalizedName": "Advertising/Marketing, PR & Market Research", "Primary": false }, { "Id": "management_and_consulting_services", "Name": "Management and Consulting Services", "LocalizedName": "Management and Consulting Services", "Primary": false }, { "Id": "organizations_and_societies", "Name": "Organizations and Societies", "LocalizedName": "Organizations and Societies", "Primary": false }, { "Id": "finance_and_insurance", "Name": "Finance and Insurance", "LocalizedName": "Finance and Insurance", "Primary": false }, { "Id": "consumer_services", "Name": "Consumer Services", "LocalizedName": "Consumer Services", "Primary": false }, { "Id": "attorney", "Name": "Attorney", "LocalizedName": "Attorney", "Primary": false }, { "Id": "social_service", "Name": "Social Service", "LocalizedName": "Social Services", Use SearchText 510 Amazon Location Service Developer Guide "Primary": false } ], "Contacts": { "Phones": [ { "Value": "+16045584546", "Categories": [ { "Id": "management_and_consulting_services", "Name": "Management and Consulting Services" }, { "Id": "consumer_services", "Name": "Consumer Services" } ] }, { "Value": "+16046464065", "Categories": [ { "Id": "finance_and_insurance", "Name": "Finance and Insurance" } ] }, { "Value": "+16046699800", "Categories": [ { "Id": "clothing_and_accessories", "Name": "Clothing and Accessories" }, { "Id": "jeweler", "Name": "Jeweler" } ] }, { "Value": "+16046838109", "Categories": [ { Use SearchText 511 Amazon Location Service Developer Guide "Id": "attorney", "Name": "Attorney" } ] }, { "Value": "+16046841838", "Categories": [ { "Id": "advertising- marketing,_pr_and_market_research", "Name": "Advertising-Marketing, PR and Market Research" }, { "Id": "management_and_consulting_services", "Name": "Management and Consulting Services" } ] }, { "Value": "+16046848898", "Categories": [ { "Id": "attorney", "Name": "Attorney" } ] }, { "Value": "+16046890022" }, { "Value": "+16046999120", "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home" } ] }, { "Value": "+16046999121", "Categories": [ Use SearchText 512 Amazon Location Service Developer Guide { "Id": "nursing_home", "Name": "Nursing Home" } ] }, { "Value": "+16048016446", "Categories": [ { "Id": "management_and_consulting_services", "Name": "Management and Consulting Services" } ] } ], "Faxes": [ { "Value": "+16046464068", "Categories": [ { "Id": "finance_and_insurance", "Name": "Finance and Insurance" } ] }, { "Value": "+16046627954", "Categories": [ { "Id": "organizations_and_societies", "Name": "Organizations and Societies" } ] }, { "Value": "+16046841801", "Categories": [ { "Id": "advertising- marketing,_pr_and_market_research", "Name": "Advertising-Marketing, PR and Market Research" } Use SearchText 513 Amazon Location Service Developer Guide ] }, { "Value": "+16046848608", "Categories": [ { "Id": "attorney", "Name": "Attorney" } ] } ], "Websites": [ { "Value": "http://www.yaletown.org", "Categories": [ { "Id": "organizations_and_societies", "Name": "Organizations and Societies" }, { "Id": "social_service", "Name": "Social Service" }, { "Id": "nursing_home", "Name": "Nursing Home" } ] }, { "Value": "http://www.yaletownhq.com", "Categories": [ { "Id": "advertising- marketing,_pr_and_market_research", "Name": "Advertising-Marketing, PR and Market Research" } ] }, { "Value": "http://www.yaletownlaw.ca", "Categories": [ Use SearchText 514 Amazon Location Service Developer Guide { "Id": "attorney", "Name": "Attorney" } ] }, { "Value": "https://www.facebook.com/1509112252725564", "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home" } ] } ], "Emails": [ { "Value": "nina@yaletownhq.com", "Categories": [ { "Id": "advertising- marketing,_pr_and_market_research", "Name": "Advertising-Marketing, PR and Market Research" } ] } ] }, "OpeningHours": [ { "Display": [ "Mon-Fri: 08:30 - 16:00" ], "OpenNow": true, "Components": [ { "OpenTime": "T083000", "OpenDuration": "PT07H30M", "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR" } ], "Categories": [ Use SearchText 515 Amazon Location Service Developer Guide { "Id": "organizations_and_societies", "Name": "Organizations and Societies"
amazon-location-developer-guide-105
amazon-location-developer-guide.pdf
105
] }, { "Value": "http://www.yaletownlaw.ca", "Categories": [ Use SearchText 514 Amazon Location Service Developer Guide { "Id": "attorney", "Name": "Attorney" } ] }, { "Value": "https://www.facebook.com/1509112252725564", "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home" } ] } ], "Emails": [ { "Value": "nina@yaletownhq.com", "Categories": [ { "Id": "advertising- marketing,_pr_and_market_research", "Name": "Advertising-Marketing, PR and Market Research" } ] } ] }, "OpeningHours": [ { "Display": [ "Mon-Fri: 08:30 - 16:00" ], "OpenNow": true, "Components": [ { "OpenTime": "T083000", "OpenDuration": "PT07H30M", "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR" } ], "Categories": [ Use SearchText 515 Amazon Location Service Developer Guide { "Id": "organizations_and_societies", "Name": "Organizations and Societies" } ] }, { "Display": [ "Mon-Fri: 09:00 - 17:00" ], "OpenNow": true, "Components": [ { "OpenTime": "T090000", "OpenDuration": "PT08H00M", "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR" } ], "Categories": [ { "Id": "attorney", "Name": "Attorney" } ] }, { "Display": [ "Tue: 10:00 - 16:30", "Wed-Sat: 09:30 - 16:30" ], "OpenNow": true, "Components": [ { "OpenTime": "T100000", "OpenDuration": "PT06H30M", "Recurrence": "FREQ:DAILY;BYDAY:TU" }, { "OpenTime": "T093000", "OpenDuration": "PT07H00M", "Recurrence": "FREQ:DAILY;BYDAY:WE,TH,FR,SA" } ], "Categories": [ Use SearchText 516 Amazon Location Service Developer Guide { "Id": "clothing_and_accessories", "Name": "Clothing and Accessories" }, { "Id": "jeweler", "Name": "Jeweler" } ] } ] }, ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Nursing Home", "BiasPosition": [ -123.11336, 49.26038 ], "AdditionalFeatures":["Contact"] }' AWS CLI aws geo-places search-text --key ${YourKey} --query-text "Nursing Home" \ --bias-position -123.11336 49.26038 \ --additional-features "Contact" How to search places using query ID The SearchText API enables you get details of the query result returned by Suggest. Use SearchText 517 Amazon Location Service Potential use cases Developer Guide Get search results for Query ID, which are returned by the Suggestion API. Examples Search by query ID Sample request { "QueryId": "<Redacted>" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Restore", "Address": { "Label": "Restore, 400 Urban Plz, Kirkland, WA 98033, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "King" }, "Locality": "Kirkland", "District": "Moss Bay", "PostalCode": "98033", "Street": "Urban Plz", "StreetComponents": [ { "BaseName": "Urban", Use SearchText 518 Amazon Location Service Developer Guide "Type": "Plz", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "400" }, "Position": [ -122.19958, 47.67822 ], "Distance": 190670, "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services", "LocalizedName": "Wellness Center & Services", "Primary": true } ], "BusinessChains": [ { "Name": "Restore", "Id": "Restore" } ], "Contacts": { "Phones": [ { "Value": "+14258352271" }, { "Value": "+14254205116" } ], "Websites": [ { "Value": "https://restore.com" }, { "Value": "https://restore.com/locations" }, { Use SearchText 519 Amazon Location Service Developer Guide "Value": "https://www.facebook.com/rhwkirkland" }, { "Value": "https://www.restore.com/locations/wa-kirkland- wa001? utm_source=extnet&utm_medium=Yext&y_source=1_MzE2Mjk5NTgtNTY2LWxvY2F0aW9uLndlYnNpdGU %3D" }, { "Value": "https://www.restore.com/sitemap.xml" } ], "Emails": [ { "Value": "kirkland@restore.com" } ] }, "OpeningHours": [ { "Display": [ "Mon-Thu: 10:00 - 19:00", "Fri: 10:00 - 17:00", "Sat: 09:00 - 17:00", "Sun: 10:00 - 16:00" ], "OpenNow": false, "Components": [ { "OpenTime": "T100000", "OpenDuration": "PT09H00M", "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH" }, { "OpenTime": "T100000", "OpenDuration": "PT07H00M", "Recurrence": "FREQ:DAILY;BYDAY:FR" }, { "OpenTime": "T090000", "OpenDuration": "PT08H00M", "Recurrence": "FREQ:DAILY;BYDAY:SA" }, { Use SearchText 520 Amazon Location Service Developer Guide "OpenTime": "T100000", "OpenDuration": "PT06H00M", "Recurrence": "FREQ:DAILY;BYDAY:SU" } ] } ], "AccessPoints": [ { "Position": [ -122.19944, 47.67801 ] } ] }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Restore", "Address": { "Label": "Restore, 1520 Highlands Dr NE, Issaquah, WA 98029, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "King" }, "Locality": "Issaquah", "District": "Issaquah Highlands", "PostalCode": "98029", "Street": "Highlands Dr NE", "StreetComponents": [ { "BaseName": "Highlands", "Type": "Dr", "TypePlacement": "AfterBaseName", Use SearchText 521 Amazon Location Service Developer Guide "TypeSeparator": " ", "Suffix": "NE", "Language": "en" } ], "AddressNumber": "1520" }, "Position": [ -122.01868, 47.54262 ], "Distance": 209665, "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services", "LocalizedName": "Wellness Center & Services", "Primary": true } ], "BusinessChains": [ { "Name": "Restore", "Id": "Restore" } ], "Contacts": { "Phones": [ { "Value": "+14256518137" } ], "Websites": [ { "Value": "https://restore.com", "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services" } ] }, { "Value": "https://www.facebook.com/rhwissaquah", Use SearchText 522 Amazon Location Service Developer Guide "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services" } ] }, { "Value": "https://www.restore.com/locations", "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services" } ] }, { "Value": "https://www.restore.com/locations/wa-issaquah- wa002? utm_source=extnet&utm_medium=Yext&y_source=1_MzE2Mjk5NTktNTY2LWxvY2F0aW9uLndlYnNpdGU %3D", "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services" } ] }, { "Value": "https://www.restore.com/sitemap.xml", "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services" } ] } ], "Emails": [ { "Value": "issaquah@restore.com", "Categories": [ { "Id": "wellness_center_and_services", Use SearchText 523 Amazon Location Service Developer Guide "Name": "Wellness Center and Services" } ] } ] }, "OpeningHours": [ { "Display": [
amazon-location-developer-guide-106
amazon-location-developer-guide.pdf
106
Developer Guide "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services" } ] }, { "Value": "https://www.restore.com/locations", "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services" } ] }, { "Value": "https://www.restore.com/locations/wa-issaquah- wa002? utm_source=extnet&utm_medium=Yext&y_source=1_MzE2Mjk5NTktNTY2LWxvY2F0aW9uLndlYnNpdGU %3D", "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services" } ] }, { "Value": "https://www.restore.com/sitemap.xml", "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services" } ] } ], "Emails": [ { "Value": "issaquah@restore.com", "Categories": [ { "Id": "wellness_center_and_services", Use SearchText 523 Amazon Location Service Developer Guide "Name": "Wellness Center and Services" } ] } ] }, "OpeningHours": [ { "Display": [ "Mon-Thu: 10:00 - 18:00", "Fri: 10:00 - 17:00", "Sat: 09:00 - 17:00" ], "OpenNow": false, "Components": [ { "OpenTime": "T100000", "OpenDuration": "PT08H00M", "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH" }, { "OpenTime": "T100000", "OpenDuration": "PT07H00M", "Recurrence": "FREQ:DAILY;BYDAY:FR" }, { "OpenTime": "T090000", "OpenDuration": "PT08H00M", "Recurrence": "FREQ:DAILY;BYDAY:SA" } ], "Categories": [ { "Id": "wellness_center_and_services", "Name": "Wellness Center and Services" } ] } ], "AccessPoints": [ { "Position": [ -122.01894, 47.54262 Use SearchText 524 Amazon Location Service Developer Guide ] } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryId": "<Redacted>" }' AWS CLI aws geo-places search-text --key ${YourKey} --query-id "<Redacted>" How to search in a specific language This feature allows the selection of a preferred response language from BCP47-compliant codes. It detects the query language based on name variants and uses the preferred language for unmatched tokens and ambiguous cases. If there is no requested language, the Places API provides results in the official country language, but prioritizes the regional language in regions where it differs. As a fallback strategy, if any address elements are unavailable in the requested language, Places APIs return addresses in the default language. Potential use cases One potential use case is to localize the query and/or the result. Examples Get result in a specific language Without the "Language": "EN" line in the request, results would be returned in Hebrew. Use SearchText 525 Developer Guide Amazon Location Service Sample request { "QueryText": "Vegan", "BiasPosition":[ 34.78953, 32.08556 ], "Language": "EN" } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Rainbow", "Address": { "Label": "Rainbow, Ibn Gabirol 88, 6404612 Tel Aviv-Yafo, Israel", "Country": { "Code2": "IL", "Code3": "ISR", "Name": "Israel" }, "Region": { "Code": "TA", "Name": "TA" }, "SubRegion": { "Name": "Tel Aviv" }, "Locality": "Tel Aviv-Yafo", "District": "The New North-Southern Area", "PostalCode": "6404612", "Street": "Ibn Gabirol", "StreetComponents": [ { "BaseName": "Ibn Gabirol", "Language": "he-Latn" } Use SearchText 526 Amazon Location Service Developer Guide ], "AddressNumber": "88" }, "Position": [ 34.78149, 32.08252 ], "Distance": 829, "Categories": [ { "Id": "restaurant", "Name": "Restaurant", "LocalizedName": "Restaurant", "Primary": true }, { "Id": "fast_food", "Name": "Fast Food", "LocalizedName": "Fast Food", "Primary": false } ], "FoodTypes": [ { "LocalizedName": "Vegan", "Id": "vegan", "Primary": true }, { "LocalizedName": "Fast Food", "Id": "fast_food", "Primary": false }, { "LocalizedName": "Burgers", "Id": "burgers", "Primary": false }, { "LocalizedName": "Jewish/Kosher", "Id": "jewish/kosher", "Primary": false } ] Use SearchText 527 Amazon Location Service }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Alegria", "Address": { Developer Guide "Label": "Alegria, Ibn Gabirol 165, 6203305 Tel Aviv-Yafo, Israel", "Country": { "Code2": "IL", "Code3": "ISR", "Name": "Israel" }, "Region": { "Code": "TA", "Name": "TA" }, "SubRegion": { "Name": "Tel Aviv" }, "Locality": "Tel Aviv-Yafo", "District": "The Old North-Northern Area", "PostalCode": "6203305", "Street": "Ibn Gabirol", "StreetComponents": [ { "BaseName": "Ibn Gabirol", "Language": "he-Latn" } ], "AddressNumber": "165" }, "Position": [ 34.78295, 32.0923 ], "Distance": 973, "Categories": [ { "Id": "restaurant", "Name": "Restaurant", "LocalizedName": "Restaurant", "Primary": true }, { Use SearchText 528 Amazon Location Service Developer Guide "Id": "coffee_shop", "Name": "Coffee Shop", "LocalizedName": "Coffee Shop", "Primary": false }, { "Id": "specialty_food_store", "Name": "Specialty Food Store", "LocalizedName": "Specialty Food Store", "Primary": false }, { "Id": "bakery_and_baked_goods_store", "Name": "Bakery and Baked Goods Store", "LocalizedName": "Bakery & Baked Goods Store", "Primary": false } ], "FoodTypes": [ { "LocalizedName": "Vegan", "Id": "vegan", "Primary": true } ] } ] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data ' { "QueryText": "Vegan", "BiasPosition":[ 34.78953, 32.08556 ], "Language": "EN" Use SearchText 529 Amazon Location Service }' AWS CLI Developer Guide aws geo-places search-text --key ${YourKey} --query-text "Vegan" \ --bias-position 34.78953 32.08556 \ --language "EN" How to use Suggest This section contains a variety of how-to guides and examples for using the Suggest API with response data. Topics • How to predict suggestions based on input • How to get results for a partially typed or misspelled query • Choose a route using Suggest and the ability to highlight matched query terms • Use Suggest and the ability to filter for a region or country • How to help users disambiguate between similar results How to predict suggestions based on input The Suggest API enables applications to complete user queries for places
amazon-location-developer-guide-107
amazon-location-developer-guide.pdf
107
\ --language "EN" How to use Suggest This section contains a variety of how-to guides and examples for using the Suggest API with response data. Topics • How to predict suggestions based on input • How to get results for a partially typed or misspelled query • Choose a route using Suggest and the ability to highlight matched query terms • Use Suggest and the ability to filter for a region or country • How to help users disambiguate between similar results How to predict suggestions based on input The Suggest API enables applications to complete user queries for places or categories of results. These suggestions can be used directly or refined further with the SearchText API to retrieve additional details and results. Potential use cases • Restaurant or park lookup: Locate restaurants, parks, or other places near a specific position. Examples Look up restaurants near a position Sample request { "QueryText": "restaura", Use Suggest 530 Amazon Location Service Developer Guide "BiasPosition": [-124.81035775620968, 49.234628873773985], "AdditionalFeatures": ["Core"] } Sample response { "ResultItems": [ { "Title": "Restaurant", "SuggestResultItemType": "Query", "Query": { "QueryId": "AQAAAHgAw1x7...", "QueryType": "Category" }, "Highlights": { "Title": [ { "StartIndex": 0, "EndIndex": 8, "Value": "Restaura" } ] } } ], "QueryRefinements": [] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "restaura", "BiasPosition": [-124.81035775620968, 49.234628873773985], "AdditionalFeatures": ["Core"] }' AWS CLI aws geo-places suggest --key ${YourKey} \ Use Suggest 531 Amazon Location Service Developer Guide --query-text "restaura" \ --bias-position -124.81035775620968 49.234628873773985 \ --additional-features "Core" Look up locations of a chain near a position Sample request { "QueryText": "Domin", "BiasPosition": [-124.81035775620968, 49.234628873773985], "AdditionalFeatures": ["Core"] } Sample response { "ResultItems": [ { "Title": "Domino's", "SuggestResultItemType": "Query", "Query": { "QueryId": "AQAAAHUA4UNp...", "QueryType": "BusinessChain" }, "Highlights": { "Title": [ { "StartIndex": 0, "EndIndex": 5, "Value": "Domin" } ] } } ], "QueryRefinements": [] } cURL curl --request POST \ Use Suggest 532 Amazon Location Service Developer Guide --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Domin", "BiasPosition": [-124.81035775620968, 49.234628873773985], "AdditionalFeatures": ["Core"] }' AWS CLI aws geo-places suggest --key ${YourKey} \ --query-text "Domin" \ --bias-position -124.81035775620968 49.234628873773985 \ --additional-features "Core" Complete a query using a QueryId Sample request (SearchText) { "QueryId": "<QueryId from Suggest API>", "AdditionalFeatures": ["Core"] } Sample response { "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Domino's", "Address": { "Label": "Domino's, 233 Shelly Rd, Parksville, BC V9P, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" Use Suggest 533 Amazon Location Service Developer Guide }, "SubRegion": { "Name": "Nanaimo" }, "Locality": "Parksville", "PostalCode": "V9P", "Street": "Shelly Rd", "StreetComponents": [ { "BaseName": "Shelly", "Type": "Rd", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "233" }, "Position": [ -124.29334, 49.31669 ], "Distance": 38602, "Categories": [ { "Id": "fast_food", "Name": "Fast Food", "LocalizedName": "Fast Food", "Primary": true }, { "Id": "take_out_and_delivery_only", "Name": "Take Out and Delivery Only", "LocalizedName": "Take Out & Delivery Only", "Primary": false } ], "FoodTypes": [ { "LocalizedName": "Pizza", "Id": "pizza", "Primary": true } ], Use Suggest 534 Amazon Location Service Developer Guide "BusinessChains": [ { "Name": "Domino's", "Id": "Domino's" } ], "Contacts": { "Phones": [ { "Value": "+12502489296" } ], "Websites": [ { "Value": "http://pizza.dominos.ca/Parksville-British- Columbia-10039" } ] }, "OpeningHours": [ { "Display": [ "Mon-Fri: 11:00 - 24:00", "Sat, Sun: 00:00 - 01:00, 11:00 - 24:00" ], "OpenNow": true, "Components": [ { "OpenTime": "T110000", "OpenDuration": "PT13H00M", "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,SU" }, { "OpenTime": "T110000", "OpenDuration": "PT14H00M", "Recurrence": "FREQ:DAILY;BYDAY:FR,SA" } ] } ], "AccessPoints": [ { "Position": [ -124.29319, Use Suggest 535 Amazon Location Service Developer Guide 49.31669 ] } ] }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Domino's", "Address": { "Label": "Domino's, 215 Port Augusta St, Comox, BC V9M, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Comox Valley" }, "Locality": "Comox", "PostalCode": "V9M", "Street": "Port Augusta St", "StreetComponents": [ { "BaseName": "Port Augusta", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "215" }, "Position": [ -124.92492, 49.67378 ], "Distance": 49528, "Categories": [ { Use Suggest 536 Amazon Location Service Developer Guide "Id": "fast_food", "Name": "Fast Food", "LocalizedName": "Fast Food", "Primary": true }, { "Id": "take_out_and_delivery_only", "Name": "Take Out and Delivery Only", "LocalizedName": "Take Out & Delivery Only", "Primary": false } ], "FoodTypes": [ { "LocalizedName": "Pizza", "Id": "pizza", "Primary": true } ], "BusinessChains": [ { "Name": "Domino's", "Id": "Domino's" } ], "Contacts": { "Phones": [ { "Value": "+17784310222" } ], "Websites": [ { "Value": "http://pizza.dominos.ca/comox-british- columbia-39035" } ] }, "OpeningHours": [ { "Display": [ "Mon-Thu: 10:30 - 23:00", "Fri: 10:30 - 24:00", "Sat: 00:00 - 01:00, 10:30 - 24:00", Use Suggest 537 Amazon Location Service Developer Guide "Sun: 00:00 - 01:00, 10:30 - 23:00" ], "OpenNow": true, "Components": [ { "OpenTime": "T103000", "OpenDuration": "PT12H30M", "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,SU" },
amazon-location-developer-guide-108
amazon-location-developer-guide.pdf
108
Out and Delivery Only", "LocalizedName": "Take Out & Delivery Only", "Primary": false } ], "FoodTypes": [ { "LocalizedName": "Pizza", "Id": "pizza", "Primary": true } ], "BusinessChains": [ { "Name": "Domino's", "Id": "Domino's" } ], "Contacts": { "Phones": [ { "Value": "+17784310222" } ], "Websites": [ { "Value": "http://pizza.dominos.ca/comox-british- columbia-39035" } ] }, "OpeningHours": [ { "Display": [ "Mon-Thu: 10:30 - 23:00", "Fri: 10:30 - 24:00", "Sat: 00:00 - 01:00, 10:30 - 24:00", Use Suggest 537 Amazon Location Service Developer Guide "Sun: 00:00 - 01:00, 10:30 - 23:00" ], "OpenNow": true, "Components": [ { "OpenTime": "T103000", "OpenDuration": "PT12H30M", "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,SU" }, { "OpenTime": "T103000", "OpenDuration": "PT14H30M", "Recurrence": "FREQ:DAILY;BYDAY:FR,SA" } ] } ], "AccessPoints": [ { "Position": [ -124.92518, 49.67387 ] } ] }, ... ], "QueryRefinements": [] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryId": "<QueryId from Suggest API>", "AdditionalFeatures": ["Core"] }' Use Suggest 538 Amazon Location Service AWS CLI aws geo-places suggest --key ${YourKey} \ --query-id "<QueryId from Suggest API>" \ --additional-features "Core" Developer tips Developer Guide Use filters such as Filter.IncludeCountries or Filter.BoundingBox with BiasPosition. These filters apply to subsequent queries using the QueryId. { "QueryText": "Domin", "BiasPosition": [-124.81035775620968, 49.234628873773985], "Filter": { "IncludeCountries": ["CAN"] } } How to get results for a partially typed or misspelled query The Suggest API enables applications to complete user queries for places or categories of results. These results are sorted from most likely to less-likely matches, allowing the API to resolve incomplete or misspelled words. Potential use cases • Complete a partially typed point of interest query: Assists users by providing suggestions based on partially typed or incorrect entries. Examples Look up a misspelled point of interest Sample request { "QueryText": "Effel tow", "Filter": { "Circle": { Use Suggest 539 Amazon Location Service "Radius": 10000, "Center": [2.3431932014695382, 48.858844492141145] }, Developer Guide "IncludeCountries": ["FRA"] }, "AdditionalFeatures": ["Core"] } Sample response { "ResultItems": [ { "Title": "Tour Eiffel (Eiffel Tower)", "SuggestResultItemType": "Place", "Place": { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Address": { "Label": "Tour Eiffel, 5 Avenue Anatole France, 75007 Paris, France", "Country": {"Code2": "FR", "Code3": "FRA", "Name": "France"}, "Region": {"Code": "IDF", "Name": "Île-de-France"}, "SubRegion": {"Name": "Paris"}, "Locality": "Paris", "District": "7e Arrondissement", "PostalCode": "75007", "Street": "Avenue Anatole France", "StreetComponents": [{"BaseName": "Anatole France", "Type": "Avenue", "Language": "fr"}], "AddressNumber": "5" }, "Position": [2.2945, 48.85824], "Distance": 3563, "Categories": [ {"Id": "historical_monument", "Name": "Historical Monument", "LocalizedName": "Monument historique", "Primary": true}, {"Id": "landmark-attraction", "Name": "Landmark-Attraction", "LocalizedName": "Lieu d'intérêt/Attraction", "Primary": false}, {"Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Attraction touristique", "Primary": false}, {"Id": "sports_complex-stadium", "Name": "Sports Complex- Stadium", "LocalizedName": "Stade ou complexe sportif", "Primary": false} Use Suggest 540 Amazon Location Service ] Developer Guide }, "Highlights": {"Title": [{"StartIndex": 13, "EndIndex": 23, "Value": "Eiffel Tow"}]} } ], "QueryRefinements": [] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Effel tow", "Filter": { "Circle": {"Radius": 10000, "Center": [2.3431932014695382, 48.858844492141145]}, "IncludeCountries": ["FRA"] }, "AdditionalFeatures": ["Core"] }' AWS CLI aws geo-places suggest --key ${YourKey} \ --query-text "Effel tow" \ --filter '{"Circle": {"Radius": 1000, "Center": [2.3431932014695382, 48.858844492141145]}, "IncludeCountries": ["FRA"]}' \ --additional-features "Core" Developer tips Use filters such as Filter.IncludeCountries or Filter.BoundingBox with BiasPosition. These filters can help narrow down possible results and improve accuracy. { "QueryText": "Effel tow", "BiasPosition": [2.2982750966095398, 48.856078089325294], "Filter": {"IncludeCountries": ["FRA"]} } Use Suggest 541 Amazon Location Service Developer Guide Choose a route using Suggest and the ability to highlight matched query terms With the Suggest API, you get real-time autocomplete suggestions as users type their search queries for places or categories. Results are ranked by relevance, with the most likely matches appearing first. The API response includes highlighting information that shows how each suggestion matches the user's query. Potential use cases Use highlighting to show users which parts of each suggestion match their input, making it easier to quickly select the desired result. Examples When displaying the result list to users, the Highlights fields in the response can be used to help the user identify how the input has been matched to the results. In the example below, the user makes a query for “Effel tow”. This matches a result with the Title “Tour Eiffel (Eiffel Tower)”. Using the Highlights result field, the result can be styled to show where the input query was matched to the output, resulting in the text being showed to the user as “Tour Eiffel (Eiffel Tower).” Highlight the query results with the Suggest API This example demonstrates how to use the Suggest API to look up a misspelled point of interest. Sample request { "QueryText": "Effel tow", "Filter": { "Circle": { "Radius": 10000, "Center": [ 2.3431932014695382, 48.858844492141145 ] }, "IncludeCountries": [ "FRA" ] }, "AdditionalFeatures": [ "Core" ] Use Suggest 542 Amazon Location Service } Sample response Developer Guide { "ResultItems": [ { "Title": "Tour Eiffel (Eiffel Tower)", "SuggestResultItemType": "Place", "Place": { "PlaceId": "<Redacted>",
amazon-location-developer-guide-109
amazon-location-developer-guide.pdf
109
the input query was matched to the output, resulting in the text being showed to the user as “Tour Eiffel (Eiffel Tower).” Highlight the query results with the Suggest API This example demonstrates how to use the Suggest API to look up a misspelled point of interest. Sample request { "QueryText": "Effel tow", "Filter": { "Circle": { "Radius": 10000, "Center": [ 2.3431932014695382, 48.858844492141145 ] }, "IncludeCountries": [ "FRA" ] }, "AdditionalFeatures": [ "Core" ] Use Suggest 542 Amazon Location Service } Sample response Developer Guide { "ResultItems": [ { "Title": "Tour Eiffel (Eiffel Tower)", "SuggestResultItemType": "Place", "Place": { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Address": { "Label": "Tour Eiffel, * Avenue Anatole France, ***** Paris, France", "Country": { "Code2": "FR", "Code3": "FRA", "Name": "France" }, "Region": { "Code": "IDF", "Name": "Île-de-France" }, "SubRegion": { "Name": "Paris" }, "Locality": "Paris", "District": "*e Arrondissement", "PostalCode": "*****", "Street": "Avenue Anatole France", "StreetComponents": [ { "BaseName": "Anatole France", "Type": "Avenue", "TypePlacement": "BeforeBaseName", "TypeSeparator": " ", "Language": "fr" } ], "AddressNumber": "5" }, "Position": [ Use Suggest 543 Amazon Location Service Developer Guide 2.2945, 48.85824 ], "Distance": 3563, "Categories": [ { "Id": "historical_monument", "Name": "Historical Monument", "LocalizedName": "Monument historique", "Primary": true }, { "Id": "landmark-attraction", "Name": "Landmark-Attraction", "LocalizedName": "Lieu d'intérêt/Attraction", "Primary": false }, { "Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Attraction touristique", "Primary": false }, { "Id": "sports_complex-stadium", "Name": "Sports Complex-Stadium", "LocalizedName": "Stade ou complexe sportif", "Primary": false } ] }, "Highlights": { "Title": [ { "StartIndex": 13, "EndIndex": 23, "Value": "Eiffel Tow" } ], "Address": {} } } ], "QueryRefinements": [] Use Suggest 544 Amazon Location Service Developer Guide } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Effel tow", "Filter": { "Circle": { "Radius": 10000, "Center": [ 2.3431932014695382, 48.858844492141145 ] }, "IncludeCountries": [ "FRA" ] }, "AdditionalFeatures": [ "Core" ] }' AWS CLI aws geo-places suggest --key ${YourKey} \ --query-text "Effel tow" \ --filter '{"Circle": {"Radius": 10000, "Center": [2.3431932014695382, 48.858844492141145]}, "IncludeCountries": ["FRA"]}' \ --additional-features "Core" Developer tips Display search results using the Title response field to provide users with concise, recognizable entries. For results that might look similar, use the Place.Address.Label field to show additional address details that help users distinguish between them. For more information, see How to help users disambiguate between similar results. Use Suggest 545 Amazon Location Service Developer Guide Use Suggest and the ability to filter for a region or country The Suggest API enables completing queries for places or categories of results. The results are sorted for most likely to less likely matches. Additionally, you can further filter results to specific regions or countries. Potential use cases • Filter the results: When performing a search, you can filter by country or only the region in which your business operates. Examples Adding a filter by country ensures you only receive the most relevent results. Use Filter.IncludeCountries for this. Enable users to filter by country Sample request { "QueryText": "hote", "BiasPosition": [ 2.2982750966095398, 48.856078089325294 ], "Filter": { "IncludeCountries": [ "FRA" ] }, "AdditionalFeatures": [ "Core" ] } Sample response { "ResultItems": [ { "Title": "Hôtel de Matignon (Hôtel Matignon)", "SuggestResultItemType": "Place", Use Suggest 546 Amazon Location Service Developer Guide "Place": { "PlaceId": "Redacted", "PlaceType": "PointOfInterest", "Address": { "Label": "Hôtel de Matignon, 57 Rue de Varenne, 75007 Paris, France", "Country": { "Code2": "FR", "Code3": "FRA", "Name": "France" }, "Region": { "Code": "IDF", "Name": "Île-de-France" }, "SubRegion": { "Name": "Paris" }, "Locality": "Paris", "District": "7e Arrondissement", "PostalCode": "75007", "Street": "Rue de Varenne", "StreetComponents": [ { "BaseName": "Varenne", "Type": "Rue de", "TypePlacement": "BeforeBaseName", "TypeSeparator": " ", "Language": "fr" } ], "AddressNumber": "57" }, "Position": [ 2.32072, 48.85471 ], "Distance": 1650, "Categories": [ { "Id": "tourist_attraction", "Name": "Tourist Attraction", "LocalizedName": "Attraction touristique", "Primary": true Use Suggest 547 Amazon Location Service }, Developer Guide { "Id": "landmark-attraction", "Name": "Landmark-Attraction", "LocalizedName": "Lieu d'intérêt/Attraction", "Primary": false }, { "Id": "historical_monument", "Name": "Historical Monument", "LocalizedName": "Monument historique", "Primary": false }, { "Id": "residential_area-building", "Name": "Residential Area-Building", "LocalizedName": "Bâtiment résidentiel", "Primary": false } ] }, "Highlights": { "Title": [ { "StartIndex": 0, "EndIndex": 4, "Value": "Hôt" }, { "StartIndex": 19, "EndIndex": 23, "Value": "(Hô" } ], "Address": { "Label": [ { "StartIndex": 0, "EndIndex": 4, "Value": "Hôt" } ] } } Use Suggest 548 Developer Guide Amazon Location Service }, ... { "Title": "Hotel", "SuggestResultItemType": "Query", "Query": { "QueryId": "Redacted", "QueryType": "Category" }, "Highlights": { "Title": [ { "StartIndex": 0, "EndIndex": 4, "Value": "Hote" } ] } }, ... ], "QueryRefinements": [] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "hote", "BiasPosition": [ 2.2982750966095398, 48.856078089325294 ], "Filter": { "IncludeCountries": [ "FRA" ] }, "AdditionalFeatures": [ "Core" ] }' Use Suggest 549 Amazon Location Service AWS CLI Developer Guide aws geo-places suggest --key ${YourKey} \ --query-text "hote" \ --bias-position 2.2982750966095398 48.856078089325294 \ --filter '{"IncludeCountries": ["FRA"]}' \ --additional-features
amazon-location-developer-guide-110
amazon-location-developer-guide.pdf
110
Developer Guide Amazon Location Service }, ... { "Title": "Hotel", "SuggestResultItemType": "Query", "Query": { "QueryId": "Redacted", "QueryType": "Category" }, "Highlights": { "Title": [ { "StartIndex": 0, "EndIndex": 4, "Value": "Hote" } ] } }, ... ], "QueryRefinements": [] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "hote", "BiasPosition": [ 2.2982750966095398, 48.856078089325294 ], "Filter": { "IncludeCountries": [ "FRA" ] }, "AdditionalFeatures": [ "Core" ] }' Use Suggest 549 Amazon Location Service AWS CLI Developer Guide aws geo-places suggest --key ${YourKey} \ --query-text "hote" \ --bias-position 2.2982750966095398 48.856078089325294 \ --filter '{"IncludeCountries": ["FRA"]}' \ --additional-features "Core" Adding a filter-by-region option for a search limits results to only those which fit within the provided region. This is used to limit the scope of the search to the region that concerns your business. The following example shows a misspelled search for Marriott hotels near the Boston area being completed with some hotel results and a follow-up query. Enable users to filter by region Sample request { "QueryText": "Mariot", "Filter": { "IncludeCountries": [ "USA" ], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763 ] }, "AdditionalFeatures": [ "Core" ] } Sample response { "ResultItems": [ { "Title": "Boston Marriott Copley Place", "SuggestResultItemType": "Place", "Place": { Use Suggest 550 Amazon Location Service Developer Guide "PlaceId": "Redacted", "PlaceType": "PointOfInterest", "Address": { "Label": "Boston Marriott Copley Place, 110 Huntington Ave, Boston, MA 02116, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "MA", "Name": "Massachusetts" }, "SubRegion": { "Name": "Suffolk" }, "Locality": "Boston", "District": "Back Bay", "PostalCode": "02116", "Street": "Huntington Ave", "StreetComponents": [ { "BaseName": "Huntington", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "110" }, "Position": [ -71.07769, 42.34726 ], "Distance": 3347, "Categories": [ { "Id": "hotel", "Name": "Hotel", "LocalizedName": "Hotel", "Primary": true } Use Suggest 551 Amazon Location Service Developer Guide ], "BusinessChains": [ { "Name": "Marriott", "Id": "Marriott" } ], "AccessPoints": [ { "Position": [ -71.07922, 42.34665 ] } ] }, "Highlights": { "Title": [ { "StartIndex": 7, "EndIndex": 14, "Value": "Marriot" } ], "Address": { "Label": [ { "StartIndex": 7, "EndIndex": 14, "Value": "Marriot" } ] } } }, ... { "Title": "Marriott", "SuggestResultItemType": "Query", "Query": { "QueryId": "Redacted", "QueryType": "BusinessChain" }, "Highlights": { Use Suggest 552 Amazon Location Service Developer Guide "Title": [ { "StartIndex": 0, "EndIndex": 8, "Value": "Marriott" } ] } }, ... ], "QueryRefinements": [] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Mariot", "Filter": { "IncludeCountries": [ "USA" ], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763 ] }, "AdditionalFeatures": [ "Core" ] }' AWS CLI aws geo-places suggest --key ${YourKey} \ --query-text "hote" \ --filter '{"IncludeCountries": ["FRA"], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763]}' \ --additional-features "Core" Use Suggest 553 Amazon Location Service Developer tips Developer Guide Display search results using the Title response field to provide users with concise, recognizable entries. For results that might look similar, use the Place.Address.Label field to show additional address details that help users distinguish between them. For more information, see How to help users disambiguate between similar results. How to help users disambiguate between similar results The Suggest API enables you to create queries for places or categories of results. The results are sorted for more likely to less likely matches. Information is provided for each result which helps you quickly identify the correct match, particularly with regard to the Title and Label fields. Potential use cases • Display the result options: You can select the option that best suits your needs. Examples The Title field is usually enough information for you to understand when the result is what was intended. For cases where the title doesn't provide enough information, the Label field is used to add address information context to the result. The Label field can be provided as a second line of information which is de-emphasized from the main text when the results are rendered for you. In the example below, two similar results are provided and the address of the hotel can help you select the one that is more applicable to your needs. Additionally, position is provided so the results can be rendered on a map as an alternate way for you to select between results. Disambiguate the results with the Suggest API Sample request { "QueryText": "Marriott", "Filter": { "IncludeCountries": [ "USA" ], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763 ] Use Suggest 554 Developer Guide Amazon Location Service }, "AdditionalFeatures": [ "Core" ] } Sample response { "ResultItems": [ { "Title": "Marriott-Boston Cambridge", "SuggestResultItemType": "Place", "Place": { "PlaceId": "Redacted", "PlaceType": "PointOfInterest", "Address": { "Label": "Marriott-Boston Cambridge, 50 Broadway, Cambridge, MA 02138-4137, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "MA", "Name": "Massachusetts" }, "SubRegion": { "Name": "Middlesex" }, "Locality": "Cambridge", "District": "MIT", "PostalCode": "02138-4137", "Street": "Broadway", "StreetComponents":
amazon-location-developer-guide-111
amazon-location-developer-guide.pdf
111
select between results. Disambiguate the results with the Suggest API Sample request { "QueryText": "Marriott", "Filter": { "IncludeCountries": [ "USA" ], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763 ] Use Suggest 554 Developer Guide Amazon Location Service }, "AdditionalFeatures": [ "Core" ] } Sample response { "ResultItems": [ { "Title": "Marriott-Boston Cambridge", "SuggestResultItemType": "Place", "Place": { "PlaceId": "Redacted", "PlaceType": "PointOfInterest", "Address": { "Label": "Marriott-Boston Cambridge, 50 Broadway, Cambridge, MA 02138-4137, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "MA", "Name": "Massachusetts" }, "SubRegion": { "Name": "Middlesex" }, "Locality": "Cambridge", "District": "MIT", "PostalCode": "02138-4137", "Street": "Broadway", "StreetComponents": [ { "BaseName": "Broadway", "Language": "en" } ], "AddressNumber": "50" }, Use Suggest 555 Amazon Location Service Developer Guide "Position": [ -71.0858, 42.36294 ], "Distance": 5212, ... }, { "Title": "Marriott-Boston Copley Place", "SuggestResultItemType": "Place", "Place": { "PlaceId": "Redacted", "PlaceType": "PointOfInterest", "Address": { "Label": "Marriott-Boston Copley Place, 110 Huntington Ave, Boston, MA 02116-5706, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "MA", "Name": "Massachusetts" }, "SubRegion": { "Name": "Suffolk" }, "Locality": "Boston", "District": "Back Bay", "PostalCode": "02116-5706", "Street": "Huntington Ave", "StreetComponents": [ { "BaseName": "Huntington", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "110" }, "Position": [ Use Suggest 556 Amazon Location Service Developer Guide -71.0792, 42.34701 ], "Distance": 3362, ... }, ... ], "QueryRefinements": [] } cURL curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Marriott", "Filter": { "IncludeCountries": [ "USA" ], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763 ] }, "AdditionalFeatures": [ "Core" ] }' AWS CLI aws geo-places suggest --key ${YourKey} \ --query-text "Marriott" \ --filter '{"IncludeCountries": ["USA"], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763]}' \ --additional-features "Core" Use Suggest 557 Amazon Location Service What's Next Developer Guide As you continue exploring Amazon Location Service, it's important to understand how to manage service capacity, ensure you follow usage limits, and get the best results through quota and API optimizations. By applying best practices for performance and accuracy, you can tailor your application to handle place-related queries efficiently and maximize your API requests. Topics • Best practices • Places pricing • Places quotas and usage Best practices This section outlines best practices for optimizing the performance and accuracy of API interactions in your application. By implementing techniques such as debouncing and browser caching, and leveraging filters and geographical context, you can improve the user experience and ensure that your application delivers the most relevant results. Typeahead Implementation When working with events or API calls in web development, managing performance is essential to providing a smooth user experience. Two common techniques that can help achieve this are: Debouncing: Debouncing limits the frequency of function execution, which is especially useful for high-frequency events like window resizing or user input. This ensures that functions are called only after a certain delay, reducing unnecessary processing and enhancing performance. Browser Caching: By caching recent search queries and results locally, browser caching helps avoid redundant API calls for the same data. This minimizes network traffic and speeds up the application by serving cached data when available. Both techniques work together to improve performance and efficiency in handling user interactions and API requests. Getting the Right Results Using geographical context, such as bias position or filters like circles and bounding boxes, can enhance the results by focusing on proximity and limiting the output to relevant places. What's Next 558 Amazon Location Service Developer Guide Additionally, filters like countries, place types, categories, chains, and food types can help refine your search further by including or excluding specific criteria. Places pricing The price for the Place APIs is based on the number of API requests. The unit price for each API request depends on the response fields you request in your API request and the intended use for the result. For pricing information for the API and pricing buckets, see Amazon Location Service pricing page. There are four pricing buckets for Place APIs: Label, Core, Advanced, and Stored. Label The Label pricing bucket provides a cost-effective option to get address text and PlaceID only. When you call the Autocomplete and Suggest APIs with additionalFeature = [] or non- existent, the API returns PlaceID (can be used to in a GetPlace request to retrieve additional information), PlaceType, and Title fields for both APIs, and QueryRefinements, QueryType, and QueryId for Suggest API. In this case, you will be charged at the Label price. Results cannot be stored permanently for this pricing bucket. See Stored pricing bucket for long-term use cases. Core The Core pricing bucket supports the most common use cases for Place APIs. When you call the following, you will still be charged at the Core price: • SearchText, Geocode, ReverseGeocode, SearchNearby, GetPlace API with additionalFeature = [] or nonexistent • Autocomplete and Suggest APIs with additionalFeature
amazon-location-developer-guide-112
amazon-location-developer-guide.pdf
112
to in a GetPlace request to retrieve additional information), PlaceType, and Title fields for both APIs, and QueryRefinements, QueryType, and QueryId for Suggest API. In this case, you will be charged at the Label price. Results cannot be stored permanently for this pricing bucket. See Stored pricing bucket for long-term use cases. Core The Core pricing bucket supports the most common use cases for Place APIs. When you call the following, you will still be charged at the Core price: • SearchText, Geocode, ReverseGeocode, SearchNearby, GetPlace API with additionalFeature = [] or nonexistent • Autocomplete and Suggest APIs with additionalFeature = Core • Geocode with additionalFeature = SecondaryAddresses or Intersections • ReverseGeocode with additionalFeature = Intersections • GetPlace with additionalFeature = SecondaryAddresses The API returns full address components, categories, and other place details (when applicable). Refer to API reference for a full list of response fields. Results can't be stored permanently for this pricing bucket, see the the section called “Stored” bucket for long-term use cases. Places pricing 559 Amazon Location Service Advanced Developer Guide The Advanced pricing bucket provides additional place or points-of-interest details, such as business hours, contact information, and access points. When you call SearchText, SearchNearby, and GetPlace API with and include one of the following values in the additionalFeature request field: Contact, Access, TimeZone, or Phonemes, the API returns corresponding values for the additional information you have requested (for example, opening_hours and contact_details, access_restriction and access_points, Phonemes, or Timezone). In this case, you will be charged at the Advanced price. Results can be cached but not stored for long- term use for this pricing bucket. Results cannot be stored permanently for this pricing bucket. See Stored pricing bucket for long-term use cases. Stored You can store the Places results indefinitely for long-term use cases, such as reusing the results to reduce on-demand API calls or for analytical purpose. To do so, set intendedUse = Stored in your API request. In this case, you will be charged at the Stored price. The Stored pricing bucket supports all the features listed above, therefore, the maximum price you will be charged for a single Places API call is capped at the Stored price. Places quotas and usage Amazon Location Service places quotas on API usage to manage service capacity and prevent over utilization. These quotas can be adjusted through the AWS service quotas console or by contacting support. This section covers the service quotas for Place APIs and API usage limits, including how to request increases and other related information. Service Quota Amazon Location Service sets default quotas for APIs to help manage service capacity, which can be viewed in the AWS Service Quotas management console. You can request an increase in Amazon Location Service quotas through the self-service console (links are shown in the following table), for up to 2x the default limit for each API. For quota limits exceeding 2x the default limit, request in the service quota console and it will submit a support ticket. Alternatively, you can connect with your premium support team. There are no direct charges for quota increase requests, but higher usage levels may lead to increased service costs based on the additional resources consumed. For more details, see Manage quotas with Service Quotas. Quotas and usage 560 Amazon Location Service Service Quota Limits Developer Guide API Name Default Adjustable Max limit More than Adjustabl e Max limit Request on service quota console or contact support team Request on service quota console or contact support team Request on service quota console or contact support team Request on service quota console or contact support team Request on service quota console or contact support team Request on service quota console or contact support team Request on service quota console or contact support team 200 200 200 200 200 200 200 Geocode 100 ReverseGeocode 100 Autocomplete 100 GetPlace 100 SearchText 100 SearchNearby 100 Suggest 100 Other Usage Limits Feature Availability Autocomplete is not available in Japan. Quotas and usage 561 Developer Guide Amazon Location Service API usage Limits API Name Geocode ReverseGeocode Autocomplete GetPlace SearchText SearchNearby Suggest Limit Response payload size after compression Response payload size after compression Response payload size after compression Response payload size after compression Response payload size after compression Response payload size after compression Response payload size after compression Value 6MB 6MB 6MB 6MB 6MB 6MB 6MB Next Steps For additional information, see: • Attribution: Ensure proper data attribution when using Amazon Location Service data. • SLA: Review the Amazon Location Service Service Level Agreement to understand availability guarantees. • Service Terms: Familiarize yourself with the legal terms governing the use of Amazon Location Service. Quotas and usage 562 Amazon Location Service Developer Guide Amazon Location Service Routes With Amazon Location Service Routes, you can calculate travel time and distance between
amazon-location-developer-guide-113
amazon-location-developer-guide.pdf
113
size after compression Response payload size after compression Response payload size after compression Response payload size after compression Value 6MB 6MB 6MB 6MB 6MB 6MB 6MB Next Steps For additional information, see: • Attribution: Ensure proper data attribution when using Amazon Location Service data. • SLA: Review the Amazon Location Service Service Level Agreement to understand availability guarantees. • Service Terms: Familiarize yourself with the legal terms governing the use of Amazon Location Service. Quotas and usage 562 Amazon Location Service Developer Guide Amazon Location Service Routes With Amazon Location Service Routes, you can calculate travel time and distance between multiple starting points and ending points, visualize vehicle GPS traces aligned with roads, and better understand your serviceable areas. This helps reduce operating costs and improve customer experience. Features Plan a route path Calculate routes between two or more locations, considering various factors such as distance, time, and road conditions. You can also see alternative routes for the same set of locations. Route Optimization Optimize routes for time or distance, choosing the fastest or shortest route. You can also sequence waypoints to optimize for the traveling salesman problem. Route Analysis Analyze performance metrics like travel time, distance, or the number of stops to ensure the route meets your desired goals. Service Area Defines the geographic area that can be serviced from a particular location based on distance or time limits. Toll Costs Calculate the costs associated with toll infrastructure on your route. Avoidances Constrain your route calculation by avoiding highways, tunnels, ferries, and toll roads. Features 563 Amazon Location Service Speed Limits Developer Guide Find speed limits for each segment of a route, ensuring drivers comply with local regulations. Features 564 Amazon Location Service Developer Guide Features 565 Amazon Location Service Use cases Developer Guide Provide efficient routes and turn-by-turn directions Plan routes from any starting location (address, POI, or GPS coordinates) and calculate the best path to multiple destinations, factoring in vehicle dimensions and restrictions. For more information, see the section called “Calculate routes”. Optimize delivery routes Use waypoint sequencing to solve the Traveling Salesman Problem and calculate the optimal route to multiple destinations, minimizing time and distance. For more information, see the section called “Optimize waypoints”. Make sure deliveries are made from the nearest warehouse Use Matrix Routing and Waypoint Sequencing to identify the fastest route from your warehouses to each customer, maximizing efficiency and minimizing costs. For more information, see the section called “Calculate routes” and the section called “Calculate route matrix”. Improve taxi and ride-share dispatch Use Matrix Routing to identify the nearest available vehicle and calculate optimal routes based on real-time traffic. This ensures the closest vehicle reaches the customer efficiently, driving both customer satisfaction and business productivity. Make more trips, save on fuel costs, and deliver a superior service experience. For more information, see the section called “Calculate routes”, the section called “Calculate route matrix”, and the section called “Calculate isolines”. Find service areas Use Isoline routes to determine the geographic reach of your business, based on time or distance constraints. This allows the business to identify potential customers and make dispatch plans. In-home healthcare providers can ensure they have enough staff and resources to reach all patients within 15 minutes. Isoline helps optimize service areas, ensure timely deliveries, and locate new facilities. For more information, see the section called “Calculate isolines”. Use cases 566 Amazon Location Service Snap GPS trace to roads Developer Guide Align GPS traces to roads and visualize vehicle movements, ensuring route adherence and regulatory compliance. Fleet managers can see if vehicles are staying on planned routes and identify deviations. Verify that drivers are following guidelines, spot inefficiencies, and ensure compliance with regulations. Corrects GPS inaccuracies and variations, and presents a realistic view of vehicle activity. Enable better decision-making around route optimization, driver behavior, and fleet management. For more information, see the section called “Snap to Roads”. APIs This table provides an overview of key Amazon Location Service APIs for route planning and location-based data processing. Each API offers unique functionality, such as calculating routes, optimizing waypoints, and snapping GPS traces to roads for accurate tracking. APIs API name Description Read more Calculate Routes Calculate a travel distance, travel time, and turn-by-turn the section called “Calculate routes” Calculate Route Matrix Calculate Isolines directions between a starting point and multiple destinati ons factoring vehicle restricti ons, and real-time traffic. Calculate route distance and time between a set of departure points and a set of destinations, factoring real time traffic. Identify the geographic area that can be reached within a specified time or distance based on your travel modes. the section called “Calculate route matrix” the section called “Calculate isolines” APIs 567 Amazon Location Service Developer Guide API name Description Read more Optimize Waypoints Find the efficient order to travel to multiple
amazon-location-developer-guide-114
amazon-location-developer-guide.pdf
114
and turn-by-turn the section called “Calculate routes” Calculate Route Matrix Calculate Isolines directions between a starting point and multiple destinati ons factoring vehicle restricti ons, and real-time traffic. Calculate route distance and time between a set of departure points and a set of destinations, factoring real time traffic. Identify the geographic area that can be reached within a specified time or distance based on your travel modes. the section called “Calculate route matrix” the section called “Calculate isolines” APIs 567 Amazon Location Service Developer Guide API name Description Read more Optimize Waypoints Find the efficient order to travel to multiple destinati the section called “Optimize waypoints for a route” ons, reducing travel time and distance while accounting for factors like traffic and vehicle constraints. Snap to Roads Match GPS traces to the nearest road segment, to the section called “Snap to Roads” improve accuracy of vehicle tracking and route visualiza tion. Routes concepts The Routes concepts in Amazon Location Service provide a robust framework for planning and optimizing journeys, whether for simple navigation or complex logistics. Routes encompass various components, such as waypoints, legs, steps, and spans, each contributing to the granularity and flexibility of route calculations. Leveraging the Routes API, you can calculate travel distances, estimate travel times, and optimize multi-stop journeys. Additionally, features like route geometry, traffic awareness, speed limits, toll costs, and flexible polyline encoding enhance the capabilities for visualization, analysis, and operational efficiency. This section covers terminology, best practices, and detailed usage patterns, guiding you through implementing effective route solutions for navigation, delivery, field services, and more. Topics • Routes Terminology • Where (origin, destination, waypoint, and traces) • When (departure and arrival) • How (travel mode, avoidance, and exclusion) • Traffic awareness • Optimize route and waypoint sequence • Driver schedule and notices Routes concepts 568 Amazon Location Service Routes Terminology Route Developer Guide A route provides details for traveling from a departure position through waypoint positions to a destination. It includes travel distance, travel time, route geometry, speed limits, spans, and other attributes. Route Matrix A matrix representing travel distance and travel time from a set of origins to a set of destinations. It is useful as an input for route planning or optimization applications. Waypoint Waypoints are intermediate stops along a route from the departure point to the destination. The route follows the stopover order as specified in the request. Leg A leg represents the journey between two consecutive positions on a route. If the positions are off-road, they are moved to the nearest road. A route with no waypoints consists of a single leg. Routes with one or more waypoints have multiple legs, with each leg representing travel from one waypoint to the next. Certain legs, like those involving ferries, contain specific information pertinent to that leg type. Step A step is a segment within a leg, providing summary details for that part of the journey. Types of steps include: • Default Steps – Basic steps with human-readable instructions, suited for web applications that display a route overview. • Turn-by-Turn Steps – Detailed steps suitable for turn-by-turn applications, providing granular instructions. • Before Travel Steps – Steps to complete before starting the journey. Example: boarding a ferry. • After Travel Steps – Steps to complete after reaching the end of a journey. Example: de- boarding a ferry. Terminology 569 Amazon Location Service Span Developer Guide A span represents a continuous stretch of a road that shares a consistent set of attributes. New spans are created along a route whenever one of the requested attributes changes. Segment A segment is a navigable portion of a road, typically represented as a linear stretch. Route Geometry Route geometry depicts the path of a route for visualization, analysis, or other uses. Each route leg’s geometry can be represented as a compressed, encoded polyline or as a simple line string. Flexible Polyline A compact, encoded polyline format for representing geometry. Recommended for limiting response size and optimized for client-side decoding. Simple Line String A GeoJSON LineString format representing geometry. This format produces a larger response payload and is an ordered array of coordinates that can be used to plot routes on a map. Where (origin, destination, waypoint, and traces) Specifies the location for route calculation, including where the route starts, ends, and intermediate stops (or locations to be passed through). Specifies the where for route calculation Routes Routes Matrix Isoline Optimize Waypoint Snap to Road Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options No No Parameter Origin(s) Waypoint Descripti on Starting position of the route. Intermedi ate positions to be included Where (origin, destination, waypoint, and traces) 570 Amazon Location Service Developer Guide Parameter Descripti on along the route. Routes Routes
amazon-location-developer-guide-115
amazon-location-developer-guide.pdf
115
and traces) Specifies the location for route calculation, including where the route starts, ends, and intermediate stops (or locations to be passed through). Specifies the where for route calculation Routes Routes Matrix Isoline Optimize Waypoint Snap to Road Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options No No Parameter Origin(s) Waypoint Descripti on Starting position of the route. Intermedi ate positions to be included Where (origin, destination, waypoint, and traces) 570 Amazon Location Service Developer Guide Parameter Descripti on along the route. Routes Routes Matrix Isoline Optimize Waypoint Snap to Road Destinati on(s) Ending position of Yes, with options Yes, with options Yes, with options Yes, with options No No No No No Yes, with options Trace points the route. GPS trace that includes historica l position informati on emitted by a travel mode. These positions include typical GPS inaccurac ies and gaps when the device couldn't emit or record this informati on. Configurable options Provides options to customize routing behavior for waypoints, origins, and destinations. Where (origin, destination, waypoint, and traces) 571 Amazon Location Service Waypoints options Developer Guide Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes No No No No AvoidActi onsForDis tance Avoids actions for the provided distance. Typically used to ensure drivers have enough time to make decisions near waypoints. AvoidUTur ns Specifies whether U- Yes No No No No Heading turns are allowed at the waypoint. GPS heading at the waypoint position. Yes No No Yes No Matching Options to configure matching Yes, with options No No No No Where (origin, destination, waypoint, and traces) 572 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes, with options No No Yes, with options No Parameter SideOfStr eet Descripti on the provided position to the road network. Specifies the side of the street to match the waypoint position. StopDurat ion Duration to stop Yes No No No No Yes No No Yes No Yes No No No No Position PassThrou gh over at the waypoint position. Longitude and Latitude for the waypoint. Determine s if the waypoint should be treated as a stop or passed through. Where (origin, destination, waypoint, and traces) 573 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road No No No Yes No No No No Yes No Parameter Id AccessHou rs Descripti on Identifie r string for the waypoint. Specifies access hours for visiting the destinati on. Appointme ntTime Scheduled appointme No No No Yes No ServiceDu ration Before nt time at the waypoint. Service time at the waypoint, such as duration of an appointme nt. Defines which waypoints must be visited after this one. No No No Yes No No No No Yes No Where (origin, destination, waypoint, and traces) 574 Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes Yes Yes No No Yes No No No No Yes Yes Yes No No Yes, with options Yes, with options Yes, with options No No Yes, with options Yes, with options Yes, with options No No Amazon Location Service Origin options Parameter AvoidActi onsForDis tance AvoidUTur ns Heading Matching SideOfStr eet Descripti on Avoids actions for the provided distance. Specifies if U-turns are permitted at the origin. GPS heading at the origin position. Options to match the origin position to the road network. Specifies the side of the street to match the origin position. Where (origin, destination, waypoint, and traces) 575 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road No No Yes No No Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes Yes Yes No No Parameter Id Descripti on Identifier string for the origin. Destination options Parameter AvoidActi onsForDis tance Descripti on Avoids actions for the provided distance at the destinati on. AvoidUTur ns Specifies if U-turns are Yes No No No No Heading allowed at the destinati on. GPS heading at the destination position. Yes Yes Yes Yes No Matching Options to match the Yes, with options Yes, with options Yes, with options No No destinati Where (origin, destination, waypoint, and traces) 576 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes, with options Yes, with options Yes, with options Yes, with options No Parameter SideOfStr eet Descripti on on position to the road network. Specifies the side of the street to match the destination position. StopDurat ion Duration to stop Yes No No No No Id AccessHou rs over at the destinati on. Identifie r string for the destinati on. Specifies access hours for visiting the destinati on. No No Yes No No No No Yes No No Where
amazon-location-developer-guide-116
amazon-location-developer-guide.pdf
116
Where (origin, destination, waypoint, and traces) 576 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes, with options Yes, with options Yes, with options Yes, with options No Parameter SideOfStr eet Descripti on on position to the road network. Specifies the side of the street to match the destination position. StopDurat ion Duration to stop Yes No No No No Id AccessHou rs over at the destinati on. Identifie r string for the destinati on. Specifies access hours for visiting the destinati on. No No Yes No No No No Yes No No Where (origin, destination, waypoint, and traces) 577 Amazon Location Service Developer Guide Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Appointme ntTime Scheduled appointme No No Yes No No ServiceDu ration nt time at the destinati on. Service time at the destinati on, such as duration of an appointme nt. No No Yes No No When (departure and arrival) Specifies the time for route calculation. The time not only determines the timestamps for departure and arrival but also influences the traffic data to be used. Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes Yes Yes Yes No Parameter Departure Time Descripti on Time of departure from the Origin. If neither arrival nor departure time is provided, When (departure and arrival) 578 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes Yes Yes No No Parameter Depart Now Descripti on dynamic traffic informati on is not used, and only free-flow speeds based on historical traffic are applied. Uses the current time as the time of departure from the Origin. When (departure and arrival) 579 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes No Yes No No Parameter Arrival Time Descripti on Time of arrival at the destinati on. If neither arrival nor departure time is provided, dynamic traffic informati on is not used, and only free-flow speeds based on historical traffic are applied. How (travel mode, avoidance, and exclusion) Use the following options to specify the travel mode and related features to use for route calculation. Travel mode options Specifies the mode of transport when calculating a route. This setting influences the estimated speed of travel, road compatibility, and the potential use of ferries where needed. How (travel mode, avoidance, and exclusion) 580 Amazon Location Service Developer Guide Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Car Scooter Car travel mode. Yes, with options Yes, with options Yes, with options Scooter travel mode. Yes, with options Yes Yes, with options Yes Yes Yes Yes Yes Pedestrian Walking Truck travel mode. Truck travel mode. Yes, with options Yes Yes Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options Avoidance, exclusion, and allow options Determines whether a specific set of features should be included, excluded, or avoided during route calculation. Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes, with options Yes, with options Yes, with options Yes, with options No Avoidance Features that are avoided on a best-case basis. If the router cannot find a valid route, the avoidance will be How (travel mode, avoidance, and exclusion) 581 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes, with options Yes, with options No No No Yes, with options Yes, with options Yes, with options Yes, with options No Parameter Exclusion Allow Descripti on ignored, and a notice will indicate that the avoidance could not be honored. Features that are strictly excluded. If the router cannot find a valid route with the exclusion options, no routes are returned. Features that need to be explicitly enabled. List of avoidance How (travel mode, avoidance, and exclusion) 582 Amazon Location Service Developer Guide Lists features that are avoided on a best-case basis. If the router cannot find a valid route, the avoidance will be ignored, and a notice will indicate that the avoidance could not be honored. Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Areas Areas to be avoided Yes, with options Yes, with options Yes, with options Yes, with options No with exceptions. Controlle d Access High- speed Highways roads with limited entry points. Car Shuttle Trains Trains transport Dirt Roads Ferries ing vehicles through tunnels. Unpaved roads with natural surfaces. Boats carrying vehicles across water bodies Yes Yes Yes Yes No Yes Yes Yes No No Yes Yes Yes Yes No Yes Yes Yes No No How (travel mode, avoidance, and exclusion) 583 Amazon Location Service Developer Guide Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To Road No No Yes Yes No No No Yes
amazon-location-developer-guide-117
amazon-location-developer-guide.pdf
117
with options Yes, with options Yes, with options Yes, with options No with exceptions. Controlle d Access High- speed Highways roads with limited entry points. Car Shuttle Trains Trains transport Dirt Roads Ferries ing vehicles through tunnels. Unpaved roads with natural surfaces. Boats carrying vehicles across water bodies Yes Yes Yes Yes No Yes Yes Yes No No Yes Yes Yes Yes No Yes Yes Yes No No How (travel mode, avoidance, and exclusion) 583 Amazon Location Service Developer Guide Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To Road No No Yes Yes No No No Yes Yes No Yes No Yes No No Yes Yes Yes Yes No Yes Yes Yes Yes No Boat Ferries Rail Ferries Seasonal Closure Tunnels Toll Road Ferries transport ing vehicles on rail tracks. Ferries transport ing vehicles on rail tracks. Roads closed during certain seasons. Undergrou nd passages for vehicular traffic. Roads requiring payment for access. How (travel mode, avoidance, and exclusion) 584 Amazon Location Service Developer Guide Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Toll Transpond Avoids roads Yes No Yes No No ers U-Turns Zone Categories where toll transpond ers are the only means of payment. Points allowing vehicles to turn in reverse direction. Zone categorie s to be avoided. List of exclusions Yes Yes Yes Yes No Yes Yes Yes No No Lists features that are strictly excluded. If the router cannot find a valid route with the exclusion options, no routes are returned. Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes Yes No Yes No Parameter Countries Descripti on Country Code 2 or Country Code 3 for countries How (travel mode, avoidance, and exclusion) 585 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Parameter Descripti on that should be strictly excluded from route calculati on. List of allow Lists features that need to be explicitly enabled for route calculation. Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes Yes Yes No No Yes Yes Yes No No Parameter HOV HOT Descripti on Enable use of high occupancy vehicle lanes for route calculati on. Enable use of high occupancy toll lanes for route calculati on. How (travel mode, avoidance, and exclusion) 586 Amazon Location Service Traffic awareness Developer Guide Determines the type of traffic-related information used during route calculation. Flow traffic represents congestion, excluding long-term incident-related congestion. The accuracy of flow traffic data decreases over time, making historical traffic data more reliable for past events. Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes Yes Yes Yes No Usage Enable or disable traffic data during route calculati on. When enabled, if Departure Time , ArrivalTi me , or DepartNow are not provided, only long- term closures will be considere d. Otherwise, if a time is provided, all traffic data is Traffic awareness 587 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To Road Yes Yes Yes No No Parameter Descripti on taken into account. FlowEvent Threshold Duration in seconds Override for which a flow traffic event is considere d valid. While valid, flow traffic data will be used over historica l traffic data. Optimize route and waypoint sequence Optimize routing Optimization criteria for when calculating a route. This can either be the fastest route measured by time or the shortest route measured by distance. Option Description Measurement Fastest Route Time Calculate the fastest route, focusing on minimizing travel time. This takes into account traffic conditions, road speed limits, and other factors. Optimize route and waypoint sequence 588 Amazon Location Service Developer Guide Option Description Measurement Shortest Route Distance Calculate the shortest route, minimizing the distance traveled. This is often used when distance is the key factor, such as reducing fuel costs or emissions. Optimize waypoint Optimization criteria for sequencing waypoints in a route. Driver schedule and notices Driver schedule Driver settings to define work and rest schedules. This is mandatory for many jurisdictions. Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To road Custom rest cycles Rest cycles defined Yes, with options No No No No by drive duration to be followed up with a rest duration. Any number of such cycles can be provided. Driver schedule and notices 589 Amazon Location Service Developer Guide Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To road Long rest cycle and Rest cycles defined by short rest short cycle No No No Yes, with options No cycle and long cycle. A short drive duration is followed by a short rest drive duration. Short drives can be repeated until a long drive duration is reached, at which point the long rest duration is enforced. Notices, warnings, and constraints Supplemental information that provides insight into
amazon-location-developer-guide-118
amazon-location-developer-guide.pdf
118
with a rest duration. Any number of such cycles can be provided. Driver schedule and notices 589 Amazon Location Service Developer Guide Parameter Descripti on Routes Routes Matrix Isoline Optimize Waypoint Snap To road Long rest cycle and Rest cycles defined by short rest short cycle No No No Yes, with options No cycle and long cycle. A short drive duration is followed by a short rest drive duration. Short drives can be repeated until a long drive duration is reached, at which point the long rest duration is enforced. Notices, warnings, and constraints Supplemental information that provides insight into decisions made during the route calculation. Driver schedule and notices 590 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To road Yes, with details No No No Yes No No No Yes, with details No Parameter Notices FailedCon straints Descripti on Notices regarding route calculati on. Additiona lly may include an impact for the notice indicatin g if the results of the route calculati on can be used as is or will need to be manually inspected before usage. Constrain ts that were provided in the request that could not be satisfied Driver schedule and notices 591 Amazon Location Service Developer Guide Routes Routes Matrix Isoline Optimize Waypoint Snap To road Parameter Descripti on , leading to failure of the optimizat ion problem. Route APIs Routes provide capabilities for calculating optimized paths between locations. These features support applications requiring logistics planning, distance calculations, and route optimization. Users can also snap location points to roads for improved accuracy. For more information, See Routes. • CalculateIsolines: Generates isolines based on travel time or distance, useful for defining service areas or reachability zones. For more information, See the section called “Calculate isolines”. • CalculateRouteMatrix: Provides a matrix of distances and travel times between multiple origins and destinations, supporting logistics and trip planning. For more information, See the section called “Calculate route matrix”. • CalculateRoutes: Calculates optimized routes for point-to-point or multi-stop navigation, including customizable routing preferences. For more information, See the section called “Calculate routes”. • OptimizeWaypoints: Optimizes the order of waypoints for the most efficient travel route, minimizing distance or time. For more information, See the section called “Optimize waypoints”. • SnapToRoads: Aligns coordinates to the nearest road paths, enhancing GPS accuracy by snapping points to known roads. For more information, See the section called “Snap to Roads”. The following table presents a number of business use cases that are best solved with Routes APIs. Route APIs 592 Amazon Location Service Developer Guide Business need Useful API Examples CalculateRoutes CalculateRoutes CalculateRoutes Calculate the travel distance and time for a origins and a destination Supports the following: • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find route polyline for a origins and a destination Supports the following: • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find routes turn by turn direction for an origin and a destination Supports the following: • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Route APIs 593 Amazon Location Service Developer Guide Business need Useful API Examples CalculateRoutes CalculateRoutes CalculateRoutes Find a route by departing now Supports the following: • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find a route if you depart at specific time Supports the following: • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find a route if you need to arrival at specific time Supports the following: • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Route APIs 594 Amazon Location Service Developer Guide Business need Useful API Examples Find shortest routes Supports the following: CalculateRoutes • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find fastest routes Supports the following: CalculateRoutes • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find alternative routes Supports the following: CalculateRoutes • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Route APIs 595 Amazon Location Service Developer Guide Business need Useful API Examples Find traffic
amazon-location-developer-guide-119
amazon-location-developer-guide.pdf
119
as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find fastest routes Supports the following: CalculateRoutes • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find alternative routes Supports the following: CalculateRoutes • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Route APIs 595 Amazon Location Service Developer Guide Business need Useful API Examples Find traffic aware routes Supports the following: CalculateRoutes • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find routes with avoidance such as toll, u-turn, ferry, highway, tunnel, and more Supports the following: • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find routes with custom avoidance by passing polyline or polygon Supports the following: • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time CalculateRoutes CalculateRoutes Route APIs 596 Amazon Location Service Developer Guide Business need Useful API Examples Calculate toll cost Supports the following: CalculateRoutes the section called “Calculate toll cost” • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Find speed limit of a road span on a route Supports the following: • travel modes, such as truck, pedestrian, car, and scooter • up to 25 waypoints (stop overs), including origin and destination • driving resting time Draw a route on a map Supports waypoint marking. Calculate route matrix of distance and time for multiple origins and destinations Supports the following: • more than 100K cells • travel modes, such as truck, pedestrian, car, and scooter CalculateRoutes GetTile and GetStyleD escriptor with rendering engine (MapLibre) with Calculate route CalculateRouteMatrix the section called “Calculate the route matrix for multiple origins and destinations” Route APIs 597 Amazon Location Service Developer Guide Business need Useful API Examples CalculateRouteMatrix the section called “Calculate route matrix with avoidance” CalculateIsoline the section called “Calculate a service area based on ranges of time” CalculateIsoline CalculateIsoline Calculate route matrix with avoidance Supports the following: • more than 100K cells • travel modes, such as truck, pedestrian, car, and scooter Calculate a service area based on time (isochrones) Supports travel modes, such as truck, pedestrian, car, and scooter. Calculate a service area based on distance (isodista nce) Supports travel modes, such as truck, pedestrian, car, and scooter. Calculate a service area with avoidance Supports travel modes, such as truck, pedestrian, car, and scooter. Calculate a service area from reverse direction CalculateIsoline Supports travel modes, such as truck, pedestrian, car, and scooter. Route APIs 598 Amazon Location Service Developer Guide Business need Useful API Examples CalculateIsoline OptimizeWaypoint the section called “Optimize waypoints for a route” Calculate service area for multi-range of time or distance Supports travel modes, such as truck, pedestrian, car, and scooter. Optimize waypoints for routes (traveling salesman problem) Supports travel modes, such as truck, pedestrian, car, and scooter. Optimize waypoints for a route with traffic awareness OptimizeWaypoint Supports travel modes, such as truck, pedestrian, car, and scooter. Optimize waypoints for a route with access hour awareness Supports travel modes, such as truck, pedestrian, car, and scooter. Match GPS traces to road network Supports travel modes, such as truck, pedestrian, car, and scooter. OptimizeWaypoint Snap to road the section called “Match GPS traces to road network” Route APIs 599 Amazon Location Service Developer Guide Business need Useful API Examples GetStyleDescriptor with rendering engine (MapLibre) with Snap to road Visualize matched GPS traces on a map Supports travel modes, such as truck, pedestrian, car, and scooter. Calculate routes The Routes API calculates routes between two or more locations with or without avoidances for different travel modes such as car, truck, scooter, and pedestrian. With this API, you can customize routing options and request additional route-related information to meet specific needs. This API supports turn-by-turn navigation and customizes route calculations by applying parameters like avoiding toll roads, motorways, or ferries. The API also returns speed limits and toll costs. Calculate routes 600 Amazon Location Service Use cases Developer Guide • Display geographic details on a route map: Use advanced mapping features to visualize detailed routes with rich geographic information, including landmarks, terrain, and urban infrastructure. Enhance decision-making by allowing users to view clear routes from their starting point to their destination. This feature can support navigation, planning, and various logistics scenarios, and display routes for travel
amazon-location-developer-guide-120
amazon-location-developer-guide.pdf
120
information to meet specific needs. This API supports turn-by-turn navigation and customizes route calculations by applying parameters like avoiding toll roads, motorways, or ferries. The API also returns speed limits and toll costs. Calculate routes 600 Amazon Location Service Use cases Developer Guide • Display geographic details on a route map: Use advanced mapping features to visualize detailed routes with rich geographic information, including landmarks, terrain, and urban infrastructure. Enhance decision-making by allowing users to view clear routes from their starting point to their destination. This feature can support navigation, planning, and various logistics scenarios, and display routes for travel modes such as cars, trucks, scooters, and pedestrians. Customize routes by adding elements like avoidances or toll calculations. • Show turn-by-turn navigation: Provide seamless navigation support on web and mobile devices. Users can access turn-by-turn directions, ensuring efficient travel. Both platforms can leverage navigation instructions to offer routes for personal or business travel, including speed limits. • Calculate toll costs along routes: Incorporate toll cost calculations into route planning to provide accurate pricing estimates for routes that include toll roads, bridges, or tunnels. Display toll costs upfront to help drivers and planners make cost-effective decisions and avoid tolls when necessary. • Ensure compliance with speed limits: Integrate speed limit data to help drivers stay within legal limits, reducing the risk of fines and promoting safer, fuel-efficient driving. Logistics and fleet management can also benefit by monitoring speed compliance in real time. • Assist with freight and vehicle routing solutions: Simplify freight and vehicle routing operations by integrating routes, navigation, and tracking capabilities into logistics portals. Efficiently plan routes for multiple deliveries, track shipments in real-time, and manage fuel costs through better routing. Understand the request The request requires Origin and Destination parameters, while optional parameters like Allow, Avoid, and Traffic customize the route to meet specific needs and constraints. . Origin The start position of the route in longitude and latitude. Destination The end position of the route. Waypoints Intermediate positions to include along a route between the start and end positions. Calculate routes 601 Amazon Location Service OptimizeRoutingFor Developer Guide Optimization criteria for the route, such as fastest or shortest. LegGeometryFormat Format of the geometry returned for each route leg. Avoid Features to be avoided during route calculation, ignored if no alternative route is found. Traffic Traffic-related options affecting route calculation. Tolls Toll-related options impacting route calculations and toll costs. LegAdditionalFeatures Features that can be enabled within the response for each leg of the journey. SpanAdditionalFeatures Span features that can be enabled within the response for each leg of the journey. Understand the response The response provides route details such as the legs of the journey, notices about route calculations, and summary information including distance and duration. . Routes Array of routes containing legs and associated properties. Notices Warnings or informational messages about the route. LegGeometryFormat Specifies the format of the route's geometry. Calculate routes 602 Amazon Location Service Leg details Developer Guide Each leg of a journey can be of type Ferry, Pedestrian, or Vehicle depending on the transport mode. While each leg contains properties agnostic to transport mode, specific properties can be found under: FerryLegDetails Ferry-specific properties for the leg. VehicleLegDetails Vehicle-specific properties for the leg. PedestrianLegDetails Pedestrian-specific properties for the leg. Steps Each leg of a journey is divided into steps that describe actions for portions of the route. A step can be either Default, suitable for basic applications, or TurnByTurn, suitable for turn-by-turn navigation. Each step contains properties agnostic to step type, such as duration and distance, and other specific properties like ExitStepDetails, which applies only to exit steps. BeforeTravelSteps Steps to perform before beginning the journey. TravelSteps Steps to perform during the journey. AfterTravelSteps Steps to perform after completing the journey. Spans Each leg of a journey can be split into spans. A span is a portion of the leg with the same values for the set of requested SpanAdditionalFeatures. Spans are divided by road properties such as SpeedLimit, road names, or regions. Returned spans can be used to visualize road attributes and access-related information. Calculate routes 603 Amazon Location Service Calculate toll cost Developer Guide This topic provides an overview of the fields and definitions associated with calculating toll costs. Using these fields, you can specify parameters such as payment methods, currency, and vehicle characteristics to customize toll cost calculations. Field name Transponders Vignettes Currency EmissionType VehicleCategory Definitions Routes Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options This section provides brief definitions for each field used in toll cost calculation. Transponders Transponders are a method of payment for tolls, potentially resulting in a different price compared to other payment methods. Vignettes A vignette is a form of road pricing. When a user has the required vignette,
amazon-location-developer-guide-121
amazon-location-developer-guide.pdf
121
and definitions associated with calculating toll costs. Using these fields, you can specify parameters such as payment methods, currency, and vehicle characteristics to customize toll cost calculations. Field name Transponders Vignettes Currency EmissionType VehicleCategory Definitions Routes Yes, with options Yes, with options Yes, with options Yes, with options Yes, with options This section provides brief definitions for each field used in toll cost calculation. Transponders Transponders are a method of payment for tolls, potentially resulting in a different price compared to other payment methods. Vignettes A vignette is a form of road pricing. When a user has the required vignette, no additional toll payments are necessary. Currency The currency in which toll costs are reported. In addition to the local currency, a converted currency is included, which also impacts the currency used in the toll summary within the response. EmissionType The emission type of the vehicle, used for calculating toll costs based on vehicle emissions. Calculate routes 604 Amazon Location Service VehicleCategory The vehicle sub-category used for toll cost calculation. Understanding route steps Developer Guide This section defines various actions and steps that need to be taken to complete a leg of a journey. Route steps vary by travel mode and provide guidance for both overview applications and detailed turn-by-turn navigation. Route steps overview The following types of route steps define the actions needed to complete a route leg, varying by travel mode and the stage of the journey. Step type Description Default steps Basic steps providing human-readable instructions, often used in web- based applications to offer an overview of the route. Turn by turn steps Detailed steps for creating a turn-by-turn navigation application, offering more granular directions. Before travel steps Steps that need to be completed before starting the travel section, such as boarding a ferry. After travel steps Steps to be performed after the travel section is complete, like de- boarding a ferry. Step breakdown by travel mode Section Vehicle Vehicle Vehicle Step Arrive Continue ContinueH ighway Before Travel Travel After Travel No No No Yes Yes Yes No No No Calculate routes 605 Amazon Location Service Developer Guide Section Step Before Travel Travel After Travel Vehicle Vehicle Depart Exit Pedestrian Arrive Pedestrian Charge Ferry Ferry Ferry Wait Board Deboard Calculate route matrix No No No No No Yes No Yes Yes Yes Yes No No No No No No No Yes No Yes The Matrix Routing service calculates routing matrices, providing travel times or distances between multiple origins and destinations. This service offers flexible customization options, allowing you to specify travel modes, traffic conditions, and other routing parameters. The matrix calculations can vary in size and shape, supporting both square and non-square matrices, and accommodate dynamic or free-flow traffic data. Use cases • Optimize delivery routes for logistics and e-commerce: Efficiently calculate travel time and distance between multiple pickup and delivery locations to optimize routes. Logistics companies can use this feature to minimize costs and delivery time by planning efficient paths across cities. It is ideal for setting optimized delivery windows for same-day or next-day services and planning multi-stop delivery routes. • Match drivers and passengers in ride-sharing applications: Use route calculations to match drivers with the closest passengers by finding the fastest route between locations. Ride-sharing apps can enhance user experience by providing real-time driver arrival estimates, ensuring prompt pickups and drop-offs. Supports various transportation modes like cars, bikes, and scooters. • Plan and optimize routes for fleet management: Manage large fleets by optimizing routes to reduce fuel consumption and travel time. Fleet managers can assign the most efficient routes to vehicles for multiple stops, thereby increasing overall operational efficiency. Use cases include Calculate route matrix 606 Amazon Location Service Developer Guide service fleets, transportation companies, and utilities where optimal route planning is essential for site visits. Understand the request The request includes Origins and Destinations for route calculations, with optional parameters to tailor the matrix based on preferences and constraints. For more details, refer to the API Reference for Calculate Route Matrix API. • Origins: List of origin coordinates in longitude and latitude. • Destinations: List of destination coordinates. • OptimizeRoutingFor: Optimization criteria such as "Fastest" or "Shortest" route. • RoutingBoundary: Defines boundaries for calculation, either as "Unbounded" or restricted to a specific geometry. • Avoid: Features to avoid during route calculation. Ignored if no viable route can be found. • Traffic: Traffic-related options impacting route calculations. Understand the response The response includes a matrix of calculated routes between origins and destinations, with details such as distance and duration. Errors and boundaries for the routes are also provided, if applicable. Refer to the API Reference for additional details on the Calculate Route Matrix API. • RouteMatrix: Matrix containing travel distances and durations between origins and destinations. • ErrorCount: Number of errors encountered during route calculations.
amazon-location-developer-guide-122
amazon-location-developer-guide.pdf
122
either as "Unbounded" or restricted to a specific geometry. • Avoid: Features to avoid during route calculation. Ignored if no viable route can be found. • Traffic: Traffic-related options impacting route calculations. Understand the response The response includes a matrix of calculated routes between origins and destinations, with details such as distance and duration. Errors and boundaries for the routes are also provided, if applicable. Refer to the API Reference for additional details on the Calculate Route Matrix API. • RouteMatrix: Matrix containing travel distances and durations between origins and destinations. • ErrorCount: Number of errors encountered during route calculations. • RoutingBoundary: Boundary within which the matrix is calculated. Calculate isolines The Calculate Isolines API allows you to determine areas reachable within specified time or distance limits. By considering factors such as road restrictions, traffic conditions, and travel mode, it generates isolines that outline accessible areas, supporting urban planning, logistics, and service accessibility applications. This API can be used for urban planning, real estate analysis, and accessibility studies by visualizing service reach, transportation options, or resources within a set Calculate isolines 607 Amazon Location Service Developer Guide timeframe or distance limit. By displaying these isolines on a map, users can assess travel reach within specific constraints, enhancing decision-making for site selection, service coverage, and resource allocation. Use cases • Assess healthcare accessibility through travel time isolines: Generate isolines to evaluate access to healthcare facilities from various neighborhoods based on travel times. Healthcare organizations can use this feature to identify underserved areas and make informed decisions about clinic locations or mobile health services, thereby improving community healthcare access. • Analyze market reach for retail expansion using travel time isolines: Create isolines to represent customer access to retail locations based on travel times. Retail businesses can assess new store locations and understand customer demographics, using these visualizations to strategically expand and optimize sales potential. • Optimize logistics and delivery zones with isolines: Generate isolines to define delivery zones based on time-sensitive logistics requirements. Logistics companies can visualize areas reachable within specific timeframes from distribution centers, improving route planning, operational efficiency, and timely deliveries. • Plan tourism and recreational access with isolines: Visualize travel times from tourist attractions to nearby accommodations. Tourism boards can help travelers find convenient lodging options, promoting local businesses and enhancing the travel experience by displaying these isolines on a map. • Improve emergency response planning through isolines: Generate isolines to assess response times from emergency service locations to various areas in a community. Emergency management teams can identify regions within critical response times, optimizing resource allocation to improve response during incidents. • Analyze commuting patterns for workforce planning with isolines: Generate isolines to visualize commuting times and identify areas with high travel times. Businesses can use these insights for remote work policies or office relocations, enhancing employee satisfaction and productivity. Understand the request The request accepts parameters like Origin, Destination, and Thresholds for defining isolines. Optional parameters, such as Allow, Avoid, and TravelModeOptions, allow customization of isoline constraints. For more information, see the . Calculate isolines 608 Amazon Location Service Origin Developer Guide The starting point for isoline calculation in longitude and latitude. Thresholds Time or distance limits used to define the isoline boundary. TravelMode The mode of transport, such as car, pedestrian, or truck. OptimizeIsolineFor Optimization criteria, such as Accurate, Balanced, or Fast calculation. DepartureTime Time of departure, if specified, for calculating time-dependent isolines. ArrivalTime Time of arrival, if specified, for calculating time-dependent isolines. IsolineGranularity The maximum number of points and resolution of the isoline boundary. Understand the response The response includes isolines with properties like IsolineGeometryFormat, outlining the reachable area based on request parameters. . Isolines Calculated isolines with associated properties, including geometries and connections. Geometries List of geometries outlining the calculated isoline boundaries. Connections Connections between isoline geometries, including the geometry for each connection. Calculate isolines 609 Amazon Location Service Optimize waypoints Developer Guide The Optimize Waypoints API calculates the most efficient sequence for visiting multiple waypoints along a route. Using advanced algorithms, this API minimizes travel time and distance while considering factors such as traffic conditions, avoidances, and vehicle specifications. Integrating the Optimize Waypoints API helps businesses streamline operations, reduce fuel consumption, enhance delivery efficiency, and improve customer satisfaction. The API provides optimized routes, enabling better decision-making and resource allocation in multi-stop travel scenarios. Use cases • Enhance multi-stop delivery efficiency: Efficiently optimize the sequence of multiple delivery stops to reduce travel time and costs. Delivery services can streamline operations by calculating the most efficient route for drivers, minimizing fuel expenses and ensuring timely deliveries, which improves customer satisfaction and operational efficiency. • Streamline field service operations: Optimize the sequence of visits to multiple job sites in a single day, reducing travel time for field service technicians. This allows companies to complete more jobs
amazon-location-developer-guide-123
amazon-location-developer-guide.pdf
123
efficiency, and improve customer satisfaction. The API provides optimized routes, enabling better decision-making and resource allocation in multi-stop travel scenarios. Use cases • Enhance multi-stop delivery efficiency: Efficiently optimize the sequence of multiple delivery stops to reduce travel time and costs. Delivery services can streamline operations by calculating the most efficient route for drivers, minimizing fuel expenses and ensuring timely deliveries, which improves customer satisfaction and operational efficiency. • Streamline field service operations: Optimize the sequence of visits to multiple job sites in a single day, reducing travel time for field service technicians. This allows companies to complete more jobs daily, enhancing productivity and service delivery. • Plan efficient tour routes for travel agencies: Optimize itineraries that include multiple attractions to maximize sightseeing while minimizing travel time. Travel agencies can use this feature to create optimal plans for guided tours, enhancing the overall tourist experience by making better use of available time. • Improve ride-sharing driver efficiency: Optimize pick-up and drop-off sequences for multiple passengers, reducing wait times and enhancing the rider experience. Ride-sharing services can maximize driver earnings and ensure timely service for passengers by optimizing waypoints. • Optimize routes for waste collection services: Plan garbage collection routes to minimize travel distance and time, which helps waste management companies streamline operations and ensure timely collection, achieving cost savings and reducing environmental impact. • Coordinate logistics for events and conferences: Manage transportation logistics for delivering equipment and supplies to multiple venues, optimizing loading and unloading routes. This allows event planners to streamline transportation, reduce delays, and ensure timely material arrival for events. • Enhance emergency response routes: Plan the fastest routes to multiple emergencies, optimizing response times in critical situations. Emergency services can improve response efficiency, potentially saving lives by using optimized waypoints. Optimize waypoints 610 Amazon Location Service Developer Guide • Facilitate sales route planning for field representatives: Optimize routes for sales representatives visiting multiple clients in a day, minimizing travel time and maximizing client visits. This helps companies increase productivity and capitalize on more sales opportunities. Understand the request The request requires parameters like Origin and Waypoints to calculate an optimized sequence. Optional parameters like Avoid, Traffic, and Driver allow additional customization. Waypoints A list of waypoints to be optimized in sequence. Origin The starting position of the route for optimization. Destination An optional end position of the route for optimization. OptimizeSequencingFor Criteria for sequencing optimization, such as fastest or shortest route. Traffic Traffic-related options affecting route calculation. Driver Driver work and rest cycles to ensure compliance with regional driving regulations. Clustering Clustering allows you to specify how nearby waypoints can be clustered to improve the optimized sequence. Each waypoint can also specify constraints that must be satisfied, such as AppointmentTime, AccessHours, and ordering constraints like Before another waypoint. Understand the response The response provides details of the optimized waypoint sequence, including OptimizedWaypoints and the overall Distance and Duration for the journey. Optimize waypoints 611 Amazon Location Service OptimizedWaypoints A list of waypoints in their optimized order. ImpedingWaypoints Developer Guide Waypoints that prevent an optimized sequence, including failed constraints that were not met. Connections Details about travel between waypoints, including distance and duration. TimeBreakdown Breakdown of total Travel, Rest, Service, and Wait durations for the route. ClusterIndex Index of the cluster the waypoint is associated with. The index is included in the response only if clustering was performed while processing the request. Snap to Roads The Snap to Road API enhances the accuracy of geographic positioning by aligning GPS coordinates to the nearest road segments on a digital map. This API takes raw longitude and latitude data, often collected from mobile devices or vehicles, and "snaps" these points to the corresponding road network, correcting inaccuracies caused by GPS drift or signal loss. By integrating the Snap to Road API, you can ensure your applications provide reliable and accurate data, supporting better decision-making and operational efficiency across various scenarios. Use cases • Enhance navigation accuracy by snapping to the road network: Efficiently align GPS coordinates to the nearest road segments to improve navigation accuracy. This feature is valuable for mapping and navigation services, providing users with precise directions and real- time location updates, thus enhancing the navigation experience. • Improve data accuracy for fleet management applications: Correct the reported positions of vehicles by snapping their GPS coordinates to the closest roadways. In fleet management systems, this feature ensures accurate vehicle tracking, enabling optimized logistics and better operational efficiency. Snap to Roads 612 Amazon Location Service Understand the request Developer Guide The request requires TracePoints to match to roads, with optional parameters like SnappedGeometryFormat and SnapRadius for controlling geometry format and snapping radius. . TracePoints A list of coordinates to be snapped to the road network. SnappedGeometryFormat The format of the returned geometry, such as "FlexiblePolyline" or "Simple". SnapRadius The
amazon-location-developer-guide-124
amazon-location-developer-guide.pdf
124
Improve data accuracy for fleet management applications: Correct the reported positions of vehicles by snapping their GPS coordinates to the closest roadways. In fleet management systems, this feature ensures accurate vehicle tracking, enabling optimized logistics and better operational efficiency. Snap to Roads 612 Amazon Location Service Understand the request Developer Guide The request requires TracePoints to match to roads, with optional parameters like SnappedGeometryFormat and SnapRadius for controlling geometry format and snapping radius. . TracePoints A list of coordinates to be snapped to the road network. SnappedGeometryFormat The format of the returned geometry, such as "FlexiblePolyline" or "Simple". SnapRadius The radius around trace points within which road snapping is considered. Understand the response The response contains corrected geometry and snapped trace points, with properties like SnappedGeometry and SnappedTracePoints to indicate accuracy and snapping confidence. . SnappedGeometry The corrected geometry of the snapped route. SnappedTracePoints The adjusted coordinates of the trace points snapped to roads. Notices Warnings or informational messages about the snapping process. How to This section provides guides for leveraging the Routes APIs to solve routing and navigation challenges. These tutorials cover the essential tasks for integrating routing functionality into your applications. Each topic focuses on a specific use case, enabling you to efficiently implement advanced routing features tailored to your business needs. Topics How to 613 Amazon Location Service Developer Guide • Learn how to use CalculateRoutes • Learn how to use CalculateIsolines • Learn how to use CalculateRouteMatrix • Learn how to use OptimizeWaypoints • Learn how to use SnapToRoads Learn how to use CalculateRoutes This section provides step-by-step instructions for using CalculateRoutes. This topic details guidance on finding routes with specific configurations, such as incorporating turn-by-turn navigation, setting travel modes, and adding waypoints. Topics • How to find a route for an origin and destination • How to find routes with turn-by-turn directions • How to find a speed limit for a road span • How to find alternate routes • How to calculate the tolls for a route • How to create routes with custom avoidance • How to create routes with custom avoidance of several potential items • How to find the fastest route • How to find the shortest routes How to find a route for an origin and destination The CalculateRoutes API helps you find the best routes between origin and destination, as well as the best opportunities for driver resting. It supports travel modes such as truck, pedestrian, car and scooter. It also supports up to 25 waypoints (stopovers) including the origin and destination with only a few constraints. Potential use cases • Find point-to-point routes: Determine the best route between two locations based on various travel modes and additional options. Use CalculateRoutes 614 Amazon Location Service Examples Developer Guide Calculate routes from origin to destination using Car TravelMode Sample request { "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ] } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.020098, 49.232872 ], "Position": [ -123.0203051, 49.2328499 Use CalculateRoutes 615 Amazon Location Service Developer Guide ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.1181051, 49.282423 ], "Position": [ -123.1180883, 49.2824349 ] } }, "TravelSteps": [ { "Distance": 1288, "Duration": 102, "Type": "Depart" }, { "Distance": 262, "Duration": 24, "Type": "Ramp" }, { "Distance": 1356, "Duration": 134, "Type": "Turn" }, { "Distance": 7092, "Duration": 568, "Type": "Keep" }, { "Distance": 65, "Duration": 26, "Type": "Turn" }, { "Distance": 50, Use CalculateRoutes 616 Amazon Location Service Developer Guide "Duration": 18, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "Type": "Arrive" } ] } } ] } ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ] }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.118105 49.282423 \ --destination -123.020098 49.232872 How to find routes with turn-by-turn directions The CalculateRoutes API helps you to find the best routes between origin and destination, as well as the best opportunities for driver resting. It supports travel modes such as car, truck, pedestrian Use CalculateRoutes 617 Amazon Location Service Developer Guide and scooter. It also supports up to 25 waypoints (stopovers) including the origin and destination, with only a few constraints. Potential use cases • Create a navigation mobile app: Use the API to get turn-by-turn navigation instructions. • Display directions on a web platform: Show detailed route guidance for web applications to assist you with navigation. Examples Calculate routes using Car TravelMode Sample request { "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelStepType": "TurnByTurn", "TravelMode": "Car" } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes":
amazon-location-developer-guide-125
amazon-location-developer-guide.pdf
125
as car, truck, pedestrian Use CalculateRoutes 617 Amazon Location Service Developer Guide and scooter. It also supports up to 25 waypoints (stopovers) including the origin and destination, with only a few constraints. Potential use cases • Create a navigation mobile app: Use the API to get turn-by-turn navigation instructions. • Display directions on a web platform: Show detailed route guidance for web applications to assist you with navigation. Examples Calculate routes using Car TravelMode Sample request { "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelStepType": "TurnByTurn", "TravelMode": "Car" } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", Use CalculateRoutes 618 Amazon Location Service Developer Guide "VehicleLegDetails": { "Arrival": { "Place": { "Position": [-123.0203051, 49.2328499] } }, "Departure": { "Place": { "Position": [-123.1180883, 49.2824349] } }, "TravelSteps": [ { "Distance": 1288, "Duration": 102, "Type": "Depart", "NextRoad": { "RoadName": "W Georgia St", "RouteNumber": "HWY-1A" } }, { "Distance": 262, "Duration": 24, "Type": "Keep", "NextRoad": { "RoadName": "Main St", "RouteNumber": "HWY-1A" } }, { "Distance": 1356, "Duration": 134, "Type": "Turn", "NextRoad": { "RoadName": "Main St", "RouteNumber": "HWY-1A" } }, { "Distance": 7092, "Duration": 568, "Type": "Keep", "NextRoad": { Use CalculateRoutes 619 Amazon Location Service Developer Guide "RoadName": "Kingsway", "RouteNumber": "HWY-1A" } }, { "Distance": 65, "Duration": 26, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "Type": "Arrive" } ] } } ] } ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelStepType": "TurnByTurn", "TravelMode": "Car" }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ Use CalculateRoutes 620 Amazon Location Service Developer Guide --origin -123.118105 49.282423 \ --destination -123.020098 49.232872 \ --travel-step-type "TurnByTurn" \ --travel-mode "Car" How to find a speed limit for a road span The CalculateRoutes API helps you to find the best routes between origin and destination, as well as the best opportunities for driver resting. It supports travel modes such as car, truck, pedestrian and scooter. It also supports up to 25 waypoints (stopovers) including the origin and destination, with only a few constraints. Potential use cases • Audit speed limit compliance: Stays aware of speed limits and compliance to them. • Inform the driver of the speed limit: Notifies the driver of the speed limit when it might not be clear otherwise. Examples Find speed limits in Car TravelMode Sample request { "Origin": [ 13.055211, 52.704802 ], "Destination": [ 13.551910, 52.282705 ], "TravelMode": "Car", "SpanAdditionalFeatures": ["SpeedLimit"] } Sample response { Use CalculateRoutes 621 Amazon Location Service Developer Guide "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ 13.55191, 52.282705 ], "Position": [ 13.5507836, 52.2859121 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ 13.055211, 52.704802 ], "Position": [ 13.0555036, 52.7056073 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [ { Use CalculateRoutes 622 Amazon Location Service Developer Guide "GeometryOffset": 0, "SpeedLimit": { "Unlimited": true } }, { "GeometryOffset": 151, "SpeedLimit": { "MaxSpeed": 120.00000762939453 } }, { "GeometryOffset": 167, "SpeedLimit": { "MaxSpeed": 80 } }, { "GeometryOffset": 195, "SpeedLimit": { "MaxSpeed": 120.00000762939453 } }, { "GeometryOffset": 220, "SpeedLimit": { "Unlimited": true } }, { "GeometryOffset": 356, "SpeedLimit": { "MaxSpeed": 120.00000762939453 } }, { "GeometryOffset": 358, "SpeedLimit": { "MaxSpeed": 100 } }, { "GeometryOffset": 368, "SpeedLimit": { Use CalculateRoutes 623 Amazon Location Service Developer Guide "MaxSpeed": 80 } }, { "GeometryOffset": 384, "SpeedLimit": { "MaxSpeed": 60.000003814697266 } }, { "GeometryOffset": 639, "SpeedLimit": { "MaxSpeed": 80 } }, { "GeometryOffset": 701, "SpeedLimit": { "MaxSpeed": 60.000003814697266 } }, { "GeometryOffset": 726, "SpeedLimit": { "MaxSpeed": 80 } }, { "GeometryOffset": 805, "SpeedLimit": { "MaxSpeed": 60.000003814697266 } }, { "GeometryOffset": 839, "SpeedLimit": { "MaxSpeed": 80 } }, { "GeometryOffset": 1384, "SpeedLimit": { "MaxSpeed": 60.000003814697266 } Use CalculateRoutes 624 Amazon Location Service Developer Guide }, { "GeometryOffset": 1393, "SpeedLimit": { "MaxSpeed": 50 } }, { "GeometryOffset": 1443, "SpeedLimit": { "MaxSpeed": 30.000001907348633 } }, { "GeometryOffset": 1454, "SpeedLimit": { "MaxSpeed": 50 } }, { "GeometryOffset": 1504, "SpeedLimit": { "MaxSpeed": 60.000003814697266 } }, { "GeometryOffset": 1513, "SpeedLimit": { "MaxSpeed": 80 } }, { "GeometryOffset": 1516, "SpeedLimit": { "MaxSpeed": 60.000003814697266 } }, { "GeometryOffset": 1555, "SpeedLimit": { "MaxSpeed": 80 } }, { Use CalculateRoutes 625 Amazon Location Service Developer Guide "GeometryOffset": 1748, "SpeedLimit": { "MaxSpeed": 120.00000762939453 } }, { "GeometryOffset": 1904, "SpeedLimit": { "MaxSpeed": 100 } }, { "GeometryOffset": 1945, "SpeedLimit": { "Unlimited": true } }, { "GeometryOffset": 2006, "SpeedLimit": { "MaxSpeed": 70 } }, { "GeometryOffset": 2017, "SpeedLimit": { "MaxSpeed": 50 } }, { "GeometryOffset": 2033, "SpeedLimit": { "MaxSpeed": 30.000001907348633 } } ], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 9099, "Duration": 262, "ExitNumber": [], "GeometryOffset":
amazon-location-developer-guide-126
amazon-location-developer-guide.pdf
126
{ "MaxSpeed": 80 } }, { "GeometryOffset": 1516, "SpeedLimit": { "MaxSpeed": 60.000003814697266 } }, { "GeometryOffset": 1555, "SpeedLimit": { "MaxSpeed": 80 } }, { Use CalculateRoutes 625 Amazon Location Service Developer Guide "GeometryOffset": 1748, "SpeedLimit": { "MaxSpeed": 120.00000762939453 } }, { "GeometryOffset": 1904, "SpeedLimit": { "MaxSpeed": 100 } }, { "GeometryOffset": 1945, "SpeedLimit": { "Unlimited": true } }, { "GeometryOffset": 2006, "SpeedLimit": { "MaxSpeed": 70 } }, { "GeometryOffset": 2017, "SpeedLimit": { "MaxSpeed": 50 } }, { "GeometryOffset": 2033, "SpeedLimit": { "MaxSpeed": 30.000001907348633 } } ], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 9099, "Duration": 262, "ExitNumber": [], "GeometryOffset": 0, Use CalculateRoutes 626 Amazon Location Service Developer Guide "Type": "Depart" }, { "Distance": 18849, "Duration": 800, "ExitNumber": [], "GeometryOffset": 162, "KeepStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Keep" }, { "Distance": 4290, "Duration": 212, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 701, "Type": "Exit" }, { "Distance": 14418, "Duration": 651, "ExitNumber": [], "GeometryOffset": 828, "Type": "Continue" }, { "Distance": 1255, "Duration": 62, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 1359, "Type": "Exit" }, { "Distance": 1607, Use CalculateRoutes 627 Amazon Location Service Developer Guide "Duration": 139, "ExitNumber": [], "GeometryOffset": 1393, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 934, "Duration": 92, "ExitNumber": [], "GeometryOffset": 1442, "Type": "Continue" }, { "Distance": 320, "Duration": 27, "ExitNumber": [], "GeometryOffset": 1473, "Type": "Continue" }, { "Distance": 320, "Duration": 33, "ExitNumber": [], "GeometryOffset": 1491, "Type": "Continue" }, { "Distance": 17863, "Duration": 680, "ExitNumber": [], "GeometryOffset": 1504, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 2888, Use CalculateRoutes 628 Amazon Location Service Developer Guide "Duration": 95, "ExitNumber": [], "GeometryOffset": 1917, "Type": "Continue" }, { "Distance": 321, "Duration": 28, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 1977, "Type": "Exit" }, { "Distance": 549, "Duration": 41, "ExitNumber": [], "GeometryOffset": 2006, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 386, "Duration": 51, "ExitNumber": [], "GeometryOffset": 2023, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 98, "Duration": 15, "ExitNumber": [], Use CalculateRoutes 629 Amazon Location Service Developer Guide "GeometryOffset": 2033, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 2036, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "de", "Value": "A111" } }, { "RouteNumber": { "Language": "de", "Value": "A113" } } ] } ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ Use CalculateRoutes 630 Amazon Location Service Developer Guide --header 'Content-Type: application/json' \ --data '{ "Origin": [ 13.055211, 52.704802 ], "Destination": [ 13.551910, 52.282705 ], "TravelMode": "Car", "SpanAdditionalFeatures": ["SpeedLimit"] }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin 13.055211 52.704802 \ --destination 13.551910 52.282705 \ --travel-mode "Car" \ --span-additional-features "SpeedLimit" How to find alternate routes The CalculateRoutes API helps you to find the best routes between origin and destination, as well as the best opportunities for driver resting. It supports travel modes such as car, truck, pedestrian and scooter. It also supports up to 25 waypoints (stopovers) including the origin and destination, with only a few constraints. Potential use cases • Identify alternate routes: Be able to pick the best route to suit your business needs. Examples Find alternate routes in Car TravelMode Sample request { "Origin": [ Use CalculateRoutes 631 Amazon Location Service Developer Guide 13.055211, 52.704802 ], "Destination": [ 13.551910, 52.282705 ], "TravelMode": "Car", "MaxAlternatives": 2 } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ 13.55191, 52.282705 ], "Position": [ 13.5507836, 52.2859121 ] } }, "Departure": { "Place": { "ChargingStation": false, Use CalculateRoutes 632 Amazon Location Service Developer Guide "OriginalPosition": [ 13.055211, 52.704802 ], "Position": [ 13.0555036, 52.7056073 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 9099, "Duration": 262, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 18849, "Duration": 800, "ExitNumber": [], "GeometryOffset": 162, "KeepStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Keep" }, { "Distance": 4290, "Duration": 212, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 701, Use CalculateRoutes 633 Amazon Location Service Developer Guide "Type": "Exit" }, { "Distance": 14418, "Duration": 651, "ExitNumber": [], "GeometryOffset": 828, "Type": "Continue" }, { "Distance": 1255, "Duration": 62, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 1359, "Type": "Exit" }, { "Distance": 1607, "Duration": 139, "ExitNumber": [], "GeometryOffset": 1393, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 934, "Duration": 92, "ExitNumber": [], "GeometryOffset": 1442, "Type": "Continue" }, { "Distance": 320, "Duration": 27, "ExitNumber": [], "GeometryOffset":
amazon-location-developer-guide-127
amazon-location-developer-guide.pdf
127
}, { "Distance": 4290, "Duration": 212, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 701, Use CalculateRoutes 633 Amazon Location Service Developer Guide "Type": "Exit" }, { "Distance": 14418, "Duration": 651, "ExitNumber": [], "GeometryOffset": 828, "Type": "Continue" }, { "Distance": 1255, "Duration": 62, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 1359, "Type": "Exit" }, { "Distance": 1607, "Duration": 139, "ExitNumber": [], "GeometryOffset": 1393, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 934, "Duration": 92, "ExitNumber": [], "GeometryOffset": 1442, "Type": "Continue" }, { "Distance": 320, "Duration": 27, "ExitNumber": [], "GeometryOffset": 1473, Use CalculateRoutes 634 Amazon Location Service Developer Guide "Type": "Continue" }, { "Distance": 320, "Duration": 33, "ExitNumber": [], "GeometryOffset": 1491, "Type": "Continue" }, { "Distance": 17863, "Duration": 680, "ExitNumber": [], "GeometryOffset": 1504, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 2888, "Duration": 95, "ExitNumber": [], "GeometryOffset": 1917, "Type": "Continue" }, { "Distance": 321, "Duration": 28, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 1977, "Type": "Exit" }, { "Distance": 549, "Duration": 41, "ExitNumber": [], "GeometryOffset": 2006, "TurnStepDetails": { Use CalculateRoutes 635 Amazon Location Service Developer Guide "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 386, "Duration": 51, "ExitNumber": [], "GeometryOffset": 2023, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 98, "Duration": 15, "ExitNumber": [], "GeometryOffset": 2033, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 2036, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ Use CalculateRoutes 636 Developer Guide Amazon Location Service { "RouteNumber": { "Language": "de", "Value": "A111" } }, { "RouteNumber": { "Language": "de", "Value": "A113" } } ] }, { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ 13.55191, 52.282705 ], "Position": [ 13.5507836, 52.2859121 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ 13.055211, 52.704802 ], Use CalculateRoutes 637 Amazon Location Service Developer Guide "Position": [ 13.0555036, 52.7056073 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 91047, "Duration": 2880, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 3496, "Duration": 119, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 1473, "Type": "Exit" }, { "Distance": 321, "Duration": 28, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 1565, "Type": "Exit" }, { "Distance": 549, Use CalculateRoutes 638 Amazon Location Service Developer Guide "Duration": 41, "ExitNumber": [], "GeometryOffset": 1594, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 386, "Duration": 51, "ExitNumber": [], "GeometryOffset": 1611, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 98, "Duration": 15, "ExitNumber": [], "GeometryOffset": 1621, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 1624, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] Use CalculateRoutes 639 Amazon Location Service Developer Guide } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "de", "Value": "A10" } } ] }, { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ 13.55191, 52.282705 ], "Position": [ 13.5507836, 52.2859121 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ 13.055211, 52.704802 ], "Position": [ 13.0555036, Use CalculateRoutes 640 Amazon Location Service Developer Guide 52.7056073 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 9099, "Duration": 262, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 18849, "Duration": 800, "ExitNumber": [], "GeometryOffset": 162, "KeepStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Keep" }, { "Distance": 4290, "Duration": 212, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 701, "Type": "Exit" }, { "Distance": 12258, "Duration": 554, "ExitNumber": [], Use CalculateRoutes 641 Amazon Location Service Developer Guide "GeometryOffset": 828, "Type": "Continue" }, { "Distance": 18567, "Duration": 1218, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 1282, "Type": "Exit" }, { "Distance": 250, "Duration": 28, "ExitNumber": [], "GeometryOffset": 1760, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 4856, "Duration": 245, "ExitNumber": [], "GeometryOffset": 1793, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 3202, "Duration": 165, "ExitNumber": [], "GeometryOffset": 1970, "RoundaboutExitStepDetails": { "Intersection": [], Use CalculateRoutes 642 Amazon Location Service Developer Guide "SteeringDirection": "Right" }, "Type": "RoundaboutExit" }, { "Distance": 386, "Duration": 51, "ExitNumber": [], "GeometryOffset": 2072, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 98, "Duration": 15, "ExitNumber": [], "GeometryOffset": 2082, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity":
amazon-location-developer-guide-128
amazon-location-developer-guide.pdf
128
28, "ExitNumber": [], "GeometryOffset": 1760, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 4856, "Duration": 245, "ExitNumber": [], "GeometryOffset": 1793, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 3202, "Duration": 165, "ExitNumber": [], "GeometryOffset": 1970, "RoundaboutExitStepDetails": { "Intersection": [], Use CalculateRoutes 642 Amazon Location Service Developer Guide "SteeringDirection": "Right" }, "Type": "RoundaboutExit" }, { "Distance": 386, "Duration": 51, "ExitNumber": [], "GeometryOffset": 2072, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 98, "Duration": 15, "ExitNumber": [], "GeometryOffset": 2082, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 2085, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { Use CalculateRoutes 643 Amazon Location Service Developer Guide "Language": "de", "Value": "A111" } }, { "RouteNumber": { "Language": "de", "Value": "B96" } } ] } ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ 13.055211, 52.704802 ], "Destination": [ 13.551910, 52.282705 ], "TravelMode": "Car", "MaxAlternatives": 2 }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin 13.055211 52.704802 \ --destination 13.551910 52.282705 \ --travel-mode "Car" \ --max-alternatives 2 Use CalculateRoutes 644 Amazon Location Service Developer Guide How to calculate the tolls for a route The CalculateRoutes API helps you to find the best routes between origin and destination, as well as the best opportunities for driver resting. It supports travel modes such as car, truck, pedestrian and scooter. It also supports up to 25 waypoints (stopovers) including the origin and destination, with only a few constraints. Potential use cases • Calculate tolls: Be able to calculate toll costs during route planning. • Audit tolls: Be able to audit toll costs after traveling. Examples Calculate tolls for your routes in Car TravelMode Sample request { "Origin": [ 2.234491, 48.815704 ], "Destination": [ 5.11412, 47.260723 ], "TravelMode": "Car", "Tolls": { "AllTransponders": true, "AllVignettes": true } } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ Use CalculateRoutes 645 Amazon Location Service { Developer Guide "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ 5.11412, 47.2607229 ], "Position": [ 5.1128203, 47.2596356 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ 2.234491, 48.8157039 ], "Position": [ 2.2346482, 48.815674 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [ { "Country": "FRA", "PaymentSites": [ { "Name": "FLEURY-EN-BIERE", Use CalculateRoutes 646 Amazon Location Service Developer Guide "Position": [ 2.53988, 48.42578 ] }, { "Name": "POUILLY-EN-AUXOIS", "Position": [ 4.56112, 47.25244 ] } ], "Rates": [ { "Id": "2d680295-fb0f-45aa- a8ed-79d9f0f9ff9f", "LocalPrice": { "Currency": "EUR", "Estimate": false, "Range": false, "Value": 21.700000762939453 }, "Name": "APRR", "PaymentMethods": [ "Cash", "BankCard", "CreditCard", "Transponder", "TravelCard" ], "Transponders": [ { "SystemName": "BipandGo" }, { "SystemName": "BipandGo" }, { "SystemName": "BipandGo IDVROOM carpoorling" }, { "SystemName": "Cito30" Use CalculateRoutes 647 Amazon Location Service Developer Guide }, { "SystemName": "Easytrip pass" }, { "SystemName": "Liane 30" }, { "SystemName": "Liber-t" }, { "SystemName": "Liber-t mobilitis" }, { "SystemName": "Pass Pont-Pont" }, { "SystemName": "Progressivi'T Maurienne" }, { "SystemName": "TopEurop" }, { "SystemName": "Tunnel Pass+" }, { "SystemName": "Ulys" }, { "SystemName": "Ulys Europe" }, { "SystemName": "Viaduc-t 30" } ] } ], "Systems": [ 0 ] } ], "TollSystems": [ Use CalculateRoutes 648 Amazon Location Service Developer Guide { "Name": "APRR" } ], "TravelSteps": [ { "Distance": 122, "Duration": 21, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 32, "Duration": 7, "ExitNumber": [], "GeometryOffset": 7, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 74, "Duration": 14, "ExitNumber": [], "GeometryOffset": 8, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 199, "Duration": 33, "ExitNumber": [], "GeometryOffset": 9, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", Use CalculateRoutes 649 Amazon Location Service Developer Guide "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 21, "Duration": 10, "ExitNumber": [], "GeometryOffset": 17, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 461, "Duration": 63, "ExitNumber": [], "GeometryOffset": 20, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 1557, "Duration": 145, "ExitNumber": [], "GeometryOffset": 41, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 3471, "Duration": 151, "ExitNumber": [], Use CalculateRoutes 650 Amazon Location Service Developer Guide "GeometryOffset": 135, "RoundaboutExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "RoundaboutExit" }, { "Distance": 9796, "Duration": 430, "ExitNumber": [], "GeometryOffset": 242, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 2473, "Duration": 112, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 582, "Type": "Exit" }, { "Distance": 674, "Duration": 25, "ExitNumber": [], "GeometryOffset": 669, "Type": "Continue"
amazon-location-developer-guide-129
amazon-location-developer-guide.pdf
129
"Type": "Turn" }, { "Distance": 1557, "Duration": 145, "ExitNumber": [], "GeometryOffset": 41, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 3471, "Duration": 151, "ExitNumber": [], Use CalculateRoutes 650 Amazon Location Service Developer Guide "GeometryOffset": 135, "RoundaboutExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "RoundaboutExit" }, { "Distance": 9796, "Duration": 430, "ExitNumber": [], "GeometryOffset": 242, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 2473, "Duration": 112, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 582, "Type": "Exit" }, { "Distance": 674, "Duration": 25, "ExitNumber": [], "GeometryOffset": 669, "Type": "Continue" }, { "Distance": 253953, "Duration": 7468, "ExitNumber": [], "GeometryOffset": 679, "Type": "Continue" }, { Use CalculateRoutes 651 Amazon Location Service Developer Guide "Distance": 37379, "Duration": 1192, "ExitNumber": [], "ExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "GeometryOffset": 5701, "Type": "Exit" }, { "Distance": 2021, "Duration": 110, "ExitNumber": [], "GeometryOffset": 6695, "RoundaboutExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "RoundaboutExit" }, { "Distance": 7380, "Duration": 316, "ExitNumber": [], "GeometryOffset": 6776, "RoundaboutPassStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "RoundaboutPass" }, { "Distance": 4253, "Duration": 156, "ExitNumber": [], "GeometryOffset": 6987, "KeepStepDetails": { "Intersection": [], "SteeringDirection": "Left" }, "Type": "Keep" }, { Use CalculateRoutes 652 Amazon Location Service Developer Guide "Distance": 813, "Duration": 54, "ExitNumber": [], "GeometryOffset": 7081, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 1909, "Duration": 109, "ExitNumber": [], "GeometryOffset": 7133, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Sharp" }, "Type": "Turn" }, { "Distance": 827, "Duration": 47, "ExitNumber": [], "GeometryOffset": 7182, "Type": "Continue" }, { "Distance": 680, "Duration": 41, "ExitNumber": [], "GeometryOffset": 7216, "RoundaboutExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "RoundaboutExit" }, { "Distance": 224, "Duration": 12, "ExitNumber": [], Use CalculateRoutes 653 Amazon Location Service Developer Guide "GeometryOffset": 7258, "Type": "Continue" }, { "Distance": 25, "Duration": 2, "ExitNumber": [], "GeometryOffset": 7265, "Type": "Continue" }, { "Distance": 748, "Duration": 51, "ExitNumber": [], "GeometryOffset": 7267, "Type": "Continue" }, { "Distance": 656, "Duration": 46, "ExitNumber": [], "GeometryOffset": 7299, "RoundaboutExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "RoundaboutExit" }, { "Distance": 1119, "Duration": 78, "ExitNumber": [], "GeometryOffset": 7329, "Type": "Continue" }, { "Distance": 432, "Duration": 26, "ExitNumber": [], "GeometryOffset": 7383, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" Use CalculateRoutes 654 Amazon Location Service Developer Guide }, "Type": "Turn" }, { "Distance": 1864, "Duration": 100, "ExitNumber": [], "GeometryOffset": 7402, "RoundaboutExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "RoundaboutExit" }, { "Distance": 1110, "Duration": 93, "ExitNumber": [], "GeometryOffset": 7470, "RoundaboutExitStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "RoundaboutExit" }, { "Distance": 232, "Duration": 10, "ExitNumber": [], "GeometryOffset": 7563, "Type": "Continue" }, { "Distance": 642, "Duration": 29, "ExitNumber": [], "GeometryOffset": 7572, "Type": "Continue" }, { "Distance": 357, "Duration": 25, "ExitNumber": [], "GeometryOffset": 7580, Use CalculateRoutes 655 Amazon Location Service Developer Guide "Type": "Continue" }, { "Distance": 63, "Duration": 10, "ExitNumber": [], "GeometryOffset": 7600, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 2626, "Duration": 411, "ExitNumber": [], "GeometryOffset": 7602, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 234, "Duration": 37, "ExitNumber": [], "GeometryOffset": 7627, "Type": "Continue" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 7632, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } Use CalculateRoutes 656 Amazon Location Service Developer Guide } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "fr", "Value": "A6" } } ] } ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ 2.234491, 48.815704 ], "Destination": [ 5.11412, 47.260723 ], "TravelMode": "Car", "Tolls": { "AllTransponders": true, "AllVignettes": true } }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin 13.055211 52.704802 \ --destination 13.551910 52.282705 \ --travel-mode "Car" \ --tolls '{"AllTransponders": true, "AllVignettes": true}' Use CalculateRoutes 657 Amazon Location Service Developer Guide How to create routes with custom avoidance The CalculateRoutes API helps you to find the best routes between origin and destination, as well as the best opportunities for driver resting. It supports travel modes such as car, truck, pedestrian and scooter. It also supports up to 25 waypoints (stopovers) including the origin and destination, with only a few constraints. Potential use cases • Calculate routes with custom avoidance: Customize routes with avoidance for better routes and commute planning. Examples Use CalculateRoutes with an avoid BoundingBox to create custom routes. Sample request { "Origin": [ -123.116655, 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { "BoundingBox": [ -123.078693, 49.238987, -123.054638, 49.251694 ] } } ] } Use CalculateRoutes 658 Developer Guide Amazon Location Service } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.0179179, 49.2278276 ], "Position": [ -123.0229001, 49.22883 ] } },
amazon-location-developer-guide-130
amazon-location-developer-guide.pdf
130
and commute planning. Examples Use CalculateRoutes with an avoid BoundingBox to create custom routes. Sample request { "Origin": [ -123.116655, 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { "BoundingBox": [ -123.078693, 49.238987, -123.054638, 49.251694 ] } } ] } Use CalculateRoutes 658 Developer Guide Amazon Location Service } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.0179179, 49.2278276 ], "Position": [ -123.0229001, 49.22883 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.116655, 49.281538 ], "Position": [ -123.1166332, 49.2815528 ] } Use CalculateRoutes 659 Amazon Location Service Developer Guide }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 1144, "Duration": 85, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 262, "Duration": 24, "ExitNumber": [], "GeometryOffset": 35, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 433, "Duration": 47, "ExitNumber": [], "GeometryOffset": 40, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 1131, "Duration": 81, "ExitNumber": [], "GeometryOffset": 54, "TurnStepDetails": { Use CalculateRoutes 660 Amazon Location Service Developer Guide "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 54, "Duration": 4, "ExitNumber": [], "GeometryOffset": 79, "Type": "Continue" }, { "Distance": 520, "Duration": 39, "ExitNumber": [], "GeometryOffset": 83, "Type": "Continue" }, { "Distance": 1123, "Duration": 111, "ExitNumber": [], "GeometryOffset": 101, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 1131, "Duration": 81, "ExitNumber": [], "GeometryOffset": 141, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, Use CalculateRoutes 661 Amazon Location Service Developer Guide { "Distance": 2843, "Duration": 209, "ExitNumber": [], "GeometryOffset": 167, "Type": "Continue" }, { "Distance": 3219, "Duration": 246, "ExitNumber": [], "GeometryOffset": 255, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 64, "Duration": 23, "ExitNumber": [], "GeometryOffset": 332, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 334, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], Use CalculateRoutes 662 Amazon Location Service Developer Guide "MajorRoadLabels": [ { "RoadName": { "Language": "en", "Value": "Boundary Rd" } }, { "RoadName": { "Language": "en", "Value": "Grandview Hwy" } } ] } ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.116655, 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { "BoundingBox": [ -123.078693, 49.238987, -123.054638, 49.251694 ] Use CalculateRoutes 663 Amazon Location Service Developer Guide } } ] } }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.13277 49.281538 \ --destination -123.01791785749363 49.22782762759908 \ --travel-mode "Car" \ --avoid '{"Areas":[{"Geometry":{"BoundingBox": [-123.054638,49.238987,-123.054638,49.251694]}}]}' Use CalculateRoutes with an avoid polygon to create custom routes. Sample request { "Origin": [ -123.116655, 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { "polygon": [ [ [ -123.06953, 49.256419 ], [ -123.080486, 49.242115 Use CalculateRoutes 664 Amazon Location Service Developer Guide ], [ -123.058573, 49.242115 ], [ -123.06953, 49.256419 ] ] ] } } ] } } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.0179179, 49.2278276 ], "Position": [ -123.0229001, 49.22883 Use CalculateRoutes 665 Amazon Location Service Developer Guide ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.116655, 49.281538 ], "Position": [ -123.1166332, 49.2815528 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 1144, "Duration": 85, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 262, "Duration": 24, "ExitNumber": [], "GeometryOffset": 35, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 433, "Duration": 47, Use CalculateRoutes 666 Amazon Location Service Developer Guide "ExitNumber": [], "GeometryOffset": 40, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 1131, "Duration": 81, "ExitNumber": [], "GeometryOffset": 54, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 54, "Duration": 4, "ExitNumber": [], "GeometryOffset": 79, "Type": "Continue" }, { "Distance": 520, "Duration": 39, "ExitNumber": [], "GeometryOffset": 83, "Type": "Continue" }, { "Distance": 1123, "Duration": 111, "ExitNumber": [], "GeometryOffset": 101, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" Use CalculateRoutes 667 Amazon Location Service Developer Guide }, "Type": "Turn" }, { "Distance": 1131, "Duration": 81, "ExitNumber": [], "GeometryOffset": 141, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 448, "Duration": 34, "ExitNumber": [], "GeometryOffset": 167, "Type": "Continue" }, { "Distance": 1797, "Duration": 151,
amazon-location-developer-guide-131
amazon-location-developer-guide.pdf
131
[], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 54, "Duration": 4, "ExitNumber": [], "GeometryOffset": 79, "Type": "Continue" }, { "Distance": 520, "Duration": 39, "ExitNumber": [], "GeometryOffset": 83, "Type": "Continue" }, { "Distance": 1123, "Duration": 111, "ExitNumber": [], "GeometryOffset": 101, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" Use CalculateRoutes 667 Amazon Location Service Developer Guide }, "Type": "Turn" }, { "Distance": 1131, "Duration": 81, "ExitNumber": [], "GeometryOffset": 141, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 448, "Duration": 34, "ExitNumber": [], "GeometryOffset": 167, "Type": "Continue" }, { "Distance": 1797, "Duration": 151, "ExitNumber": [], "GeometryOffset": 182, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 2836, "Duration": 224, "ExitNumber": [], "GeometryOffset": 222, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, Use CalculateRoutes 668 Amazon Location Service Developer Guide "Type": "Turn" }, { "Distance": 339, "Duration": 30, "ExitNumber": [], "GeometryOffset": 326, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 64, "Duration": 23, "ExitNumber": [], "GeometryOffset": 335, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 337, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "en", "Value": "HWY-1A" Use CalculateRoutes 669 Amazon Location Service Developer Guide } }, { "RoadName": { "Language": "en", "Value": "Nanaimo St" } } ] } ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.116655, 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { "polygon": [ [ [ -123.06953, 49.256419 ], [ -123.080486, 49.242115 ], [ Use CalculateRoutes 670 Amazon Location Service Developer Guide -123.058573, 49.242115 ], [ -123.06953, 49.256419 ] ] ] } } ] } }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.13277 49.281538 \ --destination -123.01791785749363 49.22782762759908 \ --travel-mode "Car" \ --avoid '{"Areas":[{"Geometry":{"Polygon":[[[-123.06953,49.256419], [-123.05167,49.242115],[-123.02381,49.242115],[-123.06953,49.256419]]]}}]}' Use CalculateRoutes with PolylinePolygon to create custom routes. Sample request { "Origin": [ -123.116655, 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { Use CalculateRoutes 671 Amazon Location Service Developer Guide "PolylinePolygon": [ "BF0s0sJxglvXr5CvkCAgpEs5CvkC" ] } } ] } } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.0179179, 49.2278276 ], "Position": [ -123.0229001, 49.22883 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.116655, Use CalculateRoutes 672 Amazon Location Service Developer Guide 49.281538 ], "Position": [ -123.1166332, 49.2815528 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 1144, "Duration": 85, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 262, "Duration": 24, "ExitNumber": [], "GeometryOffset": 35, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 433, "Duration": 47, "ExitNumber": [], "GeometryOffset": 40, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" Use CalculateRoutes 673 Amazon Location Service Developer Guide }, { "Distance": 1131, "Duration": 81, "ExitNumber": [], "GeometryOffset": 54, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 54, "Duration": 4, "ExitNumber": [], "GeometryOffset": 79, "Type": "Continue" }, { "Distance": 520, "Duration": 39, "ExitNumber": [], "GeometryOffset": 83, "Type": "Continue" }, { "Distance": 1123, "Duration": 111, "ExitNumber": [], "GeometryOffset": 101, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 1131, "Duration": 81, "ExitNumber": [], "GeometryOffset": 141, Use CalculateRoutes 674 Amazon Location Service Developer Guide "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 448, "Duration": 34, "ExitNumber": [], "GeometryOffset": 167, "Type": "Continue" }, { "Distance": 1797, "Duration": 151, "ExitNumber": [], "GeometryOffset": 182, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 2836, "Duration": 224, "ExitNumber": [], "GeometryOffset": 222, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 339, "Duration": 30, "ExitNumber": [], "GeometryOffset": 326, "TurnStepDetails": { Use CalculateRoutes 675 Amazon Location Service Developer Guide "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 64, "Duration": 23, "ExitNumber": [], "GeometryOffset": 335, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 337, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "en", "Value": "HWY-1A" } }, { "RoadName": { "Language": "en", "Value": "Nanaimo St" } } Use CalculateRoutes 676 Amazon Location Service ] } ] } cURL Developer Guide curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.116655, 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": {
amazon-location-developer-guide-132
amazon-location-developer-guide.pdf
132
64, "Duration": 23, "ExitNumber": [], "GeometryOffset": 335, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 337, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "en", "Value": "HWY-1A" } }, { "RoadName": { "Language": "en", "Value": "Nanaimo St" } } Use CalculateRoutes 676 Amazon Location Service ] } ] } cURL Developer Guide curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.116655, 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { "PolylinePolygon": [ "BF0s0sJxglvXr5CvkCAgpEs5CvkC" ] } } ] } }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.13277 49.281538 \ --destination -123.01791785749363 49.22782762759908 \ --travel-mode "Car" \ --avoid '{"Areas":[{"Geometry":{"PolylinePolygon": ["BF0s0sJxglvXr5CvkCAgpEs5CvkC"]}}]}' Use CalculateRoutes 677 Amazon Location Service Developer Guide Use CalculateRoutes with avoid Corridor to create custom routes. Sample request { "Origin": [ -123.116655, 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { "PolylineCorridor": { "Polyline": "Redacted", "Radius": 10 } } } ] } } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { Use CalculateRoutes 678 Amazon Location Service Developer Guide "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.0179179, 49.2278276 ], "Position": [ -123.0229001, 49.22883 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.116655, 49.281538 ], "Position": [ -123.1166332, 49.2815528 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 1144, "Duration": 85, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 262, "Duration": 24, Use CalculateRoutes 679 Amazon Location Service Developer Guide "ExitNumber": [], "GeometryOffset": 35, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 1356, "Duration": 134, "ExitNumber": [], "GeometryOffset": 40, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 2468, "Duration": 204, "ExitNumber": [], "GeometryOffset": 90, "KeepStepDetails": { "Intersection": [], "SteeringDirection": "Left" }, "Type": "Keep" }, { "Distance": 1100, "Duration": 88, "ExitNumber": [], "GeometryOffset": 170, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { Use CalculateRoutes 680 Amazon Location Service Developer Guide "Distance": 1588, "Duration": 133, "ExitNumber": [], "GeometryOffset": 214, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 47, "Duration": 14, "ExitNumber": [], "GeometryOffset": 260, "Type": "Continue" }, { "Distance": 2478, "Duration": 196, "ExitNumber": [], "GeometryOffset": 265, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 339, "Duration": 30, "ExitNumber": [], "GeometryOffset": 357, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 64, Use CalculateRoutes 681 Amazon Location Service Developer Guide "Duration": 23, "ExitNumber": [], "GeometryOffset": 366, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 368, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "en", "Value": "HWY-1A" } } ] } ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.116655, Use CalculateRoutes 682 Amazon Location Service Developer Guide 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { "PolylineCorridor": { "Polyline": "Redacted", "Radius": 10 } } } ] } }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.116655 49.281538 \ --destination -123.01791785749363 49.22782762759908 \ --travel-mode "Car" \ --avoid '{"Areas": [{"Geometry": {"PolylineCorridor": {"Polyline": "BF2mysJnmkvX5ekiC", "Radius": 10}}}]}' Use CalculateRoutes with an avoid PolylineCorridor to create custom routes. Sample request { "Origin": [ -123.116655, 49.281538 ], "Destination": [ -123.01791785749363, 49.22782762759908 Use CalculateRoutes 683 Developer Guide Amazon Location Service ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { "Corridor": { "LineString": [ [ -123.06532243038754, 49.245226301868776 ], [ -123.0547357660333, 49.24030469850804 ] ], "Radius": 10 } } } ] } } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { Use CalculateRoutes 684 Amazon Location Service Developer Guide "ChargingStation": false, "OriginalPosition": [ -123.0179179, 49.2278276 ], "Position": [ -123.0229001, 49.22883 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.116655, 49.281538 ], "Position": [ -123.1166332, 49.2815528 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 1144, "Duration": 85, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 262, "Duration": 24, "ExitNumber": [], "GeometryOffset": 35, "RampStepDetails": { Use CalculateRoutes 685 Amazon Location Service Developer Guide "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 1356, "Duration": 134, "ExitNumber": [], "GeometryOffset": 40, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" },
amazon-location-developer-guide-133
amazon-location-developer-guide.pdf
133
[ -123.0179179, 49.2278276 ], "Position": [ -123.0229001, 49.22883 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.116655, 49.281538 ], "Position": [ -123.1166332, 49.2815528 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 1144, "Duration": 85, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 262, "Duration": 24, "ExitNumber": [], "GeometryOffset": 35, "RampStepDetails": { Use CalculateRoutes 685 Amazon Location Service Developer Guide "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 1356, "Duration": 134, "ExitNumber": [], "GeometryOffset": 40, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 2468, "Duration": 204, "ExitNumber": [], "GeometryOffset": 90, "KeepStepDetails": { "Intersection": [], "SteeringDirection": "Left" }, "Type": "Keep" }, { "Distance": 1100, "Duration": 88, "ExitNumber": [], "GeometryOffset": 170, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 1588, "Duration": 133, "ExitNumber": [], Use CalculateRoutes 686 Amazon Location Service Developer Guide "GeometryOffset": 214, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 47, "Duration": 14, "ExitNumber": [], "GeometryOffset": 260, "Type": "Continue" }, { "Distance": 2478, "Duration": 196, "ExitNumber": [], "GeometryOffset": 265, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 339, "Duration": 30, "ExitNumber": [], "GeometryOffset": 357, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 64, "Duration": 23, "ExitNumber": [], "GeometryOffset": 366, Use CalculateRoutes 687 Amazon Location Service Developer Guide "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 368, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "en", "Value": "HWY-1A" } } ] } ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.116655, 49.281538 ], "Destination": [ Use CalculateRoutes 688 Amazon Location Service Developer Guide -123.01791785749363, 49.22782762759908 ], "TravelMode": "Car", "Avoid": { "Areas": [ { "Geometry": { "Corridor": { "LineString": [ [ -123.06532243038754, 49.245226301868776 ], [ -123.0547357660333, 49.24030469850804 ] ], "Radius": 10 } } } ] } }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.13277 49.281538 \ --destination -123.01791785749363 49.22782762759908 \ --travel-mode "Car" \ --avoid '{"Areas":[{"Geometry":{"Corridor":{"LineString": [[-123.06532243038754,49.245226301868776], [-123.0547357660333,49.24030469850804]],"Radius":10}}}]}' How to create routes with custom avoidance of several potential items The CalculateRoutes API helps you to find the best routes between origin and destination, as well as the best opportunities for driver resting. It supports travel modes such as car, truck, pedestrian Use CalculateRoutes 689 Amazon Location Service Developer Guide and scooter. It also supports up to 25 waypoints (stopovers) including the origin and destination, with only a few constraints. Potential use cases • Calculate routes with custom avoidance: Customize routes with avoidance for better routes and commute planning. Examples Use CalculateRoutes with avoidance of tolls, u-turns, ferries, highways, tunnels and more. Sample request { "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelMode": "Car", "Avoid": { "TollRoads": true, "UTurns": true, "Ferries": true, "ControlledAccessHighways": true, "Tunnels": true } } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { Use CalculateRoutes 690 Amazon Location Service Developer Guide "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.020098, 49.232872 ], "Position": [ -123.0203051, 49.2328499 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.1181051, 49.282423 ], "Position": [ -123.1180883, 49.2824349 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 1288, "Duration": 102, "ExitNumber": [], Use CalculateRoutes 691 Amazon Location Service Developer Guide "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 262, "Duration": 24, "ExitNumber": [], "GeometryOffset": 37, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 1356, "Duration": 134, "ExitNumber": [], "GeometryOffset": 42, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 7092, "Duration": 568, "ExitNumber": [], "GeometryOffset": 92, "KeepStepDetails": { "Intersection": [], "SteeringDirection": "Left" }, "Type": "Keep" }, { "Distance": 65, "Duration": 26, "ExitNumber": [], "GeometryOffset": 337, "TurnStepDetails": { "Intersection": [], Use CalculateRoutes 692 Amazon Location Service Developer Guide "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 50, "Duration": 18, "ExitNumber": [], "GeometryOffset": 339, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 343, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "en", "Value": "HWY-1A" } } ] } ] } Use CalculateRoutes 693 Amazon Location Service cURL Developer Guide curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelMode": "Car", "Avoid": { "TollRoads": true, "UTurns": true, "Ferries": true, "ControlledAccessHighways": true, "Tunnels":
amazon-location-developer-guide-134
amazon-location-developer-guide.pdf
134
"Distance": 50, "Duration": 18, "ExitNumber": [], "GeometryOffset": 339, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 343, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "en", "Value": "HWY-1A" } } ] } ] } Use CalculateRoutes 693 Amazon Location Service cURL Developer Guide curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelMode": "Car", "Avoid": { "TollRoads": true, "UTurns": true, "Ferries": true, "ControlledAccessHighways": true, "Tunnels": true } }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.118105 49.282423 \ --destination -123.020098 49.232872 \ --travel-mode "Car" \ --avoid '{"TollRoads": true, "UTurns": true, "Ferries": true, "ControlledAccessHighways": true, "Tunnels": true}' How to find the fastest route The CalculateRoutes API helps you to find the fastest routes between origin and destination. Potential use cases • Optimize routes for time efficiency: Improve delivery operations by calculating the fastest route. This is useful for reducing travel time in logistics and delivery services. Use CalculateRoutes 694 Developer Guide Amazon Location Service Examples Calculate the fastest route Sample request { "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelMode": "Car", "OptimizeRoutingFor": "FastestRoute" } Sample response { "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.020098, 49.232872 ], "Position": [ Use CalculateRoutes 695 Amazon Location Service Developer Guide -123.0203051, 49.2328499 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.1181051, 49.282423 ], "Position": [ -123.1180883, 49.2824349 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], "TollSystems": [], "TravelSteps": [ { "Distance": 1288, "Duration": 102, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 262, "Duration": 24, "ExitNumber": [], "GeometryOffset": 37, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { Use CalculateRoutes 696 Amazon Location Service Developer Guide "Distance": 1356, "Duration": 134, "ExitNumber": [], "GeometryOffset": 42, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 7092, "Duration": 568, "ExitNumber": [], "GeometryOffset": 92, "KeepStepDetails": { "Intersection": [], "SteeringDirection": "Left" }, "Type": "Keep" }, { "Distance": 65, "Duration": 26, "ExitNumber": [], "GeometryOffset": 337, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 50, "Duration": 18, "ExitNumber": [], "GeometryOffset": 339, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, Use CalculateRoutes 697 Amazon Location Service Developer Guide "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 343, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "en", "Value": "HWY-1A" } } ] } ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelMode": "Car", "OptimizeRoutingFor": "FastestRoute" Use CalculateRoutes 698 Amazon Location Service Developer Guide }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.118105 49.282423 \ --destination -123.020098 49.232872 \ --travel-mode "Car" \ --optimize-routing-for "FastestRoute" How to find the shortest routes The CalculateRoutes API helps you to find the shortest routes between origin and destination. Potential use cases • Optimize routes for time efficiency: Improve delivery operations by calculating the shortest route. This is useful for reducing travel distance in logistics and delivery services. Examples Use CalculateRoutes to find the shortest route and save on travel distance. Sample request { "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelMode": "Car", "OptimizeRoutingFor": "ShortestRoute" } Sample response { Use CalculateRoutes 699 Amazon Location Service Developer Guide "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.020098, 49.232872 ], "Position": [ -123.0203051, 49.2328499 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.1181051, 49.282423 ], "Position": [ -123.1180883, 49.2824349 ] } }, "Incidents": [], "Notices": [], "PassThroughWaypoints": [], "Spans": [], "Tolls": [], Use CalculateRoutes 700 Amazon Location Service Developer Guide "TollSystems": [], "TravelSteps": [ { "Distance": 1288, "Duration": 102, "ExitNumber": [], "GeometryOffset": 0, "Type": "Depart" }, { "Distance": 262, "Duration": 24, "ExitNumber": [], "GeometryOffset": 37, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 1356, "Duration": 134, "ExitNumber": [], "GeometryOffset": 42, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 7092, "Duration": 568, "ExitNumber": [], "GeometryOffset": 92, "KeepStepDetails": { "Intersection": [], "SteeringDirection": "Left" }, "Type": "Keep" }, { Use CalculateRoutes 701 Amazon Location Service Developer Guide "Distance": 65, "Duration": 26, "ExitNumber": [], "GeometryOffset": 337, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 50, "Duration": 18, "ExitNumber": [], "GeometryOffset": 339,
amazon-location-developer-guide-135
amazon-location-developer-guide.pdf
135
"Type": "Depart" }, { "Distance": 262, "Duration": 24, "ExitNumber": [], "GeometryOffset": 37, "RampStepDetails": { "Intersection": [], "SteeringDirection": "Right" }, "Type": "Ramp" }, { "Distance": 1356, "Duration": 134, "ExitNumber": [], "GeometryOffset": 42, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 7092, "Duration": 568, "ExitNumber": [], "GeometryOffset": 92, "KeepStepDetails": { "Intersection": [], "SteeringDirection": "Left" }, "Type": "Keep" }, { Use CalculateRoutes 701 Amazon Location Service Developer Guide "Distance": 65, "Duration": 26, "ExitNumber": [], "GeometryOffset": 337, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Left", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 50, "Duration": 18, "ExitNumber": [], "GeometryOffset": 339, "TurnStepDetails": { "Intersection": [], "SteeringDirection": "Right", "TurnIntensity": "Typical" }, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "ExitNumber": [], "GeometryOffset": 343, "Type": "Arrive" } ], "TruckRoadTypes": [], "Zones": [] } } ], "MajorRoadLabels": [ { "RouteNumber": { "Language": "en", "Value": "HWY-1A" } } ] Use CalculateRoutes 702 Amazon Location Service } ] } cURL Developer Guide curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelMode": "Car", "OptimizeRoutingFor": "ShortestRoute" }' AWS CLI aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.118105 49.282423 \ --destination -123.020098 49.232872 \ --travel-mode "Scooter" \ --optimize-routing-for "ShortestRoute" Learn how to use CalculateIsolines In this section you learn how to use CalculateIsolines with ranges of time or distance, as well as to set areas to avoid. Topics • How to calculate a service area based on ranges of time • How to calculate a service area based on ranges of distance • How to calculate a service area based on avoidance Use CalculateIsolines 703 Amazon Location Service Developer Guide How to calculate a service area based on ranges of time The CalculateIsolines API allows you to determine reachable service areas within specified ranges of time or distance, factoring in road networks and traffic conditions. This capability supports applications in defining service areas for restaurants, grocery stores, or other service providers which can assist in planning fuel efficiency and defining accessible areas for service coverage. Potential use cases • Plan service areas: Use this API to plan accessible areas for services like restaurants or grocery delivery based on travel time or distance. Examples Calculate a service area based on a time range with Car TravelMode Sample request { "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Time": [ 500, 1000, 1500 ] }, "TravelMode": "Car" } Sample response { "DepartureTime": "2024-10-28T14:27:56-07:00", "IsolineGeometryFormat": "FlexiblePolyline", "Isolines": [ { Use CalculateIsolines 704 Amazon Location Service Developer Guide "Connections": [], "Geometries": [ { "PolylinePolygon": [ "Redacted" ] } ], "TimeThreshold": 500 }, { "Connections": [], "Geometries": [ { "PolylinePolygon": [ "Redacted" ] } ], "TimeThreshold": 1000 }, { "Connections": [], "Geometries": [ { "PolylinePolygon": [ "Redacted" ] } ], "TimeThreshold": 1500 } ], "SnappedOrigin": [ -123.11687, 49.2813999 ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/isolines?key=Your_key' \ Use CalculateIsolines 705 Amazon Location Service Developer Guide --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Time": [ 500, 1000, 1500 ] }, "TravelMode": "Car" }' AWS CLI aws geo-routes calculate-isolines --key ${YourKey} \ --origin -123.11679620827039 49.28147612192166 \ --departure-time "2024-10-28T21:27:56Z" \ --thresholds '{"Time": [500, 1000, 1500]}' \ --travel-mode "Car" How to calculate a service area based on ranges of distance The CalculateIsolines API allows you to determine reachable service areas within specified ranges of time or distance, factoring in road networks and traffic conditions. This capability supports applications in defining service areas for restaurants, grocery stores, or other service providers which can assist in planning fuel efficiency and defining accessible areas for service coverage. Potential use cases • Plan service areas: Use this API to plan accessible areas for services like restaurants or grocery delivery based on travel time or distance. Use CalculateIsolines 706 Amazon Location Service Examples Developer Guide Calculate a service area based on ranges of distance with Car TravelMode Sample request { "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 1000, 2000, 3000 ] }, "TravelMode": "Car" } Sample response { "DepartureTime": "2024-10-28T14:27:56-07:00", "IsolineGeometryFormat": "FlexiblePolyline", "Isolines": [ { "Connections": [], "DistanceThreshold": 1000, "Geometries": [ { "PolylinePolygon": [ "Redacted" ] } ] }, { "Connections": [], "DistanceThreshold": 2000, "Geometries": [ Use CalculateIsolines 707 Developer Guide Amazon Location Service { "PolylinePolygon": [ "Redacted" ] } ] }, { "Connections": [], "DistanceThreshold": 3000, "Geometries": [ { "PolylinePolygon": [ "Redacted" ] } ] } ], "SnappedOrigin": [ -123.11687, 49.2813999 ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/isolines?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 1000, 2000, 3000 ] }, Use CalculateIsolines 708 Developer Guide Amazon Location Service "TravelMode": "Car" }' AWS CLI aws geo-routes calculate-isolines --key ${YourKey} \ --origin -123.11679620827039 49.28147612192166 \ --departure-time "2024-10-28T21:27:56Z" \ --thresholds '{"Distance": [1000, 2000,
amazon-location-developer-guide-136
amazon-location-developer-guide.pdf
136
"Geometries": [ Use CalculateIsolines 707 Developer Guide Amazon Location Service { "PolylinePolygon": [ "Redacted" ] } ] }, { "Connections": [], "DistanceThreshold": 3000, "Geometries": [ { "PolylinePolygon": [ "Redacted" ] } ] } ], "SnappedOrigin": [ -123.11687, 49.2813999 ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/isolines?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 1000, 2000, 3000 ] }, Use CalculateIsolines 708 Developer Guide Amazon Location Service "TravelMode": "Car" }' AWS CLI aws geo-routes calculate-isolines --key ${YourKey} \ --origin -123.11679620827039 49.28147612192166 \ --departure-time "2024-10-28T21:27:56Z" \ --thresholds '{"Distance": [1000, 2000, 3000]}' \ --travel-mode "Car" How to calculate a service area based on avoidance The CalculateIsolines API allows you to determine reachable service areas within specified ranges of time or distance, factoring in road networks and traffic conditions to avoid. This capability supports applications in defining service areas for restaurants, grocery stores, or other service providers which can assist in planning fuel efficiency and defining accessible areas for service coverage. Potential use cases • Plan service areas: Use this API to plan accessible areas for services like restaurants or grocery delivery based on avoidance. Examples Calculate a service area based on avoidance with Car TravelMode Sample request { "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 4000 ] Use CalculateIsolines 709 Developer Guide Amazon Location Service }, "Avoid": { "TollRoads": true, "UTurns": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [ { "Category": "Environmental" } ] }, "TravelMode": "Car" } Sample response { "DepartureTime": "2024-10-28T14:27:56-07:00", "IsolineGeometryFormat": "FlexiblePolyline", "Isolines": [ { "Connections": [], "DistanceThreshold": 4000, "Geometries": [ { "PolylinePolygon": [ "Redacted" ] } ] } ], "SnappedOrigin": [ -123.11687, 49.2813999 ] } Use CalculateIsolines 710 Amazon Location Service cURL Developer Guide curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/isolines?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 4000 ] }, "Avoid": { "TollRoads": true, "UTurns": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [ { "Category": "Environmental" } ] }, "TravelMode": "Car" }' AWS CLI aws geo-routes calculate-isolines --key ${YourKey} \ --origin -123.11679620827039 49.28147612192166 \ --departure-time "2024-10-28T21:27:56Z" \ --thresholds '{"Distance": [4000]}' \ --avoid '{"TollRoads": true, "UTurns": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": Use CalculateIsolines 711 Amazon Location Service Developer Guide true, "TollTransponders": true, "ZoneCategories": [{"Category": "Environmental"}]}' \ --travel-mode "Car" Calculate a service area based on avoidance with Truck TravelMode Sample request { "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 4000 ] }, "Avoid": { "TollRoads": true, "UTurns": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [ { "Category": "Environmental" } ] }, "TravelMode": "Truck" } Sample response { "DepartureTime": "2024-10-28T14:27:56-07:00", "IsolineGeometryFormat": "FlexiblePolyline", Use CalculateIsolines 712 Amazon Location Service Developer Guide "Isolines": [ { "Connections": [], "DistanceThreshold": 4000, "Geometries": [ { "PolylinePolygon": [ "Redacted" ] } ] } ], "SnappedOrigin": [ -123.11687, 49.2813999 ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/isolines?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 4000 ] }, "Avoid": { "TollRoads": true, "UTurns": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, Use CalculateIsolines 713 Amazon Location Service Developer Guide "TollTransponders": true, "ZoneCategories": [ { "Category": "Environmental" } ] }, "TravelMode": "Truck" }' AWS CLI aws geo-routes calculate-isolines --key ${YourKey} \ --origin -123.11679620827039 49.28147612192166 \ --departure-time "2024-10-28T21:27:56Z" \ --thresholds '{"Distance": [4000]}' \ --avoid '{"TollRoads": true, "UTurns": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [{"Category": "Environmental"}]}' \ --travel-mode "Truck" Calculate a service area based on avoidance for pedestrians Sample request { "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 4000 ] }, "Avoid": { "TollRoads": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, Use CalculateIsolines 714 Amazon Location Service Developer Guide "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [ { "Category": "Environmental" } ] }, "TravelMode": "Pedestrian" } Sample response { "DepartureTime": "2024-10-28T14:27:56-07:00", "IsolineGeometryFormat": "FlexiblePolyline", "Isolines": [ { "Connections": [], "DistanceThreshold": 4000, "Geometries": [ { "PolylinePolygon": [ "Redacted" ] } ] } ], "SnappedOrigin": [ -123.11687, 49.2813999 ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/isolines?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ Use CalculateIsolines 715 Amazon Location Service Developer Guide -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 4000 ] }, "Avoid": { "TollRoads": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [ { "Category": "Environmental" } ] }, "TravelMode": "Pedestrian" }' AWS CLI aws geo-routes calculate-isolines --key ${YourKey} \ --origin -123.11679620827039 49.28147612192166 \ --departure-time "2024-10-28T21:27:56Z" \ --thresholds '{"Distance": [4000]}' \ --avoid '{"TollRoads": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [{"Category": "Environmental"}]}' \ --travel-mode
amazon-location-developer-guide-137
amazon-location-developer-guide.pdf
137
--request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/isolines?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ Use CalculateIsolines 715 Amazon Location Service Developer Guide -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 4000 ] }, "Avoid": { "TollRoads": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [ { "Category": "Environmental" } ] }, "TravelMode": "Pedestrian" }' AWS CLI aws geo-routes calculate-isolines --key ${YourKey} \ --origin -123.11679620827039 49.28147612192166 \ --departure-time "2024-10-28T21:27:56Z" \ --thresholds '{"Distance": [4000]}' \ --avoid '{"TollRoads": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [{"Category": "Environmental"}]}' \ --travel-mode "Pedestrian" Calculate a service area based on avoidance with Scooter TravelMode Sample request { Use CalculateIsolines 716 Amazon Location Service Developer Guide "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 4000 ] }, "Avoid": { "TollRoads": true, "ControlledAccessHighways": true, "DifficultTurns": false, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [ { "Category": "Environmental" } ] }, "TravelMode": "Scooter" } Sample response { "DepartureTime": "2024-10-28T14:27:56-07:00", "IsolineGeometryFormat": "FlexiblePolyline", "Isolines": [ { "Connections": [], "DistanceThreshold": 4000, "Geometries": [ { "PolylinePolygon": [ "Redacted" ] } Use CalculateIsolines 717 Developer Guide Amazon Location Service ] } ], "SnappedOrigin": [ -123.11687, 49.2813999 ] } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/isolines?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.11679620827039, 49.28147612192166 ], "DepartureTime": "2024-10-28T21:27:56Z", "Thresholds": { "Distance": [ 4000 ] }, "Avoid": { "TollRoads": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [ { "Category": "Environmental" } ] }, "TravelMode": "Scooter" }' Use CalculateIsolines 718 Amazon Location Service AWS CLI Developer Guide aws geo-routes calculate-isolines --key ${YourKey} \ --origin -123.11679620827039 49.28147612192166 \ --departure-time "2024-10-28T21:27:56Z" \ --thresholds '{"Distance": [4000]}' \ --avoid '{"TollRoads": true, "ControlledAccessHighways": true, "Ferries": true, "DirtRoads": true, "SeasonalClosure": true, "CarShuttleTrains": true, "TollTransponders": true, "ZoneCategories": [{"Category": "Environmental"}]}' \ --travel-mode "Scooter" Learn how to use CalculateRouteMatrix In this section you learn how to use CalculateRouteMatrix to find efficient routes for multiple origins and destinations. Topics • How to calculate a route matrix of distance and time for multiple origins and destinations • How to calculate route matrix with avoidance How to calculate a route matrix of distance and time for multiple origins and destinations The CalculateRouteMatrix API calculates routes and provides travel time and travel distance for each combination of origins and destinations. This capability is useful for applications requiring route planning and optimization across multiple locations. Potential use cases • Optimize route planning: Use the route matrix as input for route optimization software to enhance service efficiency and reduce travel time. Use CalculateRouteMatrix 719 Amazon Location Service Examples Developer Guide CalculateRouteMatrix with an unbounded routing boundary Sample request { "Origins": [ { "Position": [-123.11679620827039, 49.28147612192166] }, { "Position": [-123.11179620827039, 49.3014761219] } ], "Destinations": [ { "Position": [-123.112317039, 49.28897192166] } ], "DepartureTime": "2024-05-28T21:27:56Z", "RoutingBoundary": { "Unbounded": true } } Sample response { "ErrorCount": 0, "RouteMatrix": [ [ { "Distance": 1907, "Duration": 343 } ], [ { "Distance": 5629, "Duration": 954 } ] Use CalculateRouteMatrix 720 Amazon Location Service ], "RoutingBoundary": { "Unbounded": true } } cURL Developer Guide curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/route-matrix?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origins": [ { "Position": [-123.11679620827039, 49.28147612192166] }, { "Position": [-123.11179620827039, 49.3014761219] } ], "Destinations": [ { "Position": [-123.112317039, 49.28897192166] } ], "DepartureTime": "2024-05-28T21:27:56Z", "RoutingBoundary": { "Unbounded": true } }' AWS CLI aws geo-routes calculate-route-matrix --key ${YourKey} \ --origins '[{"Position": [-123.11679620827039, 49.28147612192166]}, {"Position": [-123.11179620827039, 49.3014761219]}]' \ --destinations '[{"Position": [-123.11179620827039, 49.28897192166]}]' \ --departure-time "2024-05-28T21:27:56Z" \ --routing-boundary '{"Unbounded": true}' Use CalculateRouteMatrix 721 Amazon Location Service Developer Guide CalculateRouteMatrix with a geometry-based routing boundary Sample request { "Origins": [ { "Position": [-123.11679620827039, 49.28147612192166] }, { "Position": [-123.11179620827039, 49.3014761219] } ], "Destinations": [ { "Position": [-123.112317039, 49.28897192166] } ], "DepartureTime": "2024-05-28T21:27:56Z", "RoutingBoundary": { "Geometry": { "AutoCircle": { "Margin": 10000, "MaxRadius": 30000 } } } } Sample response { "ErrorCount": 0, "RouteMatrix": [ [ { "Distance": 1907, "Duration": 344 } ], [ { "Distance": 5629, Use CalculateRouteMatrix 722 Amazon Location Service Developer Guide "Duration": 950 } ] ], "RoutingBoundary": { "Geometry": { "Circle": { "Center": [ -123.1142962082704, 49.29147612191083 ], "Radius": 11127 } }, "Unbounded": false } } cURL curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/route-matrix?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origins": [ { "Position": [-123.11679620827039, 49.28147612192166] }, { "Position": [-123.11179620827039, 49.3014761219] } ], "Destinations": [ { "Position": [-123.112317039, 49.28897192166] } ], "DepartureTime": "2024-05-28T21:27:56Z", "RoutingBoundary": { "Geometry": { "AutoCircle": { "Margin": 10000, Use CalculateRouteMatrix 723 Amazon Location Service Developer Guide "MaxRadius": 30000 } } } }' AWS CLI aws geo-routes calculate-route-matrix --key ${YourKey} \ --origins '[{"Position": [-123.11679620827039, 49.28147612192166]}, {"Position": [-123.11179620827039, 49.3014761219]}]' \ --destinations '[{"Position": [-123.11179620827039, 49.28897192166]}]' \ --departure-time "2024-05-28T21:27:56Z" \ --routing-boundary '{"Geometry": {"AutoCircle": {"Margin": 10000, "MaxRadius": 30000}}}' How to calculate route matrix with avoidance The CalculateRouteMatrix API computes routes and returns travel time and distance from each origin to