<?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: Proc SGMAP distorts map in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/766384#M21941</link>
    <description>&lt;P&gt;Thanks, I didn't know about that option. It's much easier!&lt;/P&gt;</description>
    <pubDate>Tue, 07 Sep 2021 13:52:39 GMT</pubDate>
    <dc:creator>ebowen</dc:creator>
    <dc:date>2021-09-07T13:52:39Z</dc:date>
    <item>
      <title>Proc SGMAP distorts map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765070#M21926</link>
      <description>&lt;P&gt;I'm trying to make a bubble map using PROC SGMAP. I have managed to get everything on the map (annotations aside), but for some reason the map looks distorted horizontally. I have attached two versions of the map, one with the openstreetmap option and one without. The one without openstreetmap looks correct, but the other one is noticeably wider and shorter. Here is my code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgmap 
	mapdata=wvcounties
	maprespdata=counties
	plotdata=mapdata;
/* openstreetmap; */
choromap group / mapid=county id=county name='counties';
bubble x=maplong y=maplat size=summercap / 
	fillattrs=(color=blue) 
	datalabel=mapname
	datalabelattrs=(color=black size=9 style=italic);
keylegend 'plants' / title='Plant Name';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Attached are the two versions of the map.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 14:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765070#M21926</guid>
      <dc:creator>ebowen</dc:creator>
      <dc:date>2021-08-31T14:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SGMAP distorts map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765101#M21927</link>
      <description>Do you have a projection on your base map? &lt;BR /&gt;If so I suspect it's different than the one being used by Open Street Map.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://en.wikipedia.org/wiki/Map_projection#:~:text=In%20cartography%2C%20a%20map%20projection,into%20locations%20on%20a%20plane.&amp;amp;text=Few%20projections%20in%20practical%20use%20are%20perspective" target="_blank"&gt;https://en.wikipedia.org/wiki/Map_projection#:~:text=In%20cartography%2C%20a%20map%20projection,into%20locations%20on%20a%20plane.&amp;amp;text=Few%20projections%20in%20practical%20use%20are%20perspective&lt;/A&gt;.</description>
      <pubDate>Tue, 31 Aug 2021 16:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765101#M21927</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-31T16:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SGMAP distorts map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765350#M21928</link>
      <description>&lt;P&gt;Calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13585"&gt;@GraphGuy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also could try PROC SGPLOT + POLYGON&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; wrote many blogs about it .&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 13:43:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765350#M21928</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-09-01T13:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SGMAP distorts map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765459#M21929</link>
      <description>&lt;P&gt;When using an Openstreetmap background, Proc SGmap applies a projection to your lat/long coordinates so they will line up correctly with the background map (I believe it is a pseudo-Mercator projection). When using an Openstreetmap background, you have no option/choice in the matter ... SGmap must project your coordinates to match that map. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When just drawing the choropleth map polygons (without the OpenStreetmap background), SGmap has more flexibility. If your map data has lat/long, then SGmap plots them by default (I'm not 100% sure if it applies an automatic projection in that case), and if you drop the lat/long variables then SGmap can use projected X/Y variables instead (and you could pre-process your dataset with Proc Gproject, so that those X/Y values are in any projection you want).&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 18:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765459#M21929</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-09-01T18:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SGMAP distorts map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765703#M21931</link>
      <description>&lt;P&gt;Thanks for helping me focus on the projection of the map. I will look into using PROC GPROJECT to get a projection that meets my needs. I have used it before for PROC GMAP using some of the shape data built into SAS, but I couldn't figure out the best way to make use of it for the newer SGMAP.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 18:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765703#M21931</guid>
      <dc:creator>ebowen</dc:creator>
      <dc:date>2021-09-02T18:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SGMAP distorts map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765834#M21932</link>
      <description>&lt;P&gt;The key to using Proc Gproject with SGmap, is that you have to drop the lat/long variables (if the map dataset has lat/long, then SGmap will use those instead of the projected x/y). Here's a small example to demonstrate:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data mymap; set mapsgfk.us_states (where=(statecode not in ('AK' 'HI')));&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc gproject data=mymap out=mymap latlong eastlong degrees project=gnomon;&lt;BR /&gt;id statecode;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title "&lt;STRONG&gt;Without dropping lat/long, lat/long is used&lt;/STRONG&gt;";&lt;BR /&gt;proc sgmap mapdata=mymap maprespdata=sashelp.us_data;&lt;BR /&gt;choromap population_2010 / mapid=statecode;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title "&lt;STRONG&gt;If you drop lat/long, then projected x/y is used&lt;/STRONG&gt;";&lt;BR /&gt;proc sgmap mapdata=mymap&lt;STRONG&gt; (drop=lat long)&lt;/STRONG&gt; maprespdata=sashelp.us_data;&lt;BR /&gt;choromap population_2010 / mapid=statecode;&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="map_lat_long.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63270i4EADDCBF6504C275/image-size/large?v=v2&amp;amp;px=999" role="button" title="map_lat_long.png" alt="map_lat_long.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="map_projected_x_y.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63271i7D4B63437B702A4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="map_projected_x_y.png" alt="map_projected_x_y.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>Fri, 03 Sep 2021 11:55:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/765834#M21932</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-09-03T11:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SGMAP distorts map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/766049#M21933</link>
      <description>&lt;P&gt;This worked, thanks! For anyone who finds this later, though, I did have to combine the map boundaries and bubble points together before projecting in order to get them to line up properly on the map. But otherwise, this worked well!&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 19:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/766049#M21933</guid>
      <dc:creator>ebowen</dc:creator>
      <dc:date>2021-09-04T19:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SGMAP distorts map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/766109#M21936</link>
      <description>&lt;P&gt;You don't have to combine the map boundary and bubbles. Many years ago you did, but we now provide a way to save the projection parameters (using parmout=) and then use those parameters (using parmin=) when you project other datasets. Here's a little example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;data mymap; set mapsgfk.us_states (where=(statecode not in ('AK' 'HI')));&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc gproject data=&lt;STRONG&gt;mymap&lt;/STRONG&gt; out=mymap latlong eastlong degrees project=gnomon&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;parmout=projparm&lt;/STRONG&gt;;&lt;BR /&gt;id statecode;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data centers; set mapsgfk.uscenter (where=(statecode not in ('AK' 'HI') and ocean^='Y'));&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc gproject data=&lt;STRONG&gt;centers&lt;/STRONG&gt; out=centers latlong eastlong degrees&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;parmin=projparm&lt;/STRONG&gt; parmentry=&lt;STRONG&gt;mymap&lt;/STRONG&gt;;&lt;BR /&gt;id;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title "Map and Centers projected separately";&lt;BR /&gt;proc sgmap mapdata=&lt;STRONG&gt;mymap&lt;/STRONG&gt; (drop=lat long) maprespdata=sashelp.us_data&lt;BR /&gt;&amp;nbsp; &amp;nbsp;plotdata=&lt;STRONG&gt;centers&lt;/STRONG&gt;;&lt;BR /&gt;choromap population_2010 / mapid=statecode;&lt;BR /&gt;scatter x=x y=y / markerattrs=(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="map_projparm.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63311i217A36F6131D405C/image-size/large?v=v2&amp;amp;px=999" role="button" title="map_projparm.png" alt="map_projparm.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>Sun, 05 Sep 2021 13:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/766109#M21936</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-09-05T13:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SGMAP distorts map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/766384#M21941</link>
      <description>&lt;P&gt;Thanks, I didn't know about that option. It's much easier!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 13:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-SGMAP-distorts-map/m-p/766384#M21941</guid>
      <dc:creator>ebowen</dc:creator>
      <dc:date>2021-09-07T13:52:39Z</dc:date>
    </item>
  </channel>
</rss>

