Recently, I received a request for a technique to display the location of SAS offices as a layer to a Visual Analytics geo map to serve as reference points to activity in the source data. The geo map was already plotting bubbles for recent hotel activity but the user wanted to enrich the visual by also showing the nearest SAS office location. In this article, I will explain how to create an ESRI Web Map to render a pin point for each SAS office around the world.
In bouncing ideas around with my colleagues, we thought to create custom polygons and import them in Viya. But this doesn't really meet the requirements. Custom polygons are nice when needed to build out areas on a geo map based on the border of the area. Unfortunately, custom polygons will not look as "slick" as a Google map.
So, I thought we could use Google maps combined with the Data-Driven Content object, but I would have to learn all the ins and outs from Google Map API (and give money to Google). This might be something I would spend some time on, but it would take too long to provide an answer.
I then came up with another idea: let's create a SAS Office Layer using ESRI. In our case, we will integrate the ESRI Web Map in a Data-Driven Content object. Therefore we will use a project developed by SAS on GitHub: sas-visualanalytics-geowebmap
You might wonder why using Data-Driven Content object instead of the map object in VA. I've to admit that I was originally thinking to create a Tile Layer in ESRI and to use it. Unfortunately, I could not create the map I wish. This is where the project on GitHub came into the game.
In order to create the map and make it available, you should have an ESRI server hosted at your company or an account on ArcGis website. In this case, I will use the ArcGIS website as I don't have a custom server.
For this example, I will use a list of the SAS offices around the world. The data will be loaded on the ArcGIS server to create the layer. The input data is in the form of a CSV file which contains latitude, longitude and additional descriptive information that can be displayed on the pin points.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
There are different ways to integrate. What we want to do is add pin points for SAS Offices on to a street level map. Therefore we will need to first import our SAS Office coordinate information on top of an existing map so it has both the SAS Office pins and the level of detail we want, street level in this case.
You have now loaded the layer and the import process has identified that the file contained the necessary latitude and longitude data. If you click on one of the pin points, you will see the extra detailed information in the tooltip.
Using the instructions in the GitHub project, it details how to deploy the web application on the web server that comes configured with SAS Viya. You could, if needed, host the project on another machine.
To achieve the deployment from your machine, you should have the following components installed:
Here are the steps to build and deploy the web application on the web server hosted on SAS Viya environment.
npm install
npm run build
/var/www/html location
. We need to ask the System administrator to give access to the user who will upload the files. Of course, the user who will upload the files should be allowed to ssh to the SAS environment. As soon as the user can connect to the environment and write to /var/www/html location, we can create a folder in that location: geowebapp
rsync -arvz dist/* sbxxab@va84.gel.sas.com:/var/www/html/geowebapp
We have now all the needed components to display the map within a Visual Analytic report. We will create a report with a Data-Driven Content object and use the web application to display the map using the data passed from the report.
To get the reference to the ESRI Web Map, you should open the map within ESRI and copy the id from the URL. In our case, the URL is: http://sasinc.maps.arcgis.com/home/item.html?id=e0a6b464d7bb4417b0be6ca9a86600fe.
In this example, the reference is: e0a6b464d7bb4417b0be6ca9a86600fe
We have all the needed information to build the URL for the Data-Driven Content object. Here is the final version:
http://pdcesx03199.race.sas.com/geowebapp/?portalItemId=e0a6b464d7bb4417b0be6ca9a86600fe
&x=Hotel%20Longitude
&y=Hotel%20Latitude
&visualizationType=bubbles
&size=Total%20Nights
The URL should appear on one line, but for readability, I split it.
If you compare the Geo map objects that are available out of the box with this web application, you will see that you are getting extra options.
Even though this technique requires extra setup when compared to using maps that are available, the tool made available on GitHub makes it easy to use ESRI Web Maps. There is no need to be an expert in ESRI or to install any ESRI component on the development machine. With an ESRI account, you can create the map with the layers you want and use within SAS Visual Analytics for visualization.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.