BookmarkSubscribeRSS Feed
sasdavo
Calcite | Level 5

Hi All,

 

I am attempting to create a county-level choropleth map of the United States in SAS Visual Analytics.  Although there are default options for state-level choropleth maps and ZIP-level choropleth maps in SAS Visual Analytics, there is not an option for county-level choropleth maps.

 

Note that there appears to be a session at the upcoming SAS Global Forum on this exact topic:

https://sasglobalforum2016.lanyonevents.com/connect/sessionDetail.ww?SESSION_ID=3460

 

Since I would prefer not to have to wait a few months for a solution to this problem, does anyone currently know how to create a county-level choropleth map in SAS Visual Analytics?

 

Thank you very much.

28 REPLIES 28
AngelaHall
SAS Employee

Hi sasdavo!

You have asked and you shall receive. Included is a snippet of the paper which corresponds to your request to map by county. Once these changes have been made, you can use county name or FIPS code with the 'Geography' data type.

 

Included are examples:

 

Subdivision (State, Province Names)*

County Name

Prince William

Subdivision (State, Province) SAS Map ID Values*

FIPS Code

US-51153

 

Be sure to stop by the SAS Solutions OnDemand booth in Vegas and say Hi!

Angela Hall

Director, Analytic Integration Consulting

Sam_SAS
SAS Employee

Thanks Angela for sharing your paper!

 

It should be noted that officially VA does not support adding custom regions, from a technical support perspective.

 

Sam

 

mduarte
Quartz | Level 8

Hi Angela (anybody else - please also free to comment!).  

 

I have attempted to add custom regions using your paper downloaded from the SAS Global Forum 2016 site referenced above (and also the paper attached by @mtoledo on the Import shapefile in SAS Visual Analytics v7.1 topic).  

 

I am using SAS VA7.3 and wanted to check first of all, whether any changes need to be made so that custom regions work in this version of SAS?  If not, I wouldn't mind any tips on what can be wrong ... 

 

I have made a dataset AU_STAT1 - which contains Australian statistical area level 4 data and placed it in the MAPSGFK library and been given read and write access to it.  I have also updated attrlookup and centlookup.  I am able to create bubble charts based on a test dataset so my conclusion is that attrlookup and centlookup are working fine. However, I cannot create region charts, so my conclusion is that SAS VA can't find (either through miscommunication or otherwise) the datasets that I created that are referenced to in the mapname field of centlookup.  Are you able to think of what could be wrong?

 

We have restarted all SAS services, but also want to check if this is still necessary? -  as changes were seen in attrlookup and centlookup in valib before restarting.

 

Edit: I attempted to attach my versions of centlookup, attrlookup and au_stat1 (however received an error message that the contents of the file did not match the file type ... )

 

Any help will be greatly appreciated.

 

Thanks,

Marie

 

 

 

mtoledo
Calcite | Level 5

Hi @mduarte,

 

When you plot a buble map do you actually see those bubles inside the region, i mean can you see state / county map as background or bubles are plotted to a gray background?

 

If you are getting bulbes in a gray background, I suggest you to check the coodirnate system that your original shape file is using. SAS VA works with WSG8. If you need to convert to it, you can use the GPROJECT procedure.

proc gproject data=[PROC MAPIMPORT  OUTPUT] out=NEW_TABLE
from="EPSG:2157" to="EPSG:4326";
id COLUMN_A;
run;

 

OR 

 

proc gproject data=[PROC MAPIMPORT  OUTPUT] out=NEW_TABLE
from="+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=0.99982 +x_0=600000 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" to="EPSG:4326";
id COLUMN_A;
run;

 

* EPSG:4326 = WSG84 

 

Cheers,

Marcel

mduarte
Quartz | Level 8

Hi Marcel, 

 

The bubble map shows the country as follows:

Capture.PNG

 

I currently have x and y the same as longitude and latitude, but have created a dataset (ready for upload to the server) in which I create x and y by projecting longitude and latitude as follows:

