logo
Menu
Amazon Location Service Plugin for QGIS released in OSS

Amazon Location Service Plugin for QGIS released in OSS

I released the QGIS plugin as OSS, utilizing Amazon Location Service, which is probably the world's first!

Published May 27, 2024
Although I have written a QGIS plugin book and released several QGIS plugins in the past, I enjoyed developing QGIS for the first time in a long time.
This is probably the first attempt in the world to develop a QGIS plugin using Amazon Location Service, and I have decided to release this plugin as OSS. This plugin has not yet implemented all the features, but I plan to add more.
Location information technology is being used in a variety of fields. I hope that through this plugin, more people will discover the convenience and potential of the Amazon Location Service. Please give it a try!
In this article, I will introduce how to use this plugin.

Advance Preparation

Building an Amazon Location Service Resources

In advance, build Amazon Location Service resources.
Select from the following to build your resources.
  • AWS Management Console: Manually configure the resource using the GUI.
  • AWS CDK: Automate your infrastructure with code.
  • AWS CloudFormation: Automatically build resources using templates.

How to use plugins

Install QGIS Plugin

Install QGIS plugins. Plugins are registered in the official repositories and can be installed directly from QGIS.
  1. Select "Plugins" → "Manage and Install Plugins..."
  2. Search for "Amazon Location Service"

Menu

Once the plugin is installed, a menu will appear. There are five types of menus: Config, Map, Place, Routes, and Terms.
  • Config: Set each resource name and API key
  • Map: Map display function
  • Place: Geocoding function
  • Routes: Routing function
  • Terms: Display Terms of Use page

Config Function

Configure various settings. Configure region name, API key, Map name, Place name, and Routes name.
  1. Click the “Config” menu
  2. Set each resource name and API key
    • Region: ap-xxxxx
    • API Key: v1.public.xxxxx
    • Map Name: Mapxxxxx
    • Place Name: Placexxxxx
    • Routes Name: Routesxxxxx
  3. Click “Save“

Map Function

This is a map display function. Creates a vector tile layer in QGIS using the acquired vector tiles.
  1. Click the “Map” menu
  2. Select “Map Name“
  3. Click “Add“
  4. The map is displayed as a layer
QGIS does not support all vector tile styles, so some styles may not be displayed.

Place Function

This is a geocoding function. Creates a point layer in QGIS using the acquired address data.
  1. Click the “Place” menu
  2. Select “Select Function“
  3. Click “Get Location“
  4. Click on the location you wish to search
  5. Click “Search”
  6. Search results are displayed in layers

Routes Function

This is a routing function. Create a line layer in QGIS using the acquired route data.
  1. Click the “Routes” menu
  2. Select “Select Function“
  3. Click “Get Location(Starting Point)“
  4. Click the starting point
  5. Click “Get Location(End Point)“
  6. Click on the endpoint
  7. Click “Search”
  8. Search results are displayed in layers

Terms Function

This function displays the Terms of Use.
  1. Click the “Terms” menu
  2. The Terms of Use page will be displayed in your browser.

Plugin Code

The following is a partial code of the plugin.
Overall Configuration

metadata.txt

This is the configuration file for the QGIS plugin. It contains metadata such as plugin name, version, icon path, etc.

location_service.py

This is the main process. It initializes the plugin UI and configures various functions.

ui/map/map.ui

This is the UI file, which defines labels, combo boxes, and buttons in the dialog created by Qt Designer.

ui/map/map.py

This is the UI processing; it loads UI components and displays configuration options.

utils/click_handler.py

This is the map click process. It retrieves the coordinates of the clicked position on the map and reflects them in the specified UI.

functions/routes.py

This is the routing function. It creates a line layer in QGIS using the acquired route data.

Terms

Amazon Location Service has terms of use for data usage. Please check the section “82. Amazon Location Service” and use the service at your own risk.
When using HERE as a provider, in addition to the basic terms and conditions, you may not.
a. Store or cache any Location Data for Japan, including any geocoding or reverse-geocoding results.
b. Layer routes from HERE on top of a map from another third-party provider, or layer routes from another third-party provider on top of maps from HERE.

Comments