A Voice User Interface for ArcGIS using REST and Alexa

23rd July 2020

ESRI are continually striving to increase the accessibility of ArcGIS. Now, you might be thinking what is meant by ‘accessibility’? Here, we are concerned with more than just making ArcGIS available over the web. We want our platform to be as usable as possible, to as many people as possible, regardless of age or ability. People with impaired sight can have difficulty getting information visually from a map, so in our research department we have been busy thinking of innovative ways to interact with ArcGIS. In fact, many everyday inventions we now take for granted originally started as reasonable adjustments to cater for people with disabilities, automatic doors being one example. In this article I will talk you through how we created a Voice User Interface (VUI) for ArcGIS using the virtual assistant Amazon Alexa.

To many of us, voice is the most natural method of communication and as virtual assistants increase in popularity, the ability for machines to understand speech is rapidly accelerating. Moreover, VUIs provide a hands and eyes free way of interacting with a machine while you focus your attention elsewhere. After all, why work your way through a Graphical User Interface (GUI) when you could query and analyse spatial data from the comfort of your favourite armchair! Through our REST API, we can easily integrate ArcGIS with external third-party systems and this project is a great example of its openness.

Remember ArcGIS is a set of open web services which deliver maps, data and spatial analytics to anyone, anywhere, on any device. This all works through our REST API which, as a REST-JSON API, is familiar to developers. Consider the below URL:


When used in a GET request, we are searching in the account specified by the organisation ID, then looking for a feature service named schools and returning the first layer in that feature service. The layer can be queried to return JSON objects:

The data can then be processed and used in any number of applications, third party or otherwise. This also works the other way around in that I can perform updates/inserts to feature services or input parameters into analysis services, using data generated from outside ArcGIS via REST. Essentially any language or programme that can make HTTP requests (of which there are many) can act as a client to ArcGIS by communicating over our REST API.

We set about creating our VUI with three aims in mind:

  1. Increase the accessibility of ArcGIS.
  2. Illustrate the openness of the ArcGIS REST API.
  3. Demonstrate how we could create functionality in Alexa to help reduce load on local government authority call centres.

To make the VUI we created a custom Amazon Alexa Skill written in JavaScript. The Skill takes in speech input from the user, conducts spatial analysis on that speech input using the ArcGIS REST API, and then returns the results of that analysis to the user via a virtual assistant device (e.g. an echo dot). We thought a VUI could decrease the pressure on local government authorities call centres by providing automated responses to common questions such as ‘where is my nearest facility?’ (e.g. school). This question is inherently spatial and depends on my location, the closest school to me will be different than for you. The below JavaScript function queries a feature layer by finding all features (e.g. schools) within a given distance of a point, returning a JSON response containing an array of features:

Then I can use the first school returned to get my nearest neighbour and use the attributes of that school in Alexa’s speech output. By using the Amazon address API, we can access our location through the address input in the Alexa app. The clever part here is that this is using live data. Alexa is querying data from ArcGIS Online via REST at runtime so any updates to feature services will instantly be present in any speech output from Alexa.

Other common questions such as ‘when are my bins collected?’ can be answered in a similar way. However, in this case we are not looking for our nearest neighbour, but the postcode our house is located within. This is easily achievable by finding the postcode polygon that contains our house point, then we can read the attributes of that polygon to discern what days the bins are due to be collected.

We also created functionality where users can report incidents such as graffiti or a pot-hole to their local council. The dynamic address from the user’s device is obtained and then REST is used to create a new point in an incidents dataset.

These are simple examples but the point I am making is that we get access to the full functionality of ArcGIS via the REST API, whether that be accessing and updating data, or analysing it. We can combine this functionality in any way we see fit to meet our organisations custom workflows.

I hope this article has shown you the flexibility and openness of ArcGIS, as well as how easy it is to create a VUI for ArcGIS. If you want to get started creating your own VUI, please visit the Sonar GitHub repo which contains JavaScript functions to help you create chat bots as well as the getting started with creating your own custom Amazon Alexa skill page. If you want to learn more about our REST API please visit our developers website. Finally, a video demonstrating the work we did can be found here.