Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

GeoMapping with SAS VA

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 16
Accepted Solution

GeoMapping with SAS VA

Hi,


Does anyone know how to Geomap Australian postcodes on SAS VA.

 

I am using the ESRI shapefiles that can be downloaded from the ABS.

 

http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1270.0.55.003July%202016?OpenDocument

 

Thanks

David


Accepted Solutions
Solution
‎04-25-2017 08:53 PM
SAS Super FREQ
Posts: 296

Re: GeoMapping with SAS VA

Now that VA 7.4 has shipped, I can point you here:

 

http://support.sas.com/documentation/cdl/en/vaag/69958/HTML/default/viewer.htm#n0g5kjtnbvsrwbn1lxl2w...

 

These instructions are for 7.4, but they should also work in 7.1-7.3. This process is not *supported* on those releases, however.

 

Let us know how it goes if you try it!

 

Thanks,

Sam

View solution in original post


All Replies
SAS Super FREQ
Posts: 296

Re: GeoMapping with SAS VA

[ Edited ]

Hi David,

 

In the current releases of VA, adding custom geo regions is an unsupported workaround.

 

In VA 7.4, this feature will be supported and there will be documentation in the VA Administrator's Guide.

 

Meanwhile you might want to look at this thread:

https://communities.sas.com/t5/SAS-Visual-Analytics/Geo-Maps-for-Australia/m-p/323845/

 

Thanks,

Sam

Occasional Contributor
Posts: 16

Re: GeoMapping with SAS VA

Hi Sam,

 

Looking at those threads, I have managed to create the "bubbles" using the x and y (lat and long) co-ordinates. However, I am still struggling with the "regions" bit.

 

From the threads, it looks like if I want anything more granular than the default SAS maps, I will need to alter the ATTRLOOKUP and CENTLOOKUP files in the Valib library, which is fine because I can work that out later.

 

The problem is that I cannot even point to the default Australian maps in the libraries: MAPS and MAPSGFK to show up as regions in SAS VA.

 

David

SAS Super FREQ
Posts: 296

Re: GeoMapping with SAS VA

Hi David,

That is correct, you need to alter the ATTRLOOKUP and CENTLOOKUP files. (Be sure to back them up first!)

I am going to have someone from tech support provide a little more info (despite the unsupported status, they have good information about how this works)

Thanks,
Sam
SAS Super FREQ
Posts: 296

Re: GeoMapping with SAS VA

Oh, also: you say you cannot point to MAPS or MAPSGFK -- you can use these libraries a SAS programming environment, right? Like with PROC GMAP?

It is expected (though frustrating) that the geo regions in those libraries are not available in VA.
Occasional Contributor
Posts: 16

Re: GeoMapping with SAS VA

Yes I can PROC GMAP it, but I found a way around in VA. I just import the data into VA from MAPS/MAPSGFK location.

 

It is frustrating because I was able to produce a postcode level heat map using PROC GMAP, because I could not zoom and pan the map, I thought VA would be a better tool not realising how difficult it would be.

SAS Super FREQ
Posts: 296

Re: GeoMapping with SAS VA

Hi David, did you not want to make a region (choropleth) map? Altering the ATTRLOOKUP and CENTLOOKUP is needed only for region maps.

Thanks,
Sam
Occasional Contributor
Posts: 16

Re: GeoMapping with SAS VA

Correct, choropleth map (heat map).

 

I am trying the alterations to the ATTRLOOKUP and CENTLOOKUP files in the next few days, the instructions are not very clear.

Solution
‎04-25-2017 08:53 PM
SAS Super FREQ
Posts: 296

Re: GeoMapping with SAS VA

Now that VA 7.4 has shipped, I can point you here:

 

http://support.sas.com/documentation/cdl/en/vaag/69958/HTML/default/viewer.htm#n0g5kjtnbvsrwbn1lxl2w...

 

These instructions are for 7.4, but they should also work in 7.1-7.3. This process is not *supported* on those releases, however.

 

Let us know how it goes if you try it!

 

Thanks,

Sam

Occasional Contributor
Posts: 16

Re: GeoMapping with SAS VA

Awesome, very clear.

Just one question, when I proc mapimport the shape files from ABS, the final dataset has the projected x and y, but not the unprojected lat and long (used by VA). Is there a function to convert projected to unprojected?

 

