BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
davidbao
Fluorite | Level 6

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

1 ACCEPTED SOLUTION

Accepted Solutions
Sam_SAS
SAS Employee

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

27 REPLIES 27
Sam_SAS
SAS Employee

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

davidbao
Fluorite | Level 6

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

Sam_SAS
SAS Employee
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
Sam_SAS
SAS Employee
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.
davidbao
Fluorite | Level 6

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.

Sam_SAS
SAS Employee
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
davidbao
Fluorite | Level 6

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.

Sam_SAS
SAS Employee

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

davidbao
Fluorite | Level 6

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

Sam_SAS
SAS Employee

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 😞

davidbao
Fluorite | Level 6

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
davidbao
Fluorite | Level 6

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

Sam_SAS
SAS Employee

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

 

davidbao
Fluorite | Level 6

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

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
  • 27 replies
  • 4087 views
  • 3 likes
  • 4 in conversation