Skip to content

Commit

Permalink
* Drastically reduce server load (and therefore throughput) for low z…
Browse files Browse the repository at this point in the history
…oom,

  high data views.
  (This was done through proper direction of a for loop causing increased cache
   hits and also making it more likely that matches are found quickly.)
* While between 10 and 500 times faster (depending on amount of data) than
  before, it is still not instantaneous.

In the previous release the accuracy of positioning was increased drastically
on low zoom views.
  • Loading branch information
treveradams committed Mar 13, 2014
1 parent a934738 commit 05fda7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions get_local_ap.php
Expand Up @@ -214,7 +214,7 @@ function add_blocks($top, $left, $bottom, $right)
fclose($file);
}
else {
if($res >= 25000)
if($res >= 19500)
{
list ($lat, $long) = gs2latlon($value);
$lat = doubleval($lat);
Expand Down Expand Up @@ -264,7 +264,7 @@ function add_blocks($top, $left, $bottom, $right)
}
else {
$broken = 0;
for($i=0; $i<=$last_used; $i++)
for($i=$last_used; $i>=0; $i--)
{
if(distance($good[$i]["lat"], $good[$i]["long"], $temp["lat"], $temp["long"]) < $res) { $broken = 1; break; }
}
Expand Down Expand Up @@ -302,7 +302,7 @@ function add_blocks($top, $left, $bottom, $right)
else if($lat >= $bottom && $lat <= $top && $long >= $left && $long <= $right)
{
$broken = 0;
for($i=0; $i<=$last_used; $i++)
for($i=$last_used; $i>=0; $i--)
{
if(distance($good[$i]["lat"], $good[$i]["long"], $lat, $long) < $res) { $broken = 1; break; }
}
Expand Down

0 comments on commit 05fda7b

Please sign in to comment.