Forum OpenACS Q&A: Re: Closest Address Calculation

Collapse
Posted by Tom Ayles on
I figured you were running this query through OpenACS, what with this being the OpenACS forums 'n' all 😉. The syntax :x0 specifies a bind variable - the value of the variable x0 is substituted into the query in that position by the database driver. So if you want to run the query directly, substitute the :x0 and :y0 parts with the X-Y coordinates of the point you are measuring from. The maths behind this is just Pythogoras theorem - a quick google would find about 34,500 pages if you want to read more.