<?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 Converting Latitude and Longitude for Use With Specific MAPSGFK Maps in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Converting-Latitude-and-Longitude-for-Use-With-Specific-MAPSGFK/m-p/938295#M24889</link>
    <description>&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been searching for a bit now trying to find a solution to my current issue. I am trying to project latitude and longitude onto a specific map in the MAPSGFK folder using PROC SGMAPS SCATTER.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realize that the lat/lon need to be converted. I have tried converting using PROC GPROJECT, but the points don't line up on the maps, specifically on MAPSGFK.us (I'm using sashelp.springs for my scatter data). You can see Alaska, HI, and the lower 48 states outlined by the dots:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 652px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99050iD6194E5380A5C055/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for my question, is there a command/function to convert lat/lon specifically by map, or do I need to do some extra work to get it to fit correctly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code for reference:&lt;/P&gt;&lt;P&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data springs (rename=(latitude=y longitude=x));
	set sashelp.springs;
	run;

proc gproject data=springs out=springs_proj degrees eastlong; /*not sure of these options*/
	id type;
	run;

proc sgmap mapdata=mapsgfk.us plotdata=springs_proj;
	choromap / mapid=state;
	scatter x=x y=y / markerattrs=(color=blue size=2 symbol=circlefilled);
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Apologies if this has been answered over and over... I haven't been able to find the right answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;SA&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2024 20:15:09 GMT</pubDate>
    <dc:creator>subpar_actuary</dc:creator>
    <dc:date>2024-08-05T20:15:09Z</dc:date>
    <item>
      <title>Converting Latitude and Longitude for Use With Specific MAPSGFK Maps</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Converting-Latitude-and-Longitude-for-Use-With-Specific-MAPSGFK/m-p/938295#M24889</link>
      <description>&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been searching for a bit now trying to find a solution to my current issue. I am trying to project latitude and longitude onto a specific map in the MAPSGFK folder using PROC SGMAPS SCATTER.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realize that the lat/lon need to be converted. I have tried converting using PROC GPROJECT, but the points don't line up on the maps, specifically on MAPSGFK.us (I'm using sashelp.springs for my scatter data). You can see Alaska, HI, and the lower 48 states outlined by the dots:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 652px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99050iD6194E5380A5C055/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for my question, is there a command/function to convert lat/lon specifically by map, or do I need to do some extra work to get it to fit correctly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code for reference:&lt;/P&gt;&lt;P&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data springs (rename=(latitude=y longitude=x));
	set sashelp.springs;
	run;

proc gproject data=springs out=springs_proj degrees eastlong; /*not sure of these options*/
	id type;
	run;

proc sgmap mapdata=mapsgfk.us plotdata=springs_proj;
	choromap / mapid=state;
	scatter x=x y=y / markerattrs=(color=blue size=2 symbol=circlefilled);
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Apologies if this has been answered over and over... I haven't been able to find the right answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;SA&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 20:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Converting-Latitude-and-Longitude-for-Use-With-Specific-MAPSGFK/m-p/938295#M24889</guid>
      <dc:creator>subpar_actuary</dc:creator>
      <dc:date>2024-08-05T20:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Latitude and Longitude for Use With Specific MAPSGFK Maps</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Converting-Latitude-and-Longitude-for-Use-With-Specific-MAPSGFK/m-p/938303#M24890</link>
      <description>&lt;P&gt;It sounds like you're asking 2 questions here:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Is there a way to project points to maps in the MAPSGFK library?&lt;/LI&gt;
&lt;LI&gt;Can I get my points to work with the MAPSGFK.US data?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, for #1, yes there is.&amp;nbsp; You can use the PARMIN= option to PROC GPROJECT to project for any map in the MAPSGFK library except for the one you're trying to use.&amp;nbsp; That get's me to #2, which the answer is "no".&amp;nbsp; The US map you show has specially-processed data to bring in AK and HI from their normal locations.&amp;nbsp; Furthermore, different projections were used on them, and they were scaled.&amp;nbsp; So there is no single command to project to that map.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the other maps that you can use the PARMIN= option, you simply specify the name of the dataset you'd like it to be projected for.&amp;nbsp; They're all located in the MAPSGFK.PROJPARM data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, and happy mapping!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeff Phillips&lt;/P&gt;
&lt;P&gt;SAS&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 20:39:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Converting-Latitude-and-Longitude-for-Use-With-Specific-MAPSGFK/m-p/938303#M24890</guid>
      <dc:creator>JeffP</dc:creator>
      <dc:date>2024-08-05T20:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Latitude and Longitude for Use With Specific MAPSGFK Maps</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Converting-Latitude-and-Longitude-for-Use-With-Specific-MAPSGFK/m-p/938450#M24892</link>
      <description>&lt;P&gt;As Jeff says, Alaska &amp;amp; Hawaii have been moved/projected/scaled differently from the rest of the US, in this particular map (mapsgfk.us). Therefore, there is no one/simple command that will move/project/scale arbitrary lat/long coordinates and have them line up with the map.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But ... mapsgfk.uscity has applied the same move/project/scale to all the mapsgfk.uscity locations, so they line up with mapsgfk.us ... and therefore if you find the closest city to each of your lat/long locations, you could look up the x/y from mapsgfk.uscity, and plot those locations on the map. Here's a small example showing all the mapsgfk.uscity locations overlaid on mapsgfk.us:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "mapsgfk.us with mapsgfk.uscity locations overlaid";
proc sgmap mapdata=mapsgfk.us noautolegend plotdata=mapsgfk.uscity;
choromap / mapid=statecode;
scatter x=x y=y / markerattrs=(size=1px color=red symbol=circlefilled) transparency=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="uscity.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99078iEB63D813B8BD2781/image-size/large?v=v2&amp;amp;px=999" role="button" title="uscity.png" alt="uscity.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>Wed, 07 Aug 2024 00:02:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Converting-Latitude-and-Longitude-for-Use-With-Specific-MAPSGFK/m-p/938450#M24892</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2024-08-07T00:02:50Z</dc:date>
    </item>
  </channel>
</rss>

