<?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: Calculating GEODIST for various combinations, cross looping in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410773#M67310</link>
    <description>The latitude and longitude are across the United States. But as you pointed out 1 degree in lat and long is more than 100 KM that defeats my purpose. I would rather go with zip variable.</description>
    <pubDate>Mon, 06 Nov 2017 07:55:53 GMT</pubDate>
    <dc:creator>munitech4u</dc:creator>
    <dc:date>2017-11-06T07:55:53Z</dc:date>
    <item>
      <title>Calculating GEODIST for various combinations, cross looping</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410143#M67243</link>
      <description>&lt;P&gt;I have a dataset &amp;nbsp;A, that contains the lat and long. I have another dataset B that also contains lat and long.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dataset A has close to 1m points and Dataset B has close to 20m points. &amp;nbsp;I want iterate for all the points from dataset A and calculate the distance of points on the dataset B and if distance of any points is &amp;lt;500m, flag as 1 else 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I have a variable within_500m, that says 1/0, when we calculate the distance from points in dataset A.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any efficient way to do this, as this combination is really huge. I was thinking about making sort of buckets on both the datasets using rank function and process them as blocks, but not sure, if that will give expected results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas, I can try?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I saw a post on GEODIST, for cross join, but not sure if thats an efficient method:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Statistical-Procedures/Calculating-All-GEODIST-Combos/m-p/255163#M13460" target="_blank"&gt;https://communities.sas.com/t5/SAS-Statistical-Procedures/Calculating-All-GEODIST-Combos/m-p/255163#M13460&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 10:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410143#M67243</guid>
      <dc:creator>munitech4u</dc:creator>
      <dc:date>2017-11-03T10:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating GEODIST for various combinations, cross looping</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410230#M67245</link>
      <description>&lt;P&gt;Pretty much as soon as you say "every record in set a with every record in set b" efficiency goes out the window, especially with the specific requirement to mark every result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You idea of blocks or ranks will add complexity and time to the "every record" requirement.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 14:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410230#M67245</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-03T14:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating GEODIST for various combinations, cross looping</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410246#M67246</link>
      <description>&lt;P&gt;I hope you realize that you are talking about making (1M x 20M) = 2 x 10^13 = 20 TRILLION comparisons. If you store the (long,lat) for both points, the indicator variable, and the distance, that will occupy 900 terabytes of storage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;500 meters is really close.&amp;nbsp; What are the ranges of (long,&amp;nbsp;lat) for these data sets? Are they all in a small area (maybe a state or county) or are the locations global (some in Europe, others in Asi, others in N.&amp;nbsp;America....)?&amp;nbsp; Are any points near the poles?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can look at the raw (long, lat) values to exclude a bunch of comparisons. A degree of latitude is more than 100 km, so you never have to call GEODIST unless the difference between latitudes is a fraction of a degree.&amp;nbsp; If you can bound the latitude away from the poles, we can say more.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 14:31:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410246#M67246</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-11-03T14:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating GEODIST for various combinations, cross looping</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410773#M67310</link>
      <description>The latitude and longitude are across the United States. But as you pointed out 1 degree in lat and long is more than 100 KM that defeats my purpose. I would rather go with zip variable.</description>
      <pubDate>Mon, 06 Nov 2017 07:55:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410773#M67310</guid>
      <dc:creator>munitech4u</dc:creator>
      <dc:date>2017-11-06T07:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating GEODIST for various combinations, cross looping</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410855#M67322</link>
      <description>&lt;P&gt;I wouldn't recommend using ZIP codes. Two addresses can be next door to each other and have different zip codes. In fact, two addresses can be in different STATES and still be within&amp;nbsp;500 meters.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 14:19:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculating-GEODIST-for-various-combinations-cross-looping/m-p/410855#M67322</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-11-06T14:19:41Z</dc:date>
    </item>
  </channel>
</rss>

