0 votes

Is it possible to create a query to show all companies within a range of for exemple 50km from London ?

Based on the latitude and longitude fields we have in the company ?

Maybe someone has already done this ?

asked in Efficy/ Client side by (618 points)

1 Answer

0 votes

On our SVN, you can inspect the location Projects/CBRE/trunk/serverscripts/Places_server.js

Check the function GetSearchSQL() especially this section seems to do most of the geographical search...

POWER(LATITUDE-($0),2)*$1+POWER(LONGITUDE-($2),2)*$3<1

Based on the database vendor, you'll need to Google to find the best SQL recipes to get the desired companies.

answered by (7.2k points)
1,226 questions
1,495 answers
1,831 comments
328 users