2 weeks ago - last edited 2 weeks ago by Reeza
I am trying to create a map of the US showing only state and MSA (metropolitan statistical area) boundaries, using county-level data (maps.uscounty). I am currently using a guide to help me, but am still having difficulty (see link below) http://www2.sas.com/proceedings/sugi29/251-29.pdf
I was able to create an MSA variable (which combines several counties) and merge it with the map file based on county ID. In concert with the GREMOVE procedure, this should remove the barriers between counties within MSAs. However, when I invoke GMAP, it looks distorted.
So then I try GPROJECT, which should correct the distortion, but then it tells me that I have data on both sides of the equator (see error message below).
NOTE: PARALLEL1 = -4.960619304.
NOTE: PARALLEL2 = 8.0288480358.
ERROR: Standard parallels lie on opposite sides of the equator.
ERROR: Equator is too close to the median latitude of the map data set for default parallel calculation. Try specifying PARALLEL1
and PARALLEL2 values explicitly.
However, that can't be the case, because I am only using US data. Oddly, when I look at the SAS projected latitude in the SAS provided map files, there are negative latitude values. I am not sure what to think.
I am able to graph the data just fine (at the county level) before GREMOVE, but after that it all becomes distorted. Any ideas?
See code below:
proc sort data=MSA_MAP; by msa; run; proc gremove data=MSA_MAP out=MSA_MAP_1; by msa; id county; run; proc gproject data=MSA_MAP_1 out=MSA_MAP_2; id msa; run; pattern v=e; proc gmap data=MSA_MAP_2 map=MSA_MAP_2 all; id msa; choro Phys_Den_Tot_MD / discrete coutline=black; format Phys_Den_Tot_MD Phys_Den_Tot_MD_.; run;
2 weeks ago
maps.uscounty X and Y positions are already projected coordinates, you cannot project them again. Try using the mapsgfk.us_counties dataset which has LAT and LONG (unprojected) coordinates instead.
2 weeks ago
Probably the quickest/easiest most direct replacement would be using the unprojected maps.counties, rather than the projected maps.uscounty.
One problem though, when projecting the map on your own, is that Alaska and Hawaii will be in their 'proper' location, rather than moved & re-sized to fit in the bottom/left corner of the map.
I'm thinking this "should" work ok using already-projected maps.uscounty (without re-projecting it). Could you provide some more info about how it looks 'distorted'?