<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic map tilts or shrinks when many zipcodes used ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/map-tilts-or-shrinks-when-many-zipcodes-used/m-p/85974#M289084</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I provide over 10,000 zipcodes or a population set of 60,000 zipcodes all across usa, the map&lt;/P&gt;&lt;P&gt;is tilted or shrinks to a non-readable image&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;would like to hear if there is some limit of zipcodes that can not be exceeded or solution&lt;/P&gt;&lt;P&gt;to be able to provide the actual zipcodes available without fear of losing readability?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using the following sample code, this works fine&lt;/P&gt;&lt;P&gt;/* Set the graphics environment */&lt;/P&gt;&lt;P&gt;goptions reset=all border;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Create a data set containing ZIP codes */&lt;/P&gt;&lt;P&gt;data myzip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input zip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;00602&lt;/P&gt;&lt;P&gt;35004&lt;/P&gt;&lt;P&gt;85003&lt;/P&gt;&lt;P&gt;71601&lt;/P&gt;&lt;P&gt;80002&lt;/P&gt;&lt;P&gt;06001&lt;/P&gt;&lt;P&gt;19701&lt;/P&gt;&lt;P&gt;20001&lt;/P&gt;&lt;P&gt;32007&lt;/P&gt;&lt;P&gt;83201&lt;/P&gt;&lt;P&gt;60001&lt;/P&gt;&lt;P&gt;46001&lt;/P&gt;&lt;P&gt;50001&lt;/P&gt;&lt;P&gt;66002&lt;/P&gt;&lt;P&gt;40003&lt;/P&gt;&lt;P&gt;70001&lt;/P&gt;&lt;P&gt;03901&lt;/P&gt;&lt;P&gt;20601&lt;/P&gt;&lt;P&gt;01001&lt;/P&gt;&lt;P&gt;27513&lt;/P&gt;&lt;P&gt;96701&lt;/P&gt;&lt;P&gt;99501&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Sort the data set by ZIP codes */&lt;/P&gt;&lt;P&gt;proc sort data=myzip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by zip;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Create a data set containing the */&lt;/P&gt;&lt;P&gt;/* X and Y values for my ZIP codes&amp;nbsp; */&lt;/P&gt;&lt;P&gt;data longlat;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; merge work.myzip(in=mine) sashelp.zipcode(rename=(x=long y=lat));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by zip;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Keep if the ZIP code was in my data set */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if mine;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Convert longitude and latitude in degrees to radians */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* to match the values in the map data set */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x=atan(1)/45*long;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; y=atan(1)/45*lat;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Adjust the hemisphere */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x=-x;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Keep only the ZIP, X, Y, and STATE variables */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; keep zip x y state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Create an annotate data set to place a symbol */&lt;/P&gt;&lt;P&gt;/* at ZIP code locations. */&lt;/P&gt;&lt;P&gt;data anno;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Use the X and Y values from the LONGLAT data set */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set longlat;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set the data value coordinate system */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set the function to LABEL */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set the size of the symbol to .75 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set a FLAG variable to signal annotate observations */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain xsys ysys '2' function 'label' size .75 flag 1 when 'a';&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set the font to the Special font */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; style='special';&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* The symbol is a star */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; text='M';&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Color for the symbol */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; color='depk';&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Output the observation to place the symbol */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Since we want to move Alaska, Hawaii, and Puerto Rico under */&lt;/P&gt;&lt;P&gt;/* the continental U.S., we need to separate their coordinates */ &lt;/P&gt;&lt;P&gt;/* so they can be projected separately. */&lt;/P&gt;&lt;P&gt;data states alaska hawaii pr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set maps.states;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=2) output alaska;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=15) output hawaii;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=72) output pr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherwise output states;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Separate the annotate data for the continental U.S., */&lt;/P&gt;&lt;P&gt;/* Alaska, Hawaii, and Puerto Rico to be projected with */&lt;/P&gt;&lt;P&gt;/* their state coordinates. */&lt;/P&gt;&lt;P&gt;data stateszip alzip hizip przip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set anno;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=2) output alzip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=15) output hizip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=72) output przip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherwise output stateszip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine the map and annotate data sets */&lt;/P&gt;&lt;P&gt;/* for the contiguous states.&amp;nbsp; */&lt;/P&gt;&lt;P&gt;data states;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set states stateszip;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Project the data */&lt;/P&gt;&lt;P&gt;proc gproject data=states out=stproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine the Alaska map and annotate data */&lt;/P&gt;&lt;P&gt;data alaska;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set alaska alzip;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Project Alaska so it will appear full size under the U.S. */&lt;/P&gt;&lt;P&gt;proc gproject data=alaska out=akproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine the Hawaii map and annotate data */&lt;/P&gt;&lt;P&gt;data hawaii;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set hawaii hizip;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Project Hawaii */&lt;/P&gt;&lt;P&gt;proc gproject data=hawaii out=hiproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine the Puerto Rico map and annotate data */&lt;/P&gt;&lt;P&gt;data pr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set pr przip;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Project Puerto Rico */&lt;/P&gt;&lt;P&gt;proc gproject data=pr out=prproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Adjust the coordinates for Alaska to move */&lt;/P&gt;&lt;P&gt;/* it under the continental U.S. */&lt;/P&gt;&lt;P&gt;data akproj(drop=x y);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set akproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if density &amp;lt; 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newx=(x-.55)*.50;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newy=(y-.35)*.50;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Adjust the coordinates for Hawaii to move */&lt;/P&gt;&lt;P&gt;/* under the continental U.S. */ &lt;/P&gt;&lt;P&gt;data hiproj(drop=x y);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set hiproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newx=x-.12;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newy=y-.20;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Adjust the coordinates for Puerto Rico */&lt;/P&gt;&lt;P&gt;data prproj(drop=x y); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set prproj; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newx=(x+.315); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newy=(y-.24); &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine all of the projected data sets */&lt;/P&gt;&lt;P&gt;data all;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set stproj akproj(rename=(newx=x newy=y))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hiproj(rename=(newx=x newy=y))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prproj(rename=(newx=x newy=y));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Separate the projected data set into a map and an annotate data set */&lt;/P&gt;&lt;P&gt;data map dot;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set all;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* If the FLAG variable has a value of 1, it is an annotate data */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* set observation; otherwise, it is a map data set observation. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if flag=1 then output dot;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else output map;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Define the pattern for the map */&lt;/P&gt;&lt;P&gt;pattern1 v=me c=grp r=50;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /* Define the title for the map. */&lt;/P&gt;&lt;P&gt;title1 'ZIP Code locations on a US Map';&lt;/P&gt;&lt;P&gt;title2 'moving Alaska, Hawaii and Puerto Rico';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename odsout 'E:\Temp';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;/P&gt;&lt;P&gt;*goptions reset=global gunit=pct cback=white&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; colors=(black blue green red)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ftext=swiss ftitle=swissb htitle=6 htext=4;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goptions device=gif transparency noborder;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods html body='map.html'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path=odsout;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Generate the map and place the symbols at ZIP code locations */&lt;/P&gt;&lt;P&gt;proc gmap data=map map=map;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; choro state / anno=dot nolegend;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods html close;&lt;/P&gt;&lt;P&gt;ods listing;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Apr 2012 09:37:10 GMT</pubDate>
    <dc:creator>sjoki</dc:creator>
    <dc:date>2012-04-17T09:37:10Z</dc:date>
    <item>
      <title>map tilts or shrinks when many zipcodes used ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/map-tilts-or-shrinks-when-many-zipcodes-used/m-p/85974#M289084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I provide over 10,000 zipcodes or a population set of 60,000 zipcodes all across usa, the map&lt;/P&gt;&lt;P&gt;is tilted or shrinks to a non-readable image&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;would like to hear if there is some limit of zipcodes that can not be exceeded or solution&lt;/P&gt;&lt;P&gt;to be able to provide the actual zipcodes available without fear of losing readability?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using the following sample code, this works fine&lt;/P&gt;&lt;P&gt;/* Set the graphics environment */&lt;/P&gt;&lt;P&gt;goptions reset=all border;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Create a data set containing ZIP codes */&lt;/P&gt;&lt;P&gt;data myzip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input zip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;00602&lt;/P&gt;&lt;P&gt;35004&lt;/P&gt;&lt;P&gt;85003&lt;/P&gt;&lt;P&gt;71601&lt;/P&gt;&lt;P&gt;80002&lt;/P&gt;&lt;P&gt;06001&lt;/P&gt;&lt;P&gt;19701&lt;/P&gt;&lt;P&gt;20001&lt;/P&gt;&lt;P&gt;32007&lt;/P&gt;&lt;P&gt;83201&lt;/P&gt;&lt;P&gt;60001&lt;/P&gt;&lt;P&gt;46001&lt;/P&gt;&lt;P&gt;50001&lt;/P&gt;&lt;P&gt;66002&lt;/P&gt;&lt;P&gt;40003&lt;/P&gt;&lt;P&gt;70001&lt;/P&gt;&lt;P&gt;03901&lt;/P&gt;&lt;P&gt;20601&lt;/P&gt;&lt;P&gt;01001&lt;/P&gt;&lt;P&gt;27513&lt;/P&gt;&lt;P&gt;96701&lt;/P&gt;&lt;P&gt;99501&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Sort the data set by ZIP codes */&lt;/P&gt;&lt;P&gt;proc sort data=myzip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by zip;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Create a data set containing the */&lt;/P&gt;&lt;P&gt;/* X and Y values for my ZIP codes&amp;nbsp; */&lt;/P&gt;&lt;P&gt;data longlat;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; merge work.myzip(in=mine) sashelp.zipcode(rename=(x=long y=lat));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by zip;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Keep if the ZIP code was in my data set */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if mine;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Convert longitude and latitude in degrees to radians */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* to match the values in the map data set */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x=atan(1)/45*long;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; y=atan(1)/45*lat;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Adjust the hemisphere */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x=-x;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Keep only the ZIP, X, Y, and STATE variables */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; keep zip x y state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Create an annotate data set to place a symbol */&lt;/P&gt;&lt;P&gt;/* at ZIP code locations. */&lt;/P&gt;&lt;P&gt;data anno;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Use the X and Y values from the LONGLAT data set */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set longlat;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set the data value coordinate system */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set the function to LABEL */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set the size of the symbol to .75 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set a FLAG variable to signal annotate observations */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain xsys ysys '2' function 'label' size .75 flag 1 when 'a';&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Set the font to the Special font */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; style='special';&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* The symbol is a star */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; text='M';&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Color for the symbol */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; color='depk';&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Output the observation to place the symbol */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Since we want to move Alaska, Hawaii, and Puerto Rico under */&lt;/P&gt;&lt;P&gt;/* the continental U.S., we need to separate their coordinates */ &lt;/P&gt;&lt;P&gt;/* so they can be projected separately. */&lt;/P&gt;&lt;P&gt;data states alaska hawaii pr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set maps.states;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=2) output alaska;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=15) output hawaii;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=72) output pr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherwise output states;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Separate the annotate data for the continental U.S., */&lt;/P&gt;&lt;P&gt;/* Alaska, Hawaii, and Puerto Rico to be projected with */&lt;/P&gt;&lt;P&gt;/* their state coordinates. */&lt;/P&gt;&lt;P&gt;data stateszip alzip hizip przip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set anno;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=2) output alzip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=15) output hizip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (state=72) output przip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherwise output stateszip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine the map and annotate data sets */&lt;/P&gt;&lt;P&gt;/* for the contiguous states.&amp;nbsp; */&lt;/P&gt;&lt;P&gt;data states;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set states stateszip;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Project the data */&lt;/P&gt;&lt;P&gt;proc gproject data=states out=stproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine the Alaska map and annotate data */&lt;/P&gt;&lt;P&gt;data alaska;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set alaska alzip;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Project Alaska so it will appear full size under the U.S. */&lt;/P&gt;&lt;P&gt;proc gproject data=alaska out=akproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine the Hawaii map and annotate data */&lt;/P&gt;&lt;P&gt;data hawaii;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set hawaii hizip;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Project Hawaii */&lt;/P&gt;&lt;P&gt;proc gproject data=hawaii out=hiproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine the Puerto Rico map and annotate data */&lt;/P&gt;&lt;P&gt;data pr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set pr przip;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Project Puerto Rico */&lt;/P&gt;&lt;P&gt;proc gproject data=pr out=prproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Adjust the coordinates for Alaska to move */&lt;/P&gt;&lt;P&gt;/* it under the continental U.S. */&lt;/P&gt;&lt;P&gt;data akproj(drop=x y);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set akproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if density &amp;lt; 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newx=(x-.55)*.50;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newy=(y-.35)*.50;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Adjust the coordinates for Hawaii to move */&lt;/P&gt;&lt;P&gt;/* under the continental U.S. */ &lt;/P&gt;&lt;P&gt;data hiproj(drop=x y);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set hiproj;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newx=x-.12;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newy=y-.20;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Adjust the coordinates for Puerto Rico */&lt;/P&gt;&lt;P&gt;data prproj(drop=x y); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set prproj; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newx=(x+.315); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newy=(y-.24); &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine all of the projected data sets */&lt;/P&gt;&lt;P&gt;data all;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set stproj akproj(rename=(newx=x newy=y))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hiproj(rename=(newx=x newy=y))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prproj(rename=(newx=x newy=y));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Separate the projected data set into a map and an annotate data set */&lt;/P&gt;&lt;P&gt;data map dot;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set all;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* If the FLAG variable has a value of 1, it is an annotate data */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* set observation; otherwise, it is a map data set observation. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if flag=1 then output dot;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else output map;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Define the pattern for the map */&lt;/P&gt;&lt;P&gt;pattern1 v=me c=grp r=50;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /* Define the title for the map. */&lt;/P&gt;&lt;P&gt;title1 'ZIP Code locations on a US Map';&lt;/P&gt;&lt;P&gt;title2 'moving Alaska, Hawaii and Puerto Rico';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename odsout 'E:\Temp';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;/P&gt;&lt;P&gt;*goptions reset=global gunit=pct cback=white&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; colors=(black blue green red)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ftext=swiss ftitle=swissb htitle=6 htext=4;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goptions device=gif transparency noborder;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods html body='map.html'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path=odsout;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Generate the map and place the symbols at ZIP code locations */&lt;/P&gt;&lt;P&gt;proc gmap data=map map=map;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; choro state / anno=dot nolegend;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods html close;&lt;/P&gt;&lt;P&gt;ods listing;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 09:37:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/map-tilts-or-shrinks-when-many-zipcodes-used/m-p/85974#M289084</guid>
      <dc:creator>sjoki</dc:creator>
      <dc:date>2012-04-17T09:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: map tilts or shrinks when many zipcodes used ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/map-tilts-or-shrinks-when-many-zipcodes-used/m-p/85975#M289085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to plot all the zip codes onto the map, without causing any problems that distort/shrink the map.&amp;nbsp; Here's a bare-bones example that plots all the zip codes onto the US map:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set sashelp.zipcode;&lt;BR /&gt;function='point'; color='red';&lt;BR /&gt;xsys='2'; ysys='2'; when='a';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; x=atan(1)/45*x;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; y=atan(1)/45*y;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data map; set maps.states;&lt;BR /&gt;x=x*-1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gmap data=map map=map anno=zips;&lt;BR /&gt;id state;&lt;BR /&gt;choro state / levels=1 nolegend;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 15:40:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/map-tilts-or-shrinks-when-many-zipcodes-used/m-p/85975#M289085</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2012-05-21T15:40:10Z</dc:date>
    </item>
  </channel>
</rss>

