
60 Geographical Information Systems: Trends and Technologies
from the former steps. Finally, use the rectangle keys to retrieve data in the
CDMs and then prune the unqualifi ed data to get the query result.
k-NN Query
k-NN query is also commonly used in location based applications. Algorithm
3 shows the k-NN query algorithm in HBase and Cassandra, where K stores
the result of k nearest neighbors, QueryRect stores the rectangles which
could be scanned, dist is the range for the rectangle search, Rect
scanned
stores the rectangles that have been scanned, and the data structure of
QueryRect is a queue. The k-NN query has two main parts: 1) set a range ...