Research Article

A Novel Query Method for Spatial Data in Mobile Cloud Computing Environment

Algorithm 2

-NN query.
Input: query point
Output: the nearest points
(0) Result set , local queue
(1) Calculate  the grid block group corresponding to
the query point
(2) for  each Task  do
(3) Reading KeyValueStore to form RDDs based
on  the grid block group
(4) end for
(5) for each Partition of RDDs  do
(6) Calculate the distance between each point and
the query point
(7) Add the nearest points to
(8) end for
(9) for  each    do
(10) Collected to the master node
(11) end for
(12) Pick out the nearest points add to on master
node
(13) return