android group GPS coordinate by postilion -


i have punch of gps coordinates (latitude longitude) want create groups each 1 contain coordinates in same radius , iam using code distance between 2 points:-

float radius = (float) 1000.0;         float distance = loc.distanceto(loc2);         if (distance < radius)              toast.maketext(getapplicationcontext(), "inside", toast.length_long).show();     } 

but code need compare each coordinate rest check 1 closest ,which seem insufficient , there other way?

thanks in advance

the other way use geo spatial index, quad tree.
in case first calculate quad cells within radius, , consider points inside cells.

but programming, search , understanding effort, use such index when brute force search on points slow.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -