<?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: How to create a simple USA Map with dots in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203962#M7549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. Thanks - I probably didn't express myself well.&amp;nbsp; What I'm trying to do is start with a US map.&lt;/P&gt;&lt;P&gt;Then I have a dataset of x,y,color.&lt;/P&gt;&lt;P&gt;I just want to plot each x,y (latitude, longitude) in the color on top of the US map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dataset are locations in the map and the colors represent different kinds of locations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I reviewed the suggested applicaation, but it seemed a lot more complex than what I'm trying to do.&amp;nbsp; Here's what I did - taken mostly from examples.&amp;nbsp; geocode2 is the dataset containing x,y, and color.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno; set sasuser.geocoded2; length function $ 8 ; xsys='2'; ysys='2'; hsys='3'; when='A'; function = 'POINT'; segment=1; run;&lt;/P&gt;&lt;P&gt;proc gproject data=anno out=annop degree eastlong; id state; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gmap data=maps.us annotate=annop; id state; run; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It didn't produce any map.&amp;nbsp; I wasn't sure what ID to use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Mar 2015 00:34:35 GMT</pubDate>
    <dc:creator>SciFiGuy0</dc:creator>
    <dc:date>2015-03-18T00:34:35Z</dc:date>
    <item>
      <title>How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203959#M7546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got a dataset named geocoded with latitude, longitutde, and color.&amp;nbsp;&amp;nbsp;&amp;nbsp; I'd like to just place colored dots at each X,Y coordinate on a US map using the color Color.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I have to use annotate and maybe gproject.&amp;nbsp; Any suggestions (code is good too : ) would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 20:24:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203959#M7546</guid>
      <dc:creator>SciFiGuy0</dc:creator>
      <dc:date>2015-03-17T20:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203960#M7547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this example will provide a good starting place for your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd28/dotmap_info.htm" title="http://robslink.com/SAS/democd28/dotmap_info.htm"&gt;http://robslink.com/SAS/democd28/dotmap_info.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="dotmap.png" class="jive-image-thumbnail jive-image" height="420" src="https://communities.sas.com/legacyfs/online/9603_dotmap.png" style="height: 420px; width: 908.653846153846px;" width="909" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 21:11:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203960#M7547</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2015-03-17T21:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203961#M7548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or the full code tab here: &lt;A href="http://support.sas.com/kb/31/419.html" title="http://support.sas.com/kb/31/419.html"&gt;31419 - Place symbols at ZIP code locations on a U.S. map&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 21:48:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203961#M7548</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-03-17T21:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203962#M7549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. Thanks - I probably didn't express myself well.&amp;nbsp; What I'm trying to do is start with a US map.&lt;/P&gt;&lt;P&gt;Then I have a dataset of x,y,color.&lt;/P&gt;&lt;P&gt;I just want to plot each x,y (latitude, longitude) in the color on top of the US map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dataset are locations in the map and the colors represent different kinds of locations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I reviewed the suggested applicaation, but it seemed a lot more complex than what I'm trying to do.&amp;nbsp; Here's what I did - taken mostly from examples.&amp;nbsp; geocode2 is the dataset containing x,y, and color.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno; set sasuser.geocoded2; length function $ 8 ; xsys='2'; ysys='2'; hsys='3'; when='A'; function = 'POINT'; segment=1; run;&lt;/P&gt;&lt;P&gt;proc gproject data=anno out=annop degree eastlong; id state; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gmap data=maps.us annotate=annop; id state; run; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It didn't produce any map.&amp;nbsp; I wasn't sure what ID to use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 00:34:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203962#M7549</guid>
      <dc:creator>SciFiGuy0</dc:creator>
      <dc:date>2015-03-18T00:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203963#M7550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@BallardW example is what you're looking for, replace the ZIP table with your table of x/y locations. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 04:22:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203963#M7550</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-03-18T04:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203964#M7551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's what I have.&amp;nbsp;&amp;nbsp; The code below is what I get when I replace things.&amp;nbsp; What that gives me is a US graph at an angle with State FIPS Code 1-10 10-20...&amp;nbsp;&amp;nbsp; There don't seem to be any of the colored dots.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno;&lt;/P&gt;&lt;P&gt;set sasuser.geocoded2;&lt;/P&gt;&lt;P&gt;length function $ 8 ; xsys='2'; ysys='2'; hsys='3'; when='A'; function = 'POINT'; flag=1; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data all;&lt;/P&gt;&lt;P&gt;set maps.us anno;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=all out=allsorted;&lt;/P&gt;&lt;P&gt;by state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gproject data=allsorted out=annop degrees;&lt;/P&gt;&lt;P&gt;id state;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data annodata usmap;&lt;/P&gt;&lt;P&gt;set annop;&lt;/P&gt;&lt;P&gt;if flag=1 then output annodata; else output usmap;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gmap data=usmap map=usmap;&lt;/P&gt;&lt;P&gt;id state;&lt;/P&gt;&lt;P&gt;choro state/annotate=annodata;&lt;/P&gt;&lt;P&gt;run; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this the right idea?&amp;nbsp; At least I'm getting a graphic map now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: alan weiner Trying to make things more readable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 04:40:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203964#M7551</guid>
      <dc:creator>SciFiGuy0</dc:creator>
      <dc:date>2015-03-18T04:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203965#M7552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this is the right idea.&amp;nbsp; MAPS.US is already projected.&amp;nbsp; Your points are probably not.&amp;nbsp; I would use MAPSGFK.US_STATES or something in MAPSGFK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lat/Long are not projected in MAPSGFK so you can set X=long; y=lat;&lt;/P&gt;&lt;P&gt;It is also in degrees rather than Radians.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also use this Macro for the annotate.&amp;nbsp; You can size the "points":&lt;/P&gt;&lt;P&gt;%macro make_dots(annodata, inputdata, color, size, tipvar); &lt;BR /&gt; data &amp;amp;annodata; &lt;BR /&gt; length function color $ 8 style $20 position $ 1 text $ 60 html $1024;&lt;BR /&gt; retain xsys ysys '2' hsys '3' when 'a' size .7;&lt;BR /&gt; set &amp;amp;inputdata; &lt;BR /&gt;/*optional arguments*/ &lt;BR /&gt;%if (&amp;amp;size ^= ) %then %do; size=&amp;amp;size; %end;&lt;BR /&gt; /* All annotate points are 360-degree pies. */&lt;BR /&gt; function='pie';&lt;BR /&gt; rotate=360;&lt;BR /&gt; style='psolid'; &lt;BR /&gt;color=&amp;amp;color;&lt;BR /&gt; /* optional tool tips */&lt;BR /&gt; %if (&amp;amp;tipvar ^= ) %then %do;&lt;BR /&gt; html= 'title=' || quote("&amp;amp;tipvar" ||'=' || trim(left(&amp;amp;tipvar)) );&lt;BR /&gt; %end;&lt;BR /&gt; output;&lt;BR /&gt; /* Draw an outline around each 'dot' */&lt;BR /&gt; color="gray55";&lt;BR /&gt; style='pempty';&lt;BR /&gt; output;&lt;BR /&gt; run;&lt;BR /&gt; %mend;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 13:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203965#M7552</guid>
      <dc:creator>Darrell_sas</dc:creator>
      <dc:date>2015-03-18T13:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203966#M7553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you looked at the example I posted you may have seen some code involved that transforms Lat and Long from degrees to radians. There's also a bit involved in getting east/west values as positive negative to match the map dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect your log has a message about trying to display points outside of the map area.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 14:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203966#M7553</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-03-18T14:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203967#M7554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all your help!&amp;nbsp;&amp;nbsp;&amp;nbsp; I now have a map with tiny dots (I'll use Daryll's macro to make them larger)&amp;nbsp; The original data file had city/state data.&amp;nbsp; I used geocode to get the lat/long from there.&lt;/P&gt;&lt;P&gt;I turned the geocoded dataset into an annotated set and then projected that with the degrees option, then merged it with the mapsgfk.us map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, I do have notes on the log that X is not on the graph as Ballard suggested. &lt;/P&gt;&lt;P&gt;Ballard - does one have to go through all those transformations in order to get the right coordinates?&amp;nbsp; or is that what the project is supposed to do for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's light at the end of the tunnel &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;Message was edited by: alan weiner&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:58:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203967#M7554</guid>
      <dc:creator>SciFiGuy0</dc:creator>
      <dc:date>2015-03-20T15:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203968#M7555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the help:&lt;/P&gt;&lt;P&gt;By default, the GPROJECT procedure assumes that the units for the input &lt;/P&gt;&lt;P&gt;coordinate values are radians and that values for the horizontal coordinate &lt;/P&gt;&lt;P&gt;increase from east to west across the map. If your map coordinates are stored as &lt;/P&gt;&lt;P&gt;degrees of arc, use the DEGREE option in the PROC GPROJECT statement. If the &lt;/P&gt;&lt;P&gt;horizontal coordinate values in the map increase west-to-east rather than &lt;/P&gt;&lt;P&gt;east-to-west, use the EASTLONG option in the PROC GPROJECT statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 16:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203968#M7555</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-03-20T16:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a simple USA Map with dots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203969#M7556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Here is a whole example so you can see MAPSGFK and GPROJECT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data schools (label='Wake County, NC public schools');&amp;nbsp; &lt;BR /&gt;&amp;nbsp; infile datalines dlm=',';&lt;BR /&gt;&amp;nbsp; length school $64 address $32 city $24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state $2 zip 5 type $12 color $10;&lt;BR /&gt;&amp;nbsp; input school address city state zip type;&lt;BR /&gt;&amp;nbsp; type = upcase(type);&lt;BR /&gt;&amp;nbsp; /* Set point color based on school type. */&lt;BR /&gt;&amp;nbsp; if&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type = 'HIGH'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then color = 'CXff0000';&lt;BR /&gt;&amp;nbsp; else if type = 'MIDDLE'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then color = 'CX00ff00';&lt;BR /&gt;&amp;nbsp; else if type = 'ELEMENTARY' then color = 'CX0000ff';&lt;BR /&gt;&amp;nbsp; else delete; /* Drop multi-type schools */&lt;BR /&gt;datalines;&lt;BR /&gt;Adams Elementary, 805 Cary Towne Blvd., Cary, NC, 27511, Elementary&lt;BR /&gt;Apex High, 1501 Laura Duncan Road, Apex, NC, 27502, High&lt;BR /&gt;Apex Middle, 400 E. Moore Street, Apex, NC, 27502, Middle&lt;BR /&gt;Athens Drive High, 1420 Athens Drive, Raleigh, NC, 27606, High&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt; proc geocode method=street data=work.schools out=work.geocoded lookupstreet=sashelp.geoexm; run;&lt;BR /&gt;&amp;nbsp; %make_dots(anno,work.geocoded,color,1);&lt;BR /&gt;data anno; set anno; flag=1; run;&lt;BR /&gt;data us_states(drop=state); set mapsgfk.us_states;&amp;nbsp; run;&lt;BR /&gt;data us_states; set us_states; state=statecode; x=long; y=lat; &lt;BR /&gt;&amp;nbsp; if state="AK" or state="HI" then; else output; run;&lt;BR /&gt;data all; set us_states anno; run;&lt;BR /&gt;proc sort data=all out=allsorted; by state; run;&lt;BR /&gt;proc gproject data=allsorted out=annop project=albers degrees eastlong; id state; run;&lt;BR /&gt;data annodata usmap; set annop; if flag=1 then output annodata; else output usmap; run;&lt;BR /&gt;proc gmap data=usmap map=usmap anno=annodata;&lt;BR /&gt;id state;&lt;BR /&gt;choro state/&amp;nbsp; nolegend;&lt;BR /&gt;run; quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 19:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-a-simple-USA-Map-with-dots/m-p/203969#M7556</guid>
      <dc:creator>Darrell_sas</dc:creator>
      <dc:date>2015-03-20T19:00:44Z</dc:date>
    </item>
  </channel>
</rss>

