<?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: SAS Studio SGMap: Can distance lines between 2 points be plotted on a map in Univ. Ed. SAS Studi in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/533613#M17766</link>
    <description>Thank you! This is very good to know!</description>
    <pubDate>Thu, 07 Feb 2019 15:18:49 GMT</pubDate>
    <dc:creator>KellyP</dc:creator>
    <dc:date>2019-02-07T15:18:49Z</dc:date>
    <item>
      <title>SAS Studio SGMap: Can distance lines between 2 points be plotted on a map in Univ. Ed. SAS Studio</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/532777#M17748</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am very new to base SAS, but stumbled upon sgmap and thought that it would be very useful for a research project my department is working on. I would like to plot locations using longitude and latitude data, then calculate and plot distance lines between pairs of locations. Is this possible in University Edition of SAS studio? I have only seen bubble plots without lines using sgmap. I don't currently have access to SAS/graph which I know can do what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;KellyP&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 22:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/532777#M17748</guid>
      <dc:creator>KellyP</dc:creator>
      <dc:date>2019-02-04T22:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio SGMap: Can distance lines between 2 points be plotted on a map in Univ. Ed. SAS Studi</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/532780#M17749</link>
      <description>SAS Academics on Demand supports SAS/Graph if you need it. Same restrictions as SAS UE.</description>
      <pubDate>Mon, 04 Feb 2019 22:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/532780#M17749</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-04T22:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio SGMap: Can distance lines between 2 points be plotted on a map in Univ. Ed. SAS Studi</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/533202#M17756</link>
      <description>&lt;P&gt;Here is one way to do it, using Proc SGmap in the latest version of SAS (9.4m6) ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data my_map; set mapsgfk.us_states (where=(statecode='NC'));&lt;BR /&gt;run;&lt;BR /&gt;data my_map_data; set mapsgfk.us_states_attr (where=(statecode='NC'));&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data points;&lt;BR /&gt;lat=35.73; long=-80.68; output;&lt;BR /&gt;lat=35.82; long=-78.76; output;&lt;BR /&gt;distance='distance = '||trim(left(put(geodist(35.73, -80.68, 35.82, -78.76, 'DM'),comma5.0))); output;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods path(prepend) work.templat(update);&lt;BR /&gt;proc template;&lt;BR /&gt;define style styles.nc_style;&lt;BR /&gt;parent=styles.htmlblue;&lt;BR /&gt;class graphcolors / 'gdata1'=cornsilk;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ods html style=nc_style;&lt;/P&gt;
&lt;P&gt;title1 "North Carolina map, with distance";&lt;BR /&gt;proc sgmap maprespdata=my_map_data mapdata=my_map plotdata=points noautolegend;&lt;BR /&gt;choromap statecode / mapid=statecode;&lt;BR /&gt;scatter x=long y=lat;&lt;BR /&gt;series x=long y=lat;&lt;BR /&gt;text x=long y=lat text=distance / position=topright textattrs=(color=red size=11pt);&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="sgmap.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26887i80706CFA0B16EFD9/image-size/large?v=v2&amp;amp;px=999" role="button" title="sgmap.png" alt="sgmap.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 12:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/533202#M17756</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2019-02-06T12:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio SGMap: Can distance lines between 2 points be plotted on a map in Univ. Ed. SAS Studi</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/533612#M17765</link>
      <description>Thank you! This definitely helped me figure out my program!</description>
      <pubDate>Thu, 07 Feb 2019 15:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/533612#M17765</guid>
      <dc:creator>KellyP</dc:creator>
      <dc:date>2019-02-07T15:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio SGMap: Can distance lines between 2 points be plotted on a map in Univ. Ed. SAS Studi</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/533613#M17766</link>
      <description>Thank you! This is very good to know!</description>
      <pubDate>Thu, 07 Feb 2019 15:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/533613#M17766</guid>
      <dc:creator>KellyP</dc:creator>
      <dc:date>2019-02-07T15:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio SGMap: Can distance lines between 2 points be plotted on a map in Univ. Ed. SAS Studi</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/533631#M17767</link>
      <description>&lt;P&gt;Here is how I programmed the lines and distance labels. I will probably adjust the formatting some more, but I am close to what I want.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data maptest;
	set maptes.sheet1;
	format distance comma10.2;
	distance=geodist(lat1, lon1, lat2, lon2, 'M');
	Route+1;
	DistLabel=catx(" ", round(distance, 0.01),"miles");
run;

data map_data_rotate (keep=year Location lat lon distance route DistLabel latmid lonmid);
	set maptest;
	format lat lon 8.4;
	latmid=(lat1+lat2)/2;
	lonmid=(lon1+lon2)/2;
	array lata(2) 8 Lat1 Lat2;
	array lona(2) 8 Lon1 Lon2;
	do i= 1 to 2;
		If lata(i) then lat=lata(i);
		if lona(i) then lon=lona(i);
		if i=1 then location=start_location;
		if i=2 then location=Destination;
		output;
	end;
run;
			
			

title Years 2018 and 2019;

proc sgmap plotdata=map_data_rotate;
    openstreetmap;
			series x=lon y=lat /group=Route ;
			scatter x=lonmid y=latmid /group=Route datalabel=distlabel DATALABELPOS=right DATALABELATTRS=(color=green size=8pt);
			

run;

title Year 2018;
proc sgmap plotdata=map_data_rotate;
    openstreetmap;
    where year=2018;
			series x=lon y=lat /group=Route ;
			scatter x=lonmid y=latmid /group=Route datalabel=distlabel DATALABELPOS=right DATALABELATTRS=(color=green size=8pt);
run;

title Year 2019;
proc sgmap plotdata=map_data_rotate;
    openstreetmap;
    where year=2019;
			series x=lon y=lat /group=Route ;
			scatter x=lonmid y=latmid /group=Route datalabel=distlabel DATALABELPOS=right DATALABELATTRS=(color=green size=8pt);
run;
title;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 15:42:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-Studio-SGMap-Can-distance-lines-between-2-points-be-plotted/m-p/533631#M17767</guid>
      <dc:creator>KellyP</dc:creator>
      <dc:date>2019-02-07T15:42:06Z</dc:date>
    </item>
  </channel>
</rss>

