How to create geographical reports in SAS VA using custom polygons: a three-step approach

Many businesses operate within a certain geography or have a specific geographic relevance. For these businesses, visualizing their business data on enhanced maps is of material importance in gaining valuable insights. And SAS Visual Analytics (VA) lets them to do just that, even though it does not always offer the necessary geographic variables as a standard feature. That’s where custom polygons come in, allowing businesses to customize every map to their specific business needs.

In general, visualization already works better than showing tabular data. And visualizing your business data on top of a geographical map is yet another important step in rendering that data into valuable information from which to gain actionable business insights.

As we explained in another post, though, in order to obtain those precious insights, it is sometimes necessary to customize a map. And one way of doing that is by creating your very own custom polygons.

SAS offers specific functions to help you create those custom polygons, based on groups of existing polygons such as provinces, municipalities and other geographic variables that are readily available as standard features in Visual Analytics.

Lets’s take a closer, more detailed look now at how you can use custom polygons to easily produce your own tailor-made reports in SAS VA.

Step 1: Creating polygon definitions

First, of course, the custom polygons need to be created. There are always shape files you can find, retrieve or buy which contain standard polygon information about a nation’s geography, such as regions, provinces, municipalities and communes. Based on those polygons, you can now start to create your own custom polygons by grouping some of the aforementioned shape files together. In our example we will use Belgium, our home country, as a nation. Some names of regions will be typically Belgian. A similar logic can be applied to other countries’ regions, though.

SAS has some specific geographical procedures that can be used for this. To start, we need to import the available shape files of the municipalities by using the PROC MAPIMPORT procedure. As a second step, we need to join these imported municipalities with the sectors we have defined ourselves based on grouping some municipalities together in one sector.

PROC MAPIMPORT procedure in SAS Visual Analytics

As a result, we now have the polygon information of each municipality in a sector linked to that sector itself. But to be able to use this properly, we need to redefine the outline of the polygon that groups all those municipalities together. This is achieved by using the PROC GREMOVE procedure of SAS.

PROC GREMOVE procedure in SAS Visual Analytics

The only thing remaining for us is now to join the information to the correct location. There are mainly two tables that need to be adapted to be able to use the polygon definitions in our VA reports. Both tables can be found in the VALIB folder in the SAS config folder:

  • ATTRLOOKUP: contains the information about the custom created polygons themselves, both for the groups of all polygons and for each created polygon separately. Here you define an ID, a label, a unique prefix (2 letters), a name, an ISO code and an ISO name.
  • CENTLOOKUP: this table contains the coordinates that need to be connected for each polygon. So, here you define the map name, the ID and the X and Y coordinates for each polygon out of the dataset you created using the PROC GREMOVE procedure.

Step 2: Uploading polygon info to SAS VA

To be able to use our custom polygons in SAS Visual Analytics reports, we need to make sure now that the two previously created tables (ATTRLOOKUP and CENTLOOKUP) are stored on the SAS VA server in the correct location. Then that server needs to be restarted to make sure that the polygons and their definitions are loaded properly into memory, so they are ready for use in the SAS VA reports.

When you have defined formats on the polygon IDs to show names instead of meaningless IDs, you also need to make sure that those formats are set in the table and that the formats catalog is also loaded to the VA platform. User-defined formats are not automatically loaded to SAS Visual Analytics. You need to put the catalog with the formats in the defined location on the SAS configuration of your VA platform. More details can be found here.

Step 3: Creating your own reports in SAS Visual Analytics with custom polygons

To use the custom polygons for your reports, you start by creating a new report and selecting a dataset that contains figures together with the IDs for the sectors you’ve defined.

When viewing the available columns of the selected dataset, you need to right-click on the sector ID and select geographical -> Custom polygon. Then you can select your created custom sector name from the list. When you now add a “Geo Region Map” to the report and drag your ID on it, together with a metric, it will show the polygons.

You can tweak your report by changing the colouring, transparency, contrast, etc. of the polygons based on the selected metric or standard.

custom regions in SAS Visual Analytics

This is an example of custom regions created from lower-level existing regions.


As you can see, it is not all that difficult to create your own professional SAS Visual Analytics report, using custom polygons with defined regions or sections. All in all, there are just three small steps to take:

  1. Create the custom polygons with SAS code
  2. Upload the custom polygons information to the VA platform
  3. Use the custom polygons to create your own tailor-made geographical reports

Simply follow these steps and in no time you’ll be creating reports that are better adapted to the specific needs of your company and/or your clients.

Still have some open questions? We are here for you!

Tim Geenens, SAS Technical Expert at LACO

Tim Geenens

SAS Technical Expert at LACO

Bart Van Win, Data Intelligence Consultant at LACO

Bart Van Win

Senior DI Consultant / Data Visualization Expert at LACO

    Keep your data intelligence knowledge up to date

    Our newsletter takes care of it!