<?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: Mapping by Zip code in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/627949#M19514</link>
    <description>&lt;P&gt;To plot your data on a choropleth map (filling in the boundaries of the zip codes with shades/colors), you won't need your lat/long coordinates, and you won't necessarily need to project the map (for a small-ish area, such as when dealing with zip codes, it won't really matter whether the map is projected or unprojected, or what projection it's using). But we don't ship zipcode boundary maps, so you'll have to download them from somewhere, and Proc Mapimport them, etc. (as the papers/examples show).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know this isn't exactly what you're asking for, but ... something that might be a lot less work, and might be a good way to get started, would be to plot your data with a Proc SGmap bubble map. Here's a quick example, using the data you posted:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data my_data;&lt;BR /&gt;input ZIPcode Cases longi lati;&lt;BR /&gt;datalines;&lt;BR /&gt;43613 1 -83.604452 41.704307&lt;BR /&gt;44140 1 -81.92148 41.48982&lt;BR /&gt;46052 1 -86.470531 40.051603&lt;BR /&gt;48009 22 -83.213883 42.544619&lt;BR /&gt;48017 6 -83.151815 42.535396&lt;BR /&gt;48021 7 -82.946167 42.463894&lt;BR /&gt;48025 19 -83.265758 42.523195&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgmap plotdata=my_data noautolegend;&lt;BR /&gt;openstreetmap;&lt;BR /&gt;bubble x=longi y=lati size=cases / fillattrs=(color=red);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGMap3.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36441i1917C7C5F1C1ED9C/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGMap3.png" alt="SGMap3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2020 15:48:09 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2020-02-27T15:48:09Z</dc:date>
    <item>
      <title>Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/627642#M19511</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;My data is like this:&lt;/P&gt;
&lt;PRE class="lang-r prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;ZIPcode Cases   longi   lati
&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;43613&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;-83.604452&lt;/SPAN&gt;  &lt;SPAN class="lit"&gt;41.704307&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;44140&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;-81.92148&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;41.48982&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;46052&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;-86.470531&lt;/SPAN&gt;  &lt;SPAN class="lit"&gt;40.051603&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;48009&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;22&lt;/SPAN&gt;  &lt;SPAN class="lit"&gt;-83.213883&lt;/SPAN&gt;  &lt;SPAN class="lit"&gt;42.544619&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;48017&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;6&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;-83.151815&lt;/SPAN&gt;  &lt;SPAN class="lit"&gt;42.535396&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;48021&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;7&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;-82.946167&lt;/SPAN&gt;  &lt;SPAN class="lit"&gt;42.463894&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;48025&lt;/SPAN&gt;   &lt;SPAN class="lit"&gt;19&lt;/SPAN&gt;  &lt;SPAN class="lit"&gt;-83.265758&lt;/SPAN&gt;  &lt;SPAN class="lit"&gt;42.523195&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to map the cases by zip code. The outline should be of the zip code boundary and the shading should be according to number of cases, darker as cases increase.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If anyone can tell me how to do this either in SAS or R, that'll be great. I'm very new to R...&lt;SPAN&gt;Tried a lot of code I found online but can't get what I want. Any help is appreciated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 19:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/627642#M19511</guid>
      <dc:creator>Xinxin</dc:creator>
      <dc:date>2020-02-26T19:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/627650#M19512</link>
      <description>&lt;P&gt;There are many resources that show you how. Have you seen &lt;A href="https://support.sas.com/resources/papers/proceedings13/214-2013.pdf" target="_self"&gt;Creating ZIP Code-Level Maps with SAS&lt;/A&gt;?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 20:20:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/627650#M19512</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-02-26T20:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/627919#M19513</link>
      <description>&lt;P&gt;I have looked at code online but I don't know how to project my data on the map and get the shading. Also, I don't want the whole country or state but zoomed in to a part of the state. Also, yesterday and today, the govt census site is down, so will check again later. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 14:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/627919#M19513</guid>
      <dc:creator>Xinxin</dc:creator>
      <dc:date>2020-02-27T14:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/627949#M19514</link>
      <description>&lt;P&gt;To plot your data on a choropleth map (filling in the boundaries of the zip codes with shades/colors), you won't need your lat/long coordinates, and you won't necessarily need to project the map (for a small-ish area, such as when dealing with zip codes, it won't really matter whether the map is projected or unprojected, or what projection it's using). But we don't ship zipcode boundary maps, so you'll have to download them from somewhere, and Proc Mapimport them, etc. (as the papers/examples show).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know this isn't exactly what you're asking for, but ... something that might be a lot less work, and might be a good way to get started, would be to plot your data with a Proc SGmap bubble map. Here's a quick example, using the data you posted:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data my_data;&lt;BR /&gt;input ZIPcode Cases longi lati;&lt;BR /&gt;datalines;&lt;BR /&gt;43613 1 -83.604452 41.704307&lt;BR /&gt;44140 1 -81.92148 41.48982&lt;BR /&gt;46052 1 -86.470531 40.051603&lt;BR /&gt;48009 22 -83.213883 42.544619&lt;BR /&gt;48017 6 -83.151815 42.535396&lt;BR /&gt;48021 7 -82.946167 42.463894&lt;BR /&gt;48025 19 -83.265758 42.523195&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgmap plotdata=my_data noautolegend;&lt;BR /&gt;openstreetmap;&lt;BR /&gt;bubble x=longi y=lati size=cases / fillattrs=(color=red);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGMap3.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36441i1917C7C5F1C1ED9C/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGMap3.png" alt="SGMap3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 15:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/627949#M19514</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2020-02-27T15:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/853829#M23430</link>
      <description>&lt;P&gt;I tried using your sample code but received this error several times in my log: "ERROR 180-322: Statement is not valid or it is used out of proper order."&amp;nbsp; Any idea what the problem might be?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using SAS Enterprise Guide 7.1 and For Base SAS Software 9.4_M4.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 23:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/853829#M23430</guid>
      <dc:creator>brookeewhite1</dc:creator>
      <dc:date>2023-01-13T23:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/853833#M23431</link>
      <description>&lt;P&gt;First you would be better off starting your own thread and reference this one as part of what you attempted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Any&lt;/STRONG&gt; time you get an error you should copy from the log the entire procedure or data step code along with all of the notes, warnings or messages. That way we have some chance of knowing what the problem is. Without it my answer is typically "42" as there is no context.&lt;/P&gt;
