<?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: Creating a Region Map from counties across multiple states in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132822#M5144</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&amp;nbsp; Thank You!!!&amp;nbsp;&amp;nbsp; That appears to have done the trick.&lt;/P&gt;&lt;P&gt;I changed my code to:&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt; CREATE TABLE WORK.Query_for_Query1_for_QUERY1913 AS SELECT QUERY1_FOR_QUERY1913.PEFR_ADR_ST_CDE,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.COUNTY,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.STATE,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.STATENAME,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.COUNTYNM,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.COUNTIES_GEO,&lt;BR /&gt;&amp;nbsp; QUERY_FOR_QUERY.AGY_CODE AS Region,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.X,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.Y,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.original_order &lt;BR /&gt; FROM WORK.QUERY1_FOR_QUERY1913 AS QUERY1_FOR_QUERY1913 &lt;BR /&gt;&amp;nbsp;&amp;nbsp; RIGHT JOIN WORK.TMP_0008 AS QUERY_FOR_QUERY ON (QUERY1_FOR_QUERY1913.PEFR_ADR_ST_CDE = QUERY_FOR_QUERY.STATE) AND (QUERY1_FOR_QUERY1913.COUNTYNM = QUERY_FOR_QUERY.County)&lt;BR /&gt; ORDER BY QUERY_FOR_QUERY.AGY_CODE, QUERY1_FOR_QUERY1913.STATE, QUERY1_FOR_QUERY1913.COUNTY, QUERY1_FOR_QUERY1913.original_order;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;proc gremove&lt;BR /&gt;data=Query_for_Query1_for_QUERY1913&lt;BR /&gt;out=rfomap;&lt;BR /&gt;by region;&lt;BR /&gt;id region state county;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;PROC GPROJECT &lt;BR /&gt;DATA=RFOMAP&lt;BR /&gt;OUT=RFOMAP2;&lt;BR /&gt;ID REGION;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gmap&lt;BR /&gt;map=rfomap2&lt;BR /&gt;data=rfomap2;&lt;BR /&gt;id REGION;&lt;BR /&gt;choro region;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and got this output which is about what I was expecting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SASGraph2.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/3535_SASGraph2.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 May 2013 16:58:47 GMT</pubDate>
    <dc:creator>AaroninMN</dc:creator>
    <dc:date>2013-05-09T16:58:47Z</dc:date>
    <item>
      <title>Creating a Region Map from counties across multiple states</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132817#M5139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to create a US map with regions from counties across multiple states?&amp;nbsp; What I am trying to do is not combine entire states to create the region.&amp;nbsp; Most of the regions I am creating combine two states with half of another.&amp;nbsp; The data set I'm reading has approx 50,000 rows of county data by state.&lt;/P&gt;&lt;P&gt;Let me know if you need more info and Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2013 20:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132817#M5139</guid>
      <dc:creator>AaroninMN</dc:creator>
      <dc:date>2013-05-08T20:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Region Map from counties across multiple states</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132818#M5140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can start with the county map data set, and add a 'region' variable, and then use Proc Gremove to get rid of internal boundaries (within the regions), and use the result as your new map.&amp;nbsp; (You'll have to get your 'id' variables and 'by' variables just right - let me know if you need help with that.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 01:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132818#M5140</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2013-05-09T01:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Region Map from counties across multiple states</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132819#M5141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK - now that I'm back at a computer, I've put together a little sampel to demonstrate the steps &amp;amp; syntax you'll need.&amp;nbsp; This sample has extra code to write out the map(s) via ods html, so you can have html hover-text which allows you to hover your mouse over the counties, to see what the county # is (this can help in trouble-shooting, and coming up with the list of counties you want to put in a different state, etc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let name=region;&lt;BR /&gt;filename odsout '.';&lt;/P&gt;&lt;P&gt;data my_map; set maps.uscounty (where=(fipstate(state) in ('NC' 'VA')));&lt;BR /&gt;original_order=_n_;&lt;BR /&gt;if fipstate(state)='NC' then region='A';&lt;BR /&gt;if fipstate(state)='VA' then region='B';&lt;BR /&gt;if fipstate(state)='VA' and county in (117 111) then region='A';&lt;BR /&gt;my_html='title='||quote(county);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=my_map out=my_map;&lt;BR /&gt;by region state county original_order;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc gremove data=my_map out=my_map2;&lt;BR /&gt;by region;&lt;BR /&gt;id region state county;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;goptions device=png;&lt;/P&gt;&lt;P&gt;ODS LISTING CLOSE;&lt;BR /&gt;ODS HTML path=odsout body="&amp;amp;name..htm" style=sasweb;&lt;/P&gt;&lt;P&gt;proc gmap map=my_map data=my_map;&lt;BR /&gt;id state county;&lt;BR /&gt;choro region /&lt;BR /&gt; html=my_html&lt;BR /&gt; des='' name="&amp;amp;name";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc gmap map=my_map2 data=my_map2;&lt;BR /&gt;id region;&lt;BR /&gt;choro region /&lt;BR /&gt; des='' name="&amp;amp;name";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;BR /&gt;ODS HTML CLOSE;&lt;BR /&gt;ODS LISTING;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the output - a regular county map shaded by 'region', and then the new Region map with the county boundaries removed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="region.png" class="jive-image-thumbnail jive-image" height="362" src="https://communities.sas.com/legacyfs/online/3531_region.png" width="574" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="region1.png" class="jive-image-thumbnail jive-image" height="376" src="https://communities.sas.com/legacyfs/online/3532_region1.png" width="587" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 12:45:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132819#M5141</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2013-05-09T12:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Region Map from counties across multiple states</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132820#M5142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert!&amp;nbsp; I think I am getting close.&amp;nbsp; This is my current code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt; CREATE TABLE WORK.Query_for_Query1_for_QUERY1913 AS SELECT QUERY1_FOR_QUERY1913.PEFR_ADR_ST_CDE,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.COUNTY,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.STATE,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.STATENAME,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.COUNTYNM,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.COUNTIES_GEO,&lt;BR /&gt;&amp;nbsp; QUERY_FOR_QUERY.AGY_CODE AS Region,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.X,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.Y &lt;BR /&gt; FROM WORK.QUERY1_FOR_QUERY1913 AS QUERY1_FOR_QUERY1913,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; WORK.TMP_0001 AS QUERY_FOR_QUERY&lt;BR /&gt; WHERE (QUERY1_FOR_QUERY1913.PEFR_ADR_ST_CDE = QUERY_FOR_QUERY.STATE AND QUERY1_FOR_QUERY1913.COUNTYNM = QUERY_FOR_QUERY.County)&lt;BR /&gt; ORDER BY QUERY_FOR_QUERY.AGY_CODE, QUERY1_FOR_QUERY1913.STATE, QUERY1_FOR_QUERY1913.COUNTY;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;proc gremove&lt;BR /&gt;data=Query_for_Query1_for_QUERY1913&lt;BR /&gt;out=rfomap;&lt;BR /&gt;by region;&lt;BR /&gt;id region COUNTY STATE;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;PROC GPROJECT &lt;BR /&gt;DATA=RFOMAP&lt;BR /&gt;OUT=RFOMAP2&lt;BR /&gt;ID REGION;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;proc gmap&lt;BR /&gt;map=rfomap2&lt;BR /&gt;data=rfomap2;&lt;BR /&gt;id REGION;&lt;BR /&gt;choro region / nolegend;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this is my output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SASGraph.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/3534_SASGraph.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 14:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132820#M5142</guid>
      <dc:creator>AaroninMN</dc:creator>
      <dc:date>2013-05-09T14:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Region Map from counties across multiple states</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132821#M5143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Within each county, the order of the observations is very important (this is the order in which the points along the border are connected). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll need to do a data step and get the original order, and then after you've done your sql stuff (and before you gremove) you'll need to ultimately sort by that original order (see code I posted earlier - it is a critical step).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 14:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132821#M5143</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2013-05-09T14:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Region Map from counties across multiple states</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132822#M5144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&amp;nbsp; Thank You!!!&amp;nbsp;&amp;nbsp; That appears to have done the trick.&lt;/P&gt;&lt;P&gt;I changed my code to:&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt; CREATE TABLE WORK.Query_for_Query1_for_QUERY1913 AS SELECT QUERY1_FOR_QUERY1913.PEFR_ADR_ST_CDE,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.COUNTY,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.STATE,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.STATENAME,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.COUNTYNM,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.COUNTIES_GEO,&lt;BR /&gt;&amp;nbsp; QUERY_FOR_QUERY.AGY_CODE AS Region,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.X,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.Y,&lt;BR /&gt;&amp;nbsp; QUERY1_FOR_QUERY1913.original_order &lt;BR /&gt; FROM WORK.QUERY1_FOR_QUERY1913 AS QUERY1_FOR_QUERY1913 &lt;BR /&gt;&amp;nbsp;&amp;nbsp; RIGHT JOIN WORK.TMP_0008 AS QUERY_FOR_QUERY ON (QUERY1_FOR_QUERY1913.PEFR_ADR_ST_CDE = QUERY_FOR_QUERY.STATE) AND (QUERY1_FOR_QUERY1913.COUNTYNM = QUERY_FOR_QUERY.County)&lt;BR /&gt; ORDER BY QUERY_FOR_QUERY.AGY_CODE, QUERY1_FOR_QUERY1913.STATE, QUERY1_FOR_QUERY1913.COUNTY, QUERY1_FOR_QUERY1913.original_order;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;proc gremove&lt;BR /&gt;data=Query_for_Query1_for_QUERY1913&lt;BR /&gt;out=rfomap;&lt;BR /&gt;by region;&lt;BR /&gt;id region state county;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;PROC GPROJECT &lt;BR /&gt;DATA=RFOMAP&lt;BR /&gt;OUT=RFOMAP2;&lt;BR /&gt;ID REGION;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gmap&lt;BR /&gt;map=rfomap2&lt;BR /&gt;data=rfomap2;&lt;BR /&gt;id REGION;&lt;BR /&gt;choro region;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and got this output which is about what I was expecting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SASGraph2.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/3535_SASGraph2.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 16:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Creating-a-Region-Map-from-counties-across-multiple-states/m-p/132822#M5144</guid>
      <dc:creator>AaroninMN</dc:creator>
      <dc:date>2013-05-09T16:58:47Z</dc:date>
    </item>
  </channel>
</rss>

