<?xml version="1.0" encoding="windows-1252"?>
<node id="601407" title="Re: Calculating Distance" created="2007-02-21 14:13:12" updated="2007-02-21 09:13:12">
<type id="11">
note</type>
<author id="144850">
rinceWind</author>
<data>
<field name="doctext">
&lt;p&gt;We've encountered this requirement for [http://openguides.org]. Here, alongside the lat + long, we store planar X-Y coordinates in the database, using a projection such as UTM or Ordnance Survey. Then, we use Pythagoras in SQL queries to find all entries within the distance.&lt;/p&gt;

&lt;p&gt;This works well for city guides - our main application, but less well over large distances, where curvature of the oblate spheroid that is the Earth, becomes a factor.&lt;/p&gt;

&lt;p&gt;I don't know what your application is, but check out [dist://OpenGuides], as there's probably quite a bit of code you can reuse. Or even set up a Guide yourself, if that's what you are trying to achieve.&lt;/p&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-144850"&gt;
&lt;p&gt;&lt;small&gt;--&lt;br /&gt;&lt;br /&gt;Oh Lord, won’t you burn me a Knoppix CD ?&lt;br /&gt;
My friends all rate Windows, I must disagree.&lt;br /&gt;
Your powers of persuasion will set them all free,&lt;br /&gt;
So oh Lord, won’t you burn me a Knoppix CD ? &lt;br /&gt; &lt;em&gt;(Missquoting Janis Joplin)&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
601377</field>
<field name="parent_node">
601377</field>
</data>
</node>