David

SAS Super FREQ
Posts: 296

Re: GeoMapping with SAS VA

[ Edited ]

I'm not sure about the answer to your question, but it is recommended that you use the SAS program provided here:
http://support.sas.com/rnd/datavisualization/vageo/va74polygons.sas

The link to this from the doc is broken and I will fix it ASAP Smiley Sad

Occasional Contributor
Posts: 16

Re: GeoMapping with SAS VA

Sam,

 

I cannot seem to get this working, the map does not load without any error messages.

I think it is because I am missing unprojected Lat and Long.


According to the documentation:

LONG
contains the unprojected longitude value for the point specified in this region. SAS Visual Analytics uses this value for its polygons. Therefore, this value is required to be present and accurate in the final file.
LAT
contains the unprojected latitude value for the point specified in this region. SAS Visual Analytics uses this value for its polygons. Therefore, this value is required to be present and accurate in the final file.
 
However, in the link to va74polygons.sas, the code just assigns the X and Y (projected) as the Lat and Long.
/* Step 3: Create the final polygon data set with the required set of columns. We are going to create a new
shorter ID column here as the original ID columns are often long and unnecessarily complex. Note, we also apply 
the previously created idname format to the IDNAME column. 
*/
data &REGION_DATASET.;
   set &REGION_DATASET.(keep=&REGION_SHP_ID_COL. X Y SEGMENT DENSITY);

   /* create new (shorter) ID */
   length _TMP_ $60. _SID_ 8.;

   if (_n_ eq 1) then
      do;
         _SID_ = 1;
         _TMP_ = &REGION_SHP_ID_COL.;
      end;

   if _TMP_ ne &REGION_SHP_ID_COL. then
      _SID_ = _SID_ + 1;
   _TMP_ = &REGION_SHP_ID_COL.;
   retain _TMP_ _SID_;
   drop _TMP_ _SID_;
   _RID_ = compress("&REGION_PREFIX.-" || put(_SID_,8.));
   IDNAME = put(&REGION_SHP_ID_COL., idname.);
   LONG = X;
   LAT = Y;
   ISO = "&REGION_ISO.";
   RESOLUTION = 1;
   LAKE = 0;
   ISOALPHA2 = "&REGION_PREFIX.";
   AdminType = "regions";
   where density<&REGION_SHP_DENSITY.;
   keep _RID_ SEGMENT IDNAME LONG LAT X Y ISO DENSITY RESOLUTION LAKE ISOALPHA2 AdminType;
   rename _RID_=ID;
run;
 
David
Occasional Contributor
Posts: 16

Re: GeoMapping with SAS VA

Hi,

 

Actually never mind, my map does have the unprojected degrees Lat and Long (compared against MAPSGFK.AUSTRALIA).

 

I don't know then why it does not work for me.

 

David

SAS Super FREQ
Posts: 296

Re: GeoMapping with SAS VA

Hi David,

 

So does the va74polygons.sas program run without errors in the SAS log?

 

Did you restart the web application server where VA is deployed?

 

Did you perform this step, especially the bolded part?

 

MAPSCSTM Library

Before you can create custom polygons, you must define a MAPSCSTM library to contain the custom polygon data sets. The recommended location for this library is at SASHOME/SASFoundation/9.4/mapscstm or within the same directory location as the default MAPSGFK library. Include a LIBNAME statement in your appserver_autoexec_usermods.sas file, located by default at config-dir/Lev1/SASApp that references this directory. If your SAS Visual Analytics deployment runs on multiple server contexts, then add the LIBNAME statement to the file for each server context.
 
Thanks,
Sam

 

Occasional Contributor
Posts: 16

Re: GeoMapping with SAS VA

Yes I have done all the above.

 

I wonder if it could be the CENTLOOKUP file?

E.g. pre-existing Africa is 

MAPSGFK.VAAFRICA ZM 25.453593492 -13.158901
MAPSGFK.VAAFRICA1 ZM-1 29.818409448 -13.8493635

 

but for custom region it is the same map

MAPSCSTM.AUS_POA1_NT1 NT 143.16289226 -31.30053917
MAPSCSTM.AUS_POA1_NT1 NT-1 130.84323616 -12.46017601

 

David

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 27 replies
  • 996 views
  • 3 likes
  • 4 in conversation