Desktop productivity for business analysts and programmers

Create a UK Heat Map using Tasks / Graph in Enterprise Guide

Reply
Occasional Contributor N_C
Occasional Contributor
Posts: 7

Create a UK Heat Map using Tasks / Graph in Enterprise Guide

Hi,

 

Can anyone help me understand how to create a heat map of the UK please?  I've tried using Tasks/ Graphs / Map Chart and using the SAS.maps.uk as my Data Source but I don't know how to link this to my data to show how many customers we have in each region.  I expected to find a common field such as Postcode.  I've tried several different options but just end up confusing myself each time so thought I'd ask for help.....

 

Thanks.

Super User
Posts: 11,144

Re: Create a UK Heat Map using Tasks / Graph in Enterprise Guide

If I understand the Maps.UK dataset I have then the variable ID represents something called a Division which looks like it should be a geographical region. Your response data would need to have a variable named ID with numeric values that match those division variables and should be indicated as the ID variable for the data.

Maps.UK would be the MAP source and your response data would be the DATA source.

 

Are you getting any map or just errors? If you are getting some sort of map post the generated code and we may be able to provide more hints.

 

The generated code that should get you started would look something like this:

proc gmap data=yourdata map=maps.uk;
  id id;
  choro customercountvariable;
run;
quit;
Occasional Contributor N_C
Occasional Contributor
Posts: 7

Re: Create a UK Heat Map using Tasks / Graph in Enterprise Guide

I'm not coding it as I'm using the task funtion so I don't have anything to show you.  I don't understand what the divisions / regions relate to though.  I think that I'd need something to explain what they are so that I can create something in my dataset based on postcodes.   

Super User
Posts: 11,144

Re: Create a UK Heat Map using Tasks / Graph in Enterprise Guide

I have attached a map of the divisions as they appear in the maps.uk dataset that I have. You may also have a maps.UK2 which is a feature data set and has the value of the ID variable, a region and and variable IDNAME that names the ID except for the islands in the boxes which are only refered to as "BOX"

 

EG should generate code if asked to.

 

 


gmap82.png
SAS Super FREQ
Posts: 307

Re: Create a UK Heat Map using Tasks / Graph in Enterprise Guide

[ Edited ]

If you are using the Map Chart task (in Tasks->Graph), the Data page is where you specify the map data source and your response data source.  The two data sets have to have a column of the same name that identifies the regions in the map.  For example, you would probably use MAPS.UK as the map data source in this case (unless you are looking for different regions).  Your response data source needs to have one record for each region (ID variable) you want to plot response data for, that corresponds to the IDs in the map data source.  The easiest way to get your response data in this format is to join it with the feature table (ex. MAPS.UK2), since it already has corresponding ID column.

 

Attaching a few overlayed screenshots, showing a process flow joining response data to feature table (MAPS.UK2), then using the result as the response data input along with the map (MAPS.UK) to the Map Chart task, and the end result.

 

usingMapChartTask.png

 

Casey

 

ps- You can see the code generated by tasks by clicking the Preview code button in the bottom-left corner of the task dialog.


usingMapChartTask.png
Ask a Question
Discussion stats
  • 4 replies
  • 217 views
  • 0 likes
  • 3 in conversation