<?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 Re: Grouped State Boundaries Not Drawn Correctly Using Maps.Counties in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Grouped-State-Boundaries-Not-Drawn-Correctly-Using-Maps-Counties/m-p/140342#M5305</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&amp;nbsp; Combining the maps.states and maps.counties is great; I do this when combining roads, select locations, city, etc and then blow them out into their own anno sets- didn't think of it at the very beginning of the project using the SAS datasets (probably b/c when first starting to learn mapping figuring out which data sets used which coordinate system &amp;amp; gproject was a little confusing)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, sql does do reordering (the code in the post is condensed down to illustrate the problem); I actually do (monotonic()) as sortord to maps.counties to be able to re-sort correctly in later steps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your SAS/Graph Examples is awesome- I've been playing with animating the maps and doing graphs w/ .svg; fun stuff!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Mar 2014 16:48:04 GMT</pubDate>
    <dc:creator>cjinsf</dc:creator>
    <dc:date>2014-03-12T16:48:04Z</dc:date>
    <item>
      <title>Grouped State Boundaries Not Drawn Correctly Using Maps.Counties</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Grouped-State-Boundaries-Not-Drawn-Correctly-Using-Maps-Counties/m-p/140340#M5303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated or an explanation of why maps.counties does this! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason when I create "divisions" of states and map the boundaries there are random lines drawn where there shouldn't be any; in the attached 140311_DivBordProb_dens_le_6.png there is a line on the state border where Apache, NM and McKinley, NM touch- it looks like it runs the length of McKinley county.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are also random lines drawn on county lines in Mississippi and Alabama (among other states; I understand why VA has a bunch of red dots). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the gproject step I tried playing with density; when density &amp;lt;= 5 the line on the AZ/ NM border disappears, but a random line is drawn on the eastern county line of Parmer, TX (compare 140311_DivBordProb_dens_le_5.png)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really need to use maps.counties since there's a ton of other data sets that get annotated (roads, groups of counties, etc) to the map and those all work fine; just not sure why I'm having a problem at state level- thank you for any pointers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simplified code for Division Boundaries only (this is done in EG 5.1):&lt;/P&gt;&lt;P&gt;/*select states to draw*/&lt;/P&gt;&lt;P&gt;%let stopt = not in;&lt;/P&gt;&lt;P&gt;%let stlst = 'AK','HI','PR';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goptions reset=all cback=white noborder htitle=12pt htext=10pt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;GOPTIONS DEVICE=HTML;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gproject data=maps.counties out=base_data_1 dupok;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state county;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where fipstate(state) &amp;amp;stopt. (&amp;amp;stlst.) /*and density &amp;lt;= 6*/;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /* Create a data set with only STATE borders*/&lt;/P&gt;&lt;P&gt;proc gremove data=base_data_1 out=stborder;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by state;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id county;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /* create state border annotation data*/&lt;/P&gt;&lt;P&gt;data anno_state_border;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set stborder;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by state segment;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size 2.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*line thickness*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color 'black' /*yellow border*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xsys '2'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Use the map coordinate system*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ysys '2'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'a' ;&amp;nbsp;&amp;nbsp; /* Annotate after the map is drawn*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*For the first point in each polygon or the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; first point of the interior polygon, set&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FUNCTION to 'POLY'*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if first.segment or (lag(x)=. and lag(y)=.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then function='POLY&amp;nbsp;&amp;nbsp;&amp;nbsp; ';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* For other points, set FUNCTION to 'POLYCONT'*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else function='POLYCONT';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Don't output points with missing values*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if x and y then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*create data sets for DIVISION*/&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table Divisions as select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when state in (17,18,26,39,55) then 'East North Central'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when state in (1,21,28,47) then 'East South Central'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when state in (34,36,42) then 'Mid-Atlantic'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when state in (4,8,16,30,32,35,49,56) then 'Mountain'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when state in (9,23,25,33,44,50) then 'New England'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when state in (2,6,15,41,53) then 'Pacific'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when state in (10,11,12,13,24,37,45,51,54,72) then 'South Atlantic'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when state in (19,20,27,29,31,38,46) then 'West North Central'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when state in (5,22,40,48) then 'West South Central'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end as Division&lt;/P&gt;&lt;P&gt;from base_data_1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Create a data set with only DIVISION borders*/&lt;/P&gt;&lt;P&gt;/*need to resort by division or you will get a 'by' error*/ &lt;/P&gt;&lt;P&gt;proc sort data=divisions out=div_border_1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by division;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gremove data=div_border_1 out=div_border_2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by division;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state county;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno_div_border;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set div_border_2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by division segment;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*line thickness*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*color 'aFFFF000a' yellow border*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color 'red'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xsys '2'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Use the map coordinate system*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ysys '2'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'a' ;&amp;nbsp;&amp;nbsp; /*Annotate after the map is drawn*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* For the first point in each polygon or the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; first point of the interior polygon, set&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FUNCTION to 'POLY'*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if first.segment or (lag(x)=. and lag(y)=.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then function='POLY&amp;nbsp;&amp;nbsp;&amp;nbsp; ';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*For other points, set FUNCTION to 'POLYCONT*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else function='POLYCONT';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Don't output points with missing values*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if x and y then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Combine the Annotate data sets. */&lt;/P&gt;&lt;P&gt;data annoall;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set&amp;nbsp; anno_state_border anno_div_border ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*draw the map*/&lt;/P&gt;&lt;P&gt;pattern v = me c = white r = 52;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options maxmemquery = 6M;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods listing;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename gout "/var/sas/projects/winoutput/140311_DivBordProb.png";&lt;/P&gt;&lt;P&gt;goptions&lt;/P&gt;&lt;P&gt;device=png&lt;/P&gt;&lt;P&gt;gsfname= gout&lt;/P&gt;&lt;P&gt;xpixels=2500 ypixels=2500;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Title1 h=12pt "Divisions";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gmap map=base_data_1 data=base_data_1 anno=annoall;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id state county;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; choro county / coutline=black nolegend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; legend1 shape=bar(1,1) pct;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10840iFDF2C73BF8A31940/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="140311_DivBordProb_dens_le_5.png" title="140311_DivBordProb_dens_le_5.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10841iF4D8246F53E3E822/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="140311_DivBordProb_dens_le_6.png" title="140311_DivBordProb_dens_le_6.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 00:04:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Grouped-State-Boundaries-Not-Drawn-Correctly-Using-Maps-Counties/m-p/140340#M5303</guid>
      <dc:creator>cjinsf</dc:creator>
      <dc:date>2014-03-12T00:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped State Boundaries Not Drawn Correctly Using Maps.Counties</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Grouped-State-Boundaries-Not-Drawn-Correctly-Using-Maps-Counties/m-p/140341#M5304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi CJ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like you're trying some pretty intricate stuff here, and have a pretty good understanding. I've got a few suggestions that will probably make life a bit simpler! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than trying to gremove the county boundaries within states, I would recommend using maps.states which has already done that for you. The counties map just has too much detail, such as the city/counties in Virginia, and a few big lakes, and maybe county boundaries on the left &amp;amp; right of wide rivers, etc, etc - lots of things that might leave unwanted borders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing - I notice you use squ a bit ... I believe sql can sometimes change the order of obsns in the data, which can also make 'odd' things happen in map data sets (because the order is very important).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I've created a new version of your code, using maps.states for the state and region borders, and I replaced an sql query with a data step, and made a few other little changes. I think this should get you on the right track!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="gremove.png" class="jive-image-thumbnail jive-image" height="597" src="https://communities.sas.com/legacyfs/online/5673_gremove.png" width="698" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*select states to draw*/&lt;BR /&gt;%let stopt = not in;&lt;BR /&gt;%let stlst = 'AK','HI','PR';&lt;/P&gt;&lt;P&gt;goptions reset=all cback=white noborder htitle=12pt htext=10pt;&lt;BR /&gt;GOPTIONS DEVICE=HTML;&lt;/P&gt;&lt;P&gt;data counties; set maps.counties (where=(fipstate(state) &amp;amp;stopt. (&amp;amp;stlst.)));&lt;BR /&gt;flag=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data states; set maps.states (where=(fipstate(state) &amp;amp;stopt. (&amp;amp;stlst.)));&lt;BR /&gt;original_order=_n_;&lt;BR /&gt;flag=2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data combined; set counties states;&lt;BR /&gt;run;&lt;BR /&gt;proc gproject data=combined out=combined dupok;&lt;BR /&gt;id state county;&lt;BR /&gt;run;&lt;BR /&gt;data counties states; set combined;&lt;BR /&gt; if flag=1 then output counties;&lt;BR /&gt; else if flag=2 then output states;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* create state border annotation data*/&lt;BR /&gt;data anno_state_border; set states;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; by state segment;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; retain&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size 2.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*line thickness*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color 'black' /*yellow border*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xsys '2'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Use the map coordinate system*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ysys '2'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'a' ;&amp;nbsp;&amp;nbsp; /* Annotate after the map is drawn*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*For the first point in each polygon or the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; first point of the interior polygon, set&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FUNCTION to 'POLY'*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if first.segment or (lag(x)=. and lag(y)=.)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then function='POLY&amp;nbsp;&amp;nbsp;&amp;nbsp; ';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* For other points, set FUNCTION to 'POLYCONT'*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; else function='POLYCONT';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Don't output points with missing values*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if x and y then output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*create data sets for DIVISION*/&lt;BR /&gt;data divisions; set states;&lt;BR /&gt;length division $100;&lt;BR /&gt;if state in (17,18,26,39,55) then division='East North Central';&lt;BR /&gt;if state in (1,21,28,47) then division='East South Central';&lt;BR /&gt;if state in (34,36,42) then division='Mid-Atlantic';&lt;BR /&gt;if state in (4,8,16,30,32,35,49,56) then division='Mountain';&lt;BR /&gt;if state in (9,23,25,33,44,50) then division='New England';&lt;BR /&gt;if state in (2,6,15,41,53) then division='Pacific';&lt;BR /&gt;if state in (10,11,12,13,24,37,45,51,54,72) then division='South Atlantic';&lt;BR /&gt;if state in (19,20,27,29,31,38,46) then division='West North Central';&lt;BR /&gt;if state in (5,22,40,48) then division='West South Central';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=divisions out=divisions;&lt;BR /&gt;by division segment original_order;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* Create a data set with only DIVISION borders*/&lt;BR /&gt;proc gremove data=divisions out=divisions;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; by division;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; id state;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data anno_div_border;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set divisions;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; by division segment;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; retain&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*line thickness*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*color 'aFFFF000a' yellow border*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color 'red'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xsys '2'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Use the map coordinate system*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ysys '2'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'a' ;&amp;nbsp;&amp;nbsp; /*Annotate after the map is drawn*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* For the first point in each polygon or the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; first point of the interior polygon, set&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FUNCTION to 'POLY'*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if first.segment or (lag(x)=. and lag(y)=.)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then function='POLY&amp;nbsp;&amp;nbsp;&amp;nbsp; ';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*For other points, set FUNCTION to 'POLYCONT*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; else function='POLYCONT';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Don't output points with missing values*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if x and y then output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Combine the Annotate data sets. */&lt;BR /&gt;data annoall;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set&amp;nbsp; anno_state_border anno_div_border ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*draw the map*/&lt;BR /&gt;pattern v = me c = white r = 52;&lt;/P&gt;&lt;P&gt;options maxmemquery = 6M;&lt;/P&gt;&lt;P&gt;ods listing;&lt;/P&gt;&lt;P&gt;filename gout "&amp;amp;name..png";&lt;BR /&gt;goptions&lt;BR /&gt;device=png&lt;BR /&gt;gsfname= gout&lt;BR /&gt;xpixels=2500 ypixels=2500;&lt;/P&gt;&lt;P&gt;Title1 h=12pt "Divisions";&lt;/P&gt;&lt;P&gt;proc gmap map=counties data=counties anno=annoall;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; id state county;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; choro county / coutline=gray99 nolegend;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; legend1 shape=bar(1,1) pct;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 13:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Grouped-State-Boundaries-Not-Drawn-Correctly-Using-Maps-Counties/m-p/140341#M5304</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2014-03-12T13:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped State Boundaries Not Drawn Correctly Using Maps.Counties</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Grouped-State-Boundaries-Not-Drawn-Correctly-Using-Maps-Counties/m-p/140342#M5305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&amp;nbsp; Combining the maps.states and maps.counties is great; I do this when combining roads, select locations, city, etc and then blow them out into their own anno sets- didn't think of it at the very beginning of the project using the SAS datasets (probably b/c when first starting to learn mapping figuring out which data sets used which coordinate system &amp;amp; gproject was a little confusing)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, sql does do reordering (the code in the post is condensed down to illustrate the problem); I actually do (monotonic()) as sortord to maps.counties to be able to re-sort correctly in later steps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your SAS/Graph Examples is awesome- I've been playing with animating the maps and doing graphs w/ .svg; fun stuff!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 16:48:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Grouped-State-Boundaries-Not-Drawn-Correctly-Using-Maps-Counties/m-p/140342#M5305</guid>
      <dc:creator>cjinsf</dc:creator>
      <dc:date>2014-03-12T16:48:04Z</dc:date>
    </item>
  </channel>
</rss>

