Spatiotemporal Access to Moving Objects Hao LIU, Xu GENG 17/04/2018
Contents Overview & applications Spatiotemporal queries Movingobjects modeling Sampled locations Linear function of time Indexing structure TPR-tree Tree organization heuristics Operations
Spatiotemporal vs. Spatial Space and time Space Moving objects Static objects Frequent updates Less frequent updates
Application: Air Traffic Controller Moving objects: airplanes Example: which airplanes will probably arrive at the airport in the next 5 minutes? (Euclidean space: straight and direct Euclidean distance as the distance)
Application: Taxi-hailing Service Moving objects: taxis on the city roads Example: what are the nearest five taxis at this moment? (Road network: spatial network distance as the distance)
Application: Wireless Communication System Moving objects: mobile phone users Example: how many mobile phone users have been in area #47 in last 2 hours? (Cellular network)
Location-based Spatiotemporal Queries Spatial queries at a certain timestamp or within a certain time interval Intersection join Window query knn T 1 T 2 Return the 2 nearest neighbors of q at time T 1 and T 2
Trajectory-based Spatiotemporal Queries Trajectory: path that a moving object follows over a time period Topological query Enter Leave Cross Bypass p 1 (enter) p 3 (cross) Window W p 2 (leave) p 4 (bypass) T 1 T 2
Trajectory-based Spatiotemporal Queries Navigational query Heading Speed Distance Area p 1 p 2 Return the moving direction of p 1 Return the objects that have moved to the north Return the travel speed of p 2 Return the objects having traveled at speed of no less than 20 m/min
Aggregate Spatiotemporal Queries Aggregate query: summarized information about moving objects that lie in a query region during a query interval Window W p 1 p 2 p 3 p 4 Should be counted once only! Return the number of objects that have visited W between time T 1 and T 2 T 1 T 2
Modeling Moving Objects Historical queries: by sampled locations Historical R-tree 3D R-tree
R-tree Spatial indexing with MBR(Minimum Bounding Rectangle) How to deal with objects that evolves? 1 2 3 A 4 B 5 6 Window W 7 8 C 9
R-tree Storing All Previous States? 1 A 2 3 7 9 4 B 5 6 Window W C 8 1 2 A1 3a 7 9 4 B 5 6 Window W C 8 1 2 C1 8a A1 3a 7 9 4 B 5 6 Window W T 0 T 1 T 2
Historical R-tree
3D R-tree MBB Time is viewed as another dimension A trajectory of a point in 2D space is transformed to a set of 3D line segments, bounded by MBB(Minimum Bounding Box), its 2D projection reflects the origin trajectory 2D topological queries are transformed to 3D static range queries
Historical R-tree vs. 3D R-tree Historical H-tree Advantages All the historical states of the moving objects are maintained with reduced disk space Efficient access to the previous states Disadvantages Inefficient in preserving trajectory of objects 3D R-tree Advantages Good at processing trajectorybased queries Disadvantages There can be large dead spaces in an MBB, so overlapping is high in the whole index structure
Modeling Moving Objects Predictive queries: by linear function of time TPR tree
Moving objects Assume linear motion, modeling position as a function of time x t = x t $%& + v(t t $%& ) Make tentative future predictions Avoid frequent update What to store Set t $%& as index creation time Store (x t $%&, v) for tracking moving objects T = t $%& x(t $%& ) v T = t x(t)
MBR for tracking moving objects Fig 1: Initial setting for reference position and velocity at t $%& T = t $%& T = t $%& Fig2: MBR under initial setting Fig 3: Position at time t. The original MBR assignment is deteriorated. T = t T = t Fig 4: The ideal MBR assignment in t.
TPR tree index structure Time Parameterized R tree Design for querying moving objects in a period of time in the future Leaf nodes Position of moving object Represented by (x $%&, v) Pointer to moving object Internal (non-leaf) nodes Bounding rectangle Represented by (MBR, VBR) Pointer to subtree
Example in tracking moving rectangles 10 y t = 0 VBRs: {left, right, bottom, top} 5-2 1 N1 1 1-2 -2-2 a 1 1 b -1-2 1 1 2 d -1 1-2 -2 N2 c 2 a 0 = 1,1,1,1 ; b 0 = 2, 2, 2, 2 ; N 60 = { 2,1, 2,1} c 0 = 2,0,0,2 ; d 0 = 1, 1,1,1 ; N <0 = { 2,0,0,2} -2 0 5 10 x 10 5 y N1 b a t = 1 d c N2 Some characteristics on this bounding strategy The bounding strategy is conservative keeps expanding Avoids excessive storage cost. Bound rectangle tightened when new rectangle inserted or deleted 0 5 10 x
Heuristics on designing tree The TPR tree is designed for timestamp queries in T =, T = + H T = : Current update time H: Tree parameter the timespan the tree can see in the future TPR-tree Given an objective function A t = T = for static data Static indexing structures minimize A t = T = during tree organization TPR-tree minimize the integral over time: G H IJ minimize F A t dt G H
Time as a parameter Left: Right: minimize A(t = T = ) G H IJ minimize F A t dt G H Tc Tc+H Trapezoid in R tree Trapezoid in timeparameterized model
Objective Use objective from R*-tree For TPR-tree G H IJ The area of a bounding rectangle A N, t dt [1] G H G The overlap of two rectangle. H IJ OVR N 6, N <, t dt [2] G H G The perimeter of a bound rectangle H IJ P N, t dt [3] G H G The distance between the centroids H IJ CDIST N 6, N <, t dt [4] G H The four objectives are adapted in different parts of R*-tree and TPRtree algorithm Keeps bound rectangles small The probability of rectangle intersects query region is small
Insertion -- ChooseSubTree R-tree 1. n=root 2. IF n is a leaf return n ELSE choose entry that minimize MBR area ([1]) 3. n = chosen entry, go to 2 R*-tree and TPR-tree 1. n=root 2. IF n is a leaf return n IF n s child is leaf Choose entry that minimize BR overlap ([2]) with siblings; resolve ties by smallest area entanglement ELIF n s child is non-leaf Choose entry that minimize MBR area ([1]); resolve ties by smallest MBR size 3. n = chosen entry, go to 2
Insertion -- ChooseSubTree Try to insert k: Choose N5 min BR area increment Choose N1 Minimize BR overlap k R*-tree and TPR-tree 1. n=root 2. IF n is a leaf return n IF n s child is leaf Choose entry that minimize BR overlap ([2]) with siblings; resolve ties by smallest area entanglement ELIF n s child is non-leaf Choose entry that minimize MBR area ([1]); resolve ties by smallest MBR size 3. n = chosen entry, go to 2
Re-insert When a leaf node is full Remove and re-insert a fraction of entries Select entries with largest centroid distance If still full, do split N1 is full and k is awaiting: Re-insert b Largest centroid distance CDIST(b,N1), compared to a,c,k B is re-inserted to N1 Do split b k
Split Step 1 ChooseSplitAxis For each axis (x and y in this case): 1. Sort entries by lower value of the rectangle (a,k,c,b) 2. Determine all possible entry allocations (1-3, 2-2, 3-1) 3. Compute S = sum of perimeter for each allocation 4. go to 1 and do the same for higher value, accumulate S 5.6 Choose the split axis with minimum S
Split Step 2 ChooseSplitIndex Minimize overlap between MBRs Suppose x-axis is chosen in ChooseSplitAxis Considering 3 different divisions 2-2 division has minimal overlap Split using 2-2 division Insertion result
Deletion Identify the leaf node contains the entry to be deleted and remove the entry If leaf node underflows Re-insert all entries of the node Else Remove entry and terminate Propagate to upper levels if needed Bound rectangles are tightened after insertion or deletion
Reference Tao, Y., Papadias, D., & Sun, J. (2003, September). The TPR*-tree: an optimized spatiotemporal access method for predictive queries. In Proceedings of the 29th international conference on Very large data bases-volume 29 (pp. 790-801). VLDB Endowment. Šaltenis, S. (2008). Indexing the positions of continuously moving objects. Encyclopedia of GIS, 538-543. Tao, Y., & Papadias, D. (2002, June). Time-parameterized queries in spatio-temporal databases. In Proceedings of the 2002 ACM SIGMOD international conference on Management of data (pp. 334-345). ACM. Beckmann, N., Kriegel, H. P., Schneider, R., & Seeger, B. (1990). The R*-tree: an efficient and robust access method for points and rectangles. Acm Sigmod Record, 19(2), 322-331. Zhang, R., Qi, J., Lin, D., Wang, W. & Wong, R. C.-W. (2012). A highly optimized algorithm for continuous intersection join queries over moving objects, In Proceeding ADC '12 Proceedings of the Twenty-Third Australasian Database Conference (pp. 51-60). ACM.
Reference Alamri, S., Taniar, D., & Safar, M. (2014). A taxonomy for moving object queries in spatial databases. In Future Generation Computer Systems-Volume 37 (pp. 232-242). Tao, Y., Kollios, G., Considine, J., Li, F., & Papadias., D. (2004) Spatio-temporal aggregation using sketches. In Proc. of International Conference on Data Engineering (pp 449 460). ACM. Nascimento, M. A., & Silva, J. R. O. (1998). Towards historical R-trees. In Proceedings of the ACM Symp. on Applied Computing (pp 235 240). Pfoser, D., Jensen, C., & Theodoridis, Y. (2000). Novel Approaches in Query Processing for Moving Objects. In Proceedings of VLDB, Cairo Egypt. Tao, Y., & Papadias, D. (2001). MV3R-Tree: A Spatio-Temporal Access Method for Timestamp and Interval Queries. In Proceedings of the Intl. Conf. on Very Large Data Bases, VLDB (pp 431 440).