Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // "space distance" is not a distance in physical space. It is a distance in 76D space.
- //$q = 'select placename from point where true order by SQRT('; //Square root does not change ordering.
- // $q = 'select placename, spacedistance as ('; from point where true order by spacedistance limit 10';
- //$q = 'select distinct placename,mapx,mapy,mapw from point where true order by (';
- $q = 'SELECT placename, mapx, mapy, mapw, min(';
- for ($i=0; $i < $nTotalMacs; $i++)
- {
- $q .= 'pow(coord'.($i+1).' - '. $vector[$i].',2)+';
- }
- $q .= ' 0) AS score FROM point '.$wherecondition.' GROUP BY placename ORDER BY score ASC LIMIT 10';
Advertisement
Add Comment
Please, Sign In to add comment