spatial threshold Ɛ. If ROI is larger than Ɛ, it will divide the
spatial region ROI evenly. The function of this module is to provide the subspace represented by Sub_ROI for sub-module
of multi-thread task allocation. According to the experiments, we know that there’s no need to use the approach of
multi-thread parallel processing if ROI is too small and the efficiency of aggregate calculation could meet the need of users.
Hence, we set a spatial threshold Ɛ and its value is gained based
on experience. Sub-module of multi-thread task allocation defines Threading
class firstly, and instantiates Threading class according to the number of Sub_ROI. Then it allocates a Sub_ROI which need
to calculate spatiotemporal aggregation to each sub-thread by means of multi-thread parallel.
Sub-module of aggregate query parsing uses every sub-thread to parse the parameters into SQL query statement that MODB
can identify, and then calculates spatiotemporal aggregation in database. The example of SQL query statement is as follows:
SELECT Moving_object_time, COUNT DISTINCT Moving_object_id
FROM Moving_object_table WHERE INTERSECTS Moving_object_position, Sub_ROI
AND Moving_object_time IN TOI GROUP BY
∆t ORDER BY Moving_object_time
Sub-module of
aggregate results
integrating obtains
spatiotemporal aggregate results of every sub-thread, and integrates them in order of time. Then it sends the integrated
results to the client via HTTP service.
4.2 Architecture of Spatiotemporal Aggregation Query Service
By implementing this algorithm, we encapsulated it as spatiotemporal aggregation query service on the server. Here is
the simple architecture shown in Figure 4.
Figure 4. Architecture of aggregation query service The client sends a query request and delivers the user-defined
parameters obtained from front end to spatiotemporal aggregation query service on the server. And these user-defined
parameters consist of the spatial region that user interests ROI, the temporal range that user specifies TOI, the time granularity
∆t and the spatial granularity N. In addition, the client receives the aggregate results which are provided by spatiotemporal
aggregation query service, and visualizes them based on the open source library of Data-Driven Documents D3.js on the
web browser. As shown in Figure 5, a is the statistical graph of the amount
of taxis in Beijing during one week for each hour, b is the statistical graph of the amount of sample points of taxis in
Beijing during one week for each hour, c is the statistical graph of the amount of taxis on Changan Avenue during one
week for each hour, d is the statistical graph of the amount of sample points of taxis on Changan Avenue during one week for
each hour. a
b
c
d Figure 5. The visualization results of spatiotemporal
aggregation query The MODB is based on the open source Object-Oriented
Relation Database ORDB PostgreSQL. We extend it in spatial attribute, and store the historical trajectory data of moving
objects in the form of point model. Multiple indexes are created on this data model, gist index of PostgreSQL on the spatial
domain, and B-tree index on the temporal domain. The traditional spatiotemporal aggregation queries are built on this
structure of multiple indexes represented by Indexes in section 5.
On the other hand, the moving objects will be counted more than once that fall on the grid lines when we divide the spatial
region. This will result in some deviations compared with the actual situation. In order to estimate the validity of aggregate
results, we define a concept of Error Threshold. If the Average Error Ratio is smaller than Error Threshold, the aggregate
results should be valid. Below is the formula of Average Error Ratio AER, as shown in Formula 1.
This contribution has been peer-reviewed. The double-blind peer-review was conducted on the basis of the full paper. doi:10.5194isprsannals-II-4-W2-1-2015
3
AER =
1
∑
� �_ ℎ �
�
−� �
�
�
� �
� �
�
1
1 where
=
��� �
and i means the time segment in n.
5. EXPERIMENT RESULTS AND ANALYSIS