<?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: Distance to nearest edge of polygon in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Distance-to-nearest-edge-of-polygon/m-p/498075#M132250</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/235176"&gt;@pink_poodle&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, I'm looking for an example or any link showing steps with Greduce. Let me know if u have one please.&lt;/P&gt;</description>
    <pubDate>Sat, 22 Sep 2018 13:33:06 GMT</pubDate>
    <dc:creator>Cruise</dc:creator>
    <dc:date>2018-09-22T13:33:06Z</dc:date>
    <item>
      <title>Distance to nearest edge of polygon</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Distance-to-nearest-edge-of-polygon/m-p/497803#M132083</link>
      <description>&lt;P&gt;Is it possible at all to calculate the distance to the nearest edge of polygon from points (latitude and longitude)&amp;nbsp; using SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have latitude and longitude of residential homes and the polygons of SuperFund sites. I'd like to calculate the distance for each residential homes to the nearest edge of polygons of SuperFund sites. I know how to do it in ARCGIS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any hints are appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 13:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Distance-to-nearest-edge-of-polygon/m-p/497803#M132083</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-09-21T13:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Distance to nearest edge of polygon</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Distance-to-nearest-edge-of-polygon/m-p/497862#M132124</link>
      <description>&lt;P&gt;You can use the GREDUCE procedure to find the point on the polygon edge that is closest to the house coordinates, then use GEODIST function to find the distance between house coordinates and that point.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 16:22:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Distance-to-nearest-edge-of-polygon/m-p/497862#M132124</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2018-09-21T16:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Distance to nearest edge of polygon</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Distance-to-nearest-edge-of-polygon/m-p/498075#M132250</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/235176"&gt;@pink_poodle&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, I'm looking for an example or any link showing steps with Greduce. Let me know if u have one please.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Sep 2018 13:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Distance-to-nearest-edge-of-polygon/m-p/498075#M132250</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-09-22T13:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Distance to nearest edge of polygon</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Distance-to-nearest-edge-of-polygon/m-p/498114#M132273</link>
      <description>&lt;P&gt;It might be possible to test a simple scenario, where the polygon is represented by points (0,0), (0,1) and (0,2), while a house is point (1,1). After the GREDUCE procedure, the subset should contain only point (0,1) of the polygon and point (1,1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Three links follow that inspired this idea. Link 2 is the code for link 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. &lt;A href="https://blogs.sas.com/content/iml/2018/07/16/points-distance-from-polygon.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/07/16/points-distance-from-polygon.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/files/2018/07/offsetregion.txt" target="_blank"&gt;https://blogs.sas.com/content/iml/files/2018/07/offsetregion.txt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;3.&amp;nbsp;&lt;A href="http://morgan.dartmouth.edu/Docs/sas92/support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/greduce-using.htm" target="_blank"&gt;http://morgan.dartmouth.edu/Docs/sas92/support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/greduce-using.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is a fragment of code from link&amp;nbsp;2 used to reduce the contours of Texas to a 36-sided polygon. Input dataset is Texas1 and output dataset is Texas2. For this question, for a simple test, the input dataset would contain all four points. Once the appropriate density level is found, the output dataset will contain only the nearest point of the polygon and the house coordinates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class="language-sas"&gt;/* Before starting the SAS/IML program, generate a polygon for the state
  of Texas in standardized coordinates.
*/
data Texas1;
   set maps.US;
   where StateCode = "TX" and Segment=1;
   by State Segment;
run;

* Create density variable that can be used to reduce the data set;
proc greduce data=Texas1 out=Texas2;
  id segment;
run;

data Texas;
   set Texas2(keep=segment x y density);
   where (density&amp;lt;=4);
   Obs = _N_;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Sep 2018 21:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Distance-to-nearest-edge-of-polygon/m-p/498114#M132273</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2018-09-24T21:23:35Z</dc:date>
    </item>
  </channel>
</rss>