proc gproject data=temp OUT=FP_polygon_proj degrees;
id sa4_code11 ;
run;

(This loses longitude and latitude and so I merge with the original dataset (temp) to have longitude and latitude in addition to x and y)

 

Unfortunately, our sas administrator is away and so I have no way to test this new dataset (no access to upload 😞 until after New Years ... 

 

I have also attached an Excel file with extracts of the polygon data (AU_STAT1), ATTRLOOOKUP and CENTLOOKUP with master data and data for one region.

 

Hopefully changing x and y works.. Otherwise, in one of the referenced papers, the name had to end with 1, it wouldn't now have to start with "VA" as well would it?  It seems all map names in centlookup start and end with 'VA' and '1', respectively ... I am at a loose end at what else to try!

 

Marie

 

Sam_SAS
SAS Employee
Hi Marie,

The dataset does not have to start with "VA". It does have to end with "1", but your "AU_STAT1" should be fine as far as the name.

Please let us know if you have luck with your new data set.

FYI, custom map polygons is one of the top feature requests for VA and better support is planned for the near future.

Sam
mduarte
Quartz | Level 8

Hi Sam - I have finally been able to try the new dataset but it still doesn't work. Do you have any suggestions on what else I can try?

 

 

mduarte
Quartz | Level 8

Note that if I read in MAPSGFK.AU_STAT1 (now AUSTAT41) and plot the longitude and latitude (by defining IDNAME as a custom region) for a subset of the data (two IDNames) I can see the bubbles in the correct places (i.e. defining a region) so it seems the longitude and latitude are correct .... Untitled.png

mtoledo
Calcite | Level 5

Hi @mduarte,

 

 

Your dataset seems to be ok. To display regions in VA you need to do as follows:

 

Create a sample data set.E.g

 

ID IDNAME Value
"AX-208" "Melbourne - Inner South" 1231

 

 

Within VA.

 

  1. Define the ID category as Geography - select Subdivisions (State,Province) SAS Map ID Values
  2. Define the IDNAME category as Geography - select Subdivisions (State,Province) SAS Names - Then, select Australia Statistical Area as the map name.
  3.  Add the IDNAME Geography item to a GEO Region Map and then add the Value mesure to it.

 

It should work.

 

Cheers,

Marcel

 

 

 

mduarte
Quartz | Level 8

Thanks Marcel - I had created a test dataset and tested as you prescribed - but unfortunately I cannot see any region (unfortunately even with the projected coordinates ).. only bubbles.

Sam_SAS
SAS Employee

Marcel's instructions should work.

 

Is it possible that you are seeing bubbles because the wrong type of mapping report object is displayed? That is, rather than using an autochart, specifically select a "Geo Region Map".

mduarte
Quartz | Level 8

Just to clarify - the bubbles I see when the bubble map is selected (either via the automap or Geo Map, Map Style "Bubbles" , only the background map is what I see when I select the region map (via Geo Map, Map Style "Regions")

BobW_HBF_Oz
Fluorite | Level 6

I am adding this reply so that I can help if possible.

 

I am actively working on exactly the same problem, luckily, I am an administrator as well, so hopefully I can try a few thinngs as I go.

 

I thought I had everything all setup, but still not seeing regions, even though the data I have successfully and beautifully produces GMAP output.

 

I am not entirely clear under what circumstances I need to restart my SAS VA web service though.

At this stage, I am assuming every time I change anything in the MAPSGFK library that might affect the exisiting metadata.

 

I also have a custom Maps library, but VA doesn;t seem to see any of that.

 

I am currently running my GREDUCE on some ESRI Shape files, so I will keep you posted with any progress.

 

 

 

Cheers

 

Bob Whitehead

SAS Contractor

 

(SAS VA 7.3 Linux Distributed)

 

mduarte
Quartz | Level 8

Lets hope we both get this working soon!!  

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 28 replies
  • 7039 views
  • 13 likes
  • 10 in conversation