&lt;P&gt;Copy the text from the log, on the forum open a text box using the &amp;lt;/&amp;gt; icon above the message window and paste the text.&lt;/P&gt;
&lt;P&gt;The text box is important because the message window will reformat pasted text which means the the diagnostic messages that SAS often supplies with errors like this appear in the wrong place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will bet that your log shows some word or characters with underscores. That is what SAS found as incorrect.&lt;/P&gt;
&lt;P&gt;Common causes of this particular error are&lt;/P&gt;
&lt;P&gt;1) not ending a previous statement with a semicolon&lt;/P&gt;
&lt;P&gt;2) incorrectly placing a semicolon so that code that should be part of something, such as a function call or calculation, appears as the start of a statement and not continuation as expected.&lt;/P&gt;
&lt;P&gt;3) use of a statement that is not defined in the current procedure or legal in a data step.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 23:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/853833#M23431</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-13T23:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/854240#M23435</link>
      <description>&lt;P&gt;When running 'new' procs such as Proc SGmap, you'll need to have the newest version of SAS possible. You indicate you have version 9.4_m4 ... that version is pretty old. If you're wanting to use SGmap, I would recommend getting 9.4m7 which was released in the fall of 2020 (that's when a lot of the SGmap features were released&amp;nbsp;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2020/09/25/new-sgmap-features-in-sas-9-4m7/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2020/09/25/new-sgmap-features-in-sas-9-4m7/&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 00:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/854240#M23435</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2023-01-18T00:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/854318#M23439</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp; I had a feeling my version might be the issue. I don't have the authority to perform the software upgrade at work, unfortunately.&amp;nbsp; Any suggestions for a workaround using the old version?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 13:55:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/854318#M23439</guid>
      <dc:creator>brookeewhite1</dc:creator>
      <dc:date>2023-01-18T13:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/854355#M23440</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117568"&gt;@brookeewhite1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you.&amp;nbsp; I had a feeling my version might be the issue. I don't have the authority to perform the software upgrade at work, unfortunately.&amp;nbsp; Any suggestions for a workaround using the old version?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;First, since any paid license should come with the ability to maintain current version, talk to whoever is responsible for maintaining software and arrange to update the software per your license.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have a license to SAS/Graph? The alternatives would likely involve Proc Gmap which comes with that part of the license.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, you may need to provide more information about &lt;STRONG&gt;your &lt;/STRONG&gt;specific graphing need. Which means you should start your own thread on the forum instead of adding on to something else. Such as provide example data of your data, as the author of this post did, and what you &lt;STRONG&gt;require&lt;/STRONG&gt; for output.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 15:22:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/854355#M23440</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-18T15:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/854396#M23441</link>
      <description>&lt;P&gt;Yes I have access to SAS Graph.&amp;nbsp; I'm not trying to work with my own data yet, I was starting at the very beginning with using the sample data and code provided here, figuring the first step would be to get that to work.&amp;nbsp; I probably just need a generic example of Proc GMAP to start with then.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 18:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/854396#M23441</guid>
      <dc:creator>brookeewhite1</dc:creator>
      <dc:date>2023-01-18T18:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping by Zip code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/854401#M23442</link>
      <description>&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Please&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT size="4"&gt; start your own thread. Please. You are moving further and further away from the original topic of this thread and further responses do not belong in this one.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 18:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mapping-by-Zip-code/m-p/854401#M23442</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-18T18:32:11Z</dc:date>
    </item>
  </channel>
</rss>

