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
Post a Comment