Global Positioning System Reference
In-Depth Information
two parameters of the bounding_box_fetch method are omitted, and the
default values are used (1,000 for the maximum number of results and no
cost delimiter for the function).
The Fig. 23 presents the algorithm for query Q2 (retrieve all drugstores
within a maximum radius of 1km from hospitals). First, it is necessary to
fi lter the points of interest by the types “drugstore” and “hospital”, as
exemplifi ed in the fi rst and third lines of the algorithm, respectively. Next,
we iterate each retrieved hospital and, based on its location, we use the
proximity_fetch method with the following parameters: the query q, defi ned
in the fi rst line, containing all of the drugstores; the location of the current
hospital; the maximum number of results, which was fi xed at 10; and the
maximum distance (this parameter must be in radians, therefore we used the
constant 0.00157 that represents one km in radians). The drugstores found
for each hospital are added to an external list which stores all drugstores
within a maximum distance of one km from any hospital.
1
2
3
4
5
6
7
8
9
10
11
12
13
q = db.GqlQuery("SELECT * FROM POIS WHERE type = 'drugstore'")
hospitals = POIS.all.filter('type =', 'hospitals'))
allDrugstores = []
for h in hospitals:
hospital = db.GeoPt(h.latitude, h.longitude)
drugstores = proximity_fetch(q, hospital, maxResult=10,
max_distance=0.00157)
allDrugstores.extent(drugstores)
Fig. 23. Algorithm to answer Q2 in BigTable.
Conclusions
NoSQL systems have emerged to effi ciently handle large volumes of data.
In addition to being built to handle large volumes, a typical NoSQL system
has mechanisms for data partitioning, horizontal scalability, lack of schema
defi nition, non-relational data models, simple APIs for data access, and
eventual consistency.
Location-based applications have become popular, generating large
volumes of highly distributed spatial data daily and demanding high
processing for the spatial queries. Traditional GIS technologies do not cope
with this highly distributed and scalable demand. Therefore, several spatial
extensions were included in many NoSQL systems, like the pioneers in the
provision of spatial data support, MongoDB and CouchDB. Such extensions
enable NoSQL systems to address the complexity and particularity of highly
distributed spatial data.
Search WWH ::




Custom Search