2019 International Conference on Artificial Intelligence, Control and Automation Engineering (AICAE 2019) ISBN: 978-1-60595-643-5
Research on Ship Trajectory Compression Algorithm
Based on Cumulative Heading Variation
Ran LI, Shao-xi LI
*, Xin-ran LIU and Jun-feng ZHANG
Dalian Maritime University, Dalian 116026, China *Corresponding author
Keywords: Douglas-Peucker algorithm, Cumulative heading change, Ship trajectory, data compression.
Abstract. In this paper, we proposed an improved Douglas-Peucker algorithm based on cumulative heading variation to improve the ship trajectory data compression algorithm. This method calculates the cumulative heading change of the post-point and the base point in turn based on the starting point of the route. If the cumulative heading change of the post-point is greater than the set threshold value, the point is stored in the feature point library. With this point as the new base point, the above calculation is repeated until the last point of the route. According to the obtained feature points, the route is divided into several sections, each section is separated by Douglas-Peucker algorithm. Compression is performed to obtain the final trajectory. This method can avoid the problems of trajectory compression caused by traditional Douglas-Peucker algorithm, such as crossing shoreline and dangerous area in inland river bend, and can better meet the needs of inland ship trajectory compression.
Introduction
In recent years, the data generated by the ship's automatic identification system has experienced explosive growth. These massive data include the ship's historical trajectory, which condenses the driver's empirical summary of the current navigation methods in the waters. Therefore, based on these data, it is possible to plan safe routes in complex water environments. However, the update interval of ship AIS data is short, usually from a few seconds to several minutes, and ships in inland waters are frequently navigating. Therefore, the amount of AIS data is very large. At the same time, in the process of analysis and mining of AIS data, too large AIS data will not only reduce the efficiency of query and calculation, but also cause local features of ship trajectory to be lost due to data redundancy. Therefore, the compression processing of ship trajectory data is particularly important [1].
Currently, the compression algorithm for the trajectory data is as follows. (1) Line segment based trajectory compression algorithm. This algorithm mainly includes the Douglas-Peucker algorithm and its improved algorithm [2,3,4]. These algorithms are simple and accurate, but will lose the curvature change feature points, and the compressed ship trajectory may cross the land. (2) Trajectory compression and segmentation based on network structure [5,6]. These algorithms are suitable for relatively stable trajectory data, but the ship trajectory data is variable, so the processing effect is not ideal. (3) Semantic-based trajectory compression processing [7,8]. Research in this area is mainly concentrated in the field of land transportation and pay attention to the "stay" information, while ignoring the characteristics of the ship's movement. Therefore, based on actual needs, this paper proposes an improved compression algorithm based on cumulative heading variation. The improved algorithm has a high compression ratio in the straight section of the inland river, and can better preserve the trajectory point of the ship at the inland river curve.
Improved Algorithm Based on Cumulative Course Variation
Douglas-Peukcer algorithm has some limitations on ship trajectory compression, such as the loss of steering feature points during ship steering and the trajectory passing through land after compression[10]. In view of the above problems caused by the traditional Douglas-Peucker algorithm mentioned, we propose a compression improvement algorithm based on cumulative course variation. The improved algorithm can better preserve the turning point of the ship's route at the curve.
By analyzing the route processed by the Douglas-Peucker compression algorithm, we find that the way points of the ship route in the straight segment are less. The route is in the deep water channel and is consistent with the actual situation, the compression effect is good as well.However, there is a phenomenon that the route intersects the boundary of the airworthy area at the corner, and in the actual navigation process, the way point of the ship's route at the curve should generally be taken more appropriately. Therefore, the improved algorithm of this paper is mainly to improve the route compression algorithm of the curved part of the channel.
Many scholars are researching the improvement of Douglas-Peucker compression algorithm. Xiao-hong Liu[11] proposed the Douglas-Peucker algorithm based on the yaw angle limitation according to the angle change of the adjacent point connection. The basic ideas are as follows:
(1) Using the angle measurement method, the feature points are taken out. The three adjacent points on the curve are sequentially taken in order, and the angle α of the line between adjacent points is calculated and compared with the threshold A. If α<A, the intermediate point is rounded off; otherwise, the intermediate point is recorded into the newly created feature point set P, the judgment of the last three points including the intermediate point is performed until the end point of the curve is judged.
(2) Using the feature point set P, the curve is divided into several segments, and each segment is separately compressed by the Douglas-Peucker algorithm to obtain the final compression result.
This method can reduce the angle of curvature by using the method of reducing the angle threshold, but the trajectory points of the initial route are more, the connection angle of the adjacent track points does not change much. If this is done, it will greatly reduce the compression ratio of the curve [10], so that the track points of the route are so many, far beyond the actual situation, and the compression effect is not achieved.
Although the heading changes of the adjacent two route segments may be small, as the number of route segments increases, the heading changes will gradually appear. Based on this, this paper proposes an improved Douglas-Peucker compression algorithm based on cumulative heading variation.
The basic idea of the improved algorithm is (see Figure 1): starting from the starting route segment and using the starting point as the base point, judging the heading change of the adjacent route segment. If the heading variation is greater than the set threshold, the two route segments will be The common point is set as the route feature point; If the course change amount is less than the set threshold value, the heading change amount of the next line segment and the starting line segment is determined until the heading change amount is greater than a set threshold. Then set the starting point of the current route segment as the route feature point, and set the point as the base point, repeat the above judgment until the route end point. Taking the route feature points as the boundary, the route is divided into several segments, and each segment is separately compressed by the Douglas-Peucker algorithm to obtain the final compression result.
Set P0,P1,…Pn be the initial waypoints of the initial route, Set L1,L2,…Ln-1 be the route segments,
Set α1,α2,…αn-1 be the headings of each route segment. The improvement steps can be divided into
five followings:
(2) Judging the relationship between Δα and the heading change threshold A, if |Δα|< A, α1 as the reference heading, α3 is the calculated heading, Δα=α3-α1;
L1
P0
L2
L3
L4 L5
L6 L7 α1 α2 α3 α4 α5 α6 α7 P1 P2
P3 P4 P5 P 6 P7 L1 P0 L2 L3
L4 L5
L6
L7 α1
α2 α3
α4 α5 α 6
α7
P1
P2
P3 P4 P5 P 6
P7
[image:3.595.81.526.100.189.2]a. initial route b. route processed by improved algorithm
Figure 1. Improved compression algorithm based on cumulative heading variation.
(1) If |Δα|≥ A, create a new route feature point set S, record P1 into S, and use P1 as the reference
point, α2 as the reference heading, and α3 as the calculation heading, Δα=α3-α2;
(2) Repeat steps (2) and (3) until the initial route end point is calculated, and the route feature point set S as obtained;
(3) Taking the point in the route feature point set S as the boundary, the initial route is divided into several segments, and each segment is compressed by the Douglas-Peucker algorithm.
The improved route compression flow chart is shown in Figure 2.
Calculating heading angle start Set the base point Initial route
There is the next point Y Calculating cumulative heading change Cumulative heading change Quantity > Threshold Y This feature is
characteristic Bounded by characteristic points Section the route Preceding execution D-P algorithm Read start point
Save the turning point database to get the final
route N Last stage execution D-P algorithm N End Route turning point data base Splitting point data base characteristic points data base
[image:3.595.189.407.298.706.2]Calculation of Heading Angle
[image:4.595.208.390.140.307.2]Since the heading of the adjacent turning point is unknown, the main content of this section is the calculation of the heading angle. The earth is considered to be a sphere. The heading can be solved by a spherical triangle. The spherical triangle diagram is shown in Figure 3.
Figure 3. Spherical triangle.
In Figure 3, point C is the North Pole. Point A( A, A)and point B( B, B)are two adjacent
turning points, where CBA, a 90 -B and b 90 -A. Four-part formula of spherical triangle is as follow: cot sina bcotAsinCcosCcosb. That is
cotAcot sin csca b CcotCcosb.
Comparison of Compression Algorithms
In order to verify the effectiveness of the algorithm, the AIS data of ships in Nantong section of the Yangtze River on May 1, 2018 are selected as test data. Figure 4 is a comparison between the Douglas-Peucker algorithm and the improved algorithm based on course variation. From the graph, it can be seen that the route compressed by Douglas-Peucker algorithm is not smooth at the bend of the river, and the turning is abrupt. A sudden steering at a large angle in a river bend may put the ship in danger. Therefore, Douglas-Peucker algorithm can not meet the demand of route compression in inland waterway. The compression algorithm based on the cumulative change of course can retain more turning points in the bend, and will not make the ship in danger caused by sudden change of navigation state. Therefore, compared with the original Douglas-Peucker algorithm, the route compression algorithm based on cumulative heading variation has better compression effect. The compressed route can better retain the turning condition of the initial route, which not only reduces the difficulty of ship handling, but also reduces the risk of ships.
a. initial route b. processed by D-P algorithm c. processed by improved D-P algorithm
[image:4.595.120.477.611.761.2]Figure 5 shows the relationship between cumulative heading change and threshold. In this paper, the right turn is positive and the left turn is negative, and the 30 degree is chosen as the cumulative heading change threshold.
Figure 5. Relationship diagram of the cumulative course change and threshold.
The final ship trajectory is displayed on the electronic channel chart platform as shown in the dotted line in Figure 6 (a). The solid line in the figure is the Deepwater Channel of the current channel navigation system. It can be seen from the local magnification effect diagram (b) that the ship trajectories compressed by this method are mostly in the deep water channel, which is consistent with the actual navigation situation of the ship and meets the requirements of the trajectory compression.
a. Compression effect chart
[image:5.595.135.462.397.752.2]Summary
The experimental results show that the improved compression algorithm based on cumulative heading variation can make up for the lack of trajectory compression of the traditional Douglas-Peucker algorithm at the curve, which greatly reduces the distortion of the trajectory of the ship at the inland curve. The compressed trajectory conforms to the actual situation of the ship and the method is simple and easy to use.
Acknowledgement
This research was financially supported by the National Science Foundation of China (61772102), the Fundamental Research Funds for the Central Universities(3132016322).
References
[1] Sheng Kai, Liu Zhong, Zhou Dechao, e.t. Segmental compression algorithm of ship trajectories based on motion mode[J]. Journal of naval university of engineering, 2018, 30(06):50-57.
[2] Gao Miao, Shi Guoyou, Li Weifeng. Online compression algorithm of AIS trajectory data based on improved sliding window. Journal of Traffic and Transportation Engineering, vol. 18, no. 3, pp. 218-227, June 1, 2018.
[3] Zhao Liangbin, Shi Guoyou. A method for simplifying ship trajectory based on improved Douglas-Peucker algorithm. Ocean Engineering, vo1. 66, pp. 37-46, 15 October 2018.
[4] Li Ming, Hu Qinyou, Meng Liang. Research on ship motion track compression technology based on AIS[J]. Marine Technology, 2010(01):11-13.
[5] Song Renchu, Sun Weiwei, Zheng Baihua, e.t. A novel framework of trajectory compression in road networks. Proceedings of the VLDB Endowment, vol. 7, no. 9, pp. 661-672, 2014.
[6] Wu Peili, Tan Yu'an, Zheng Jun, e.t. A hybrid compression framework for large scale trajectory data in road networks. Chinese Journal of Electronics, vol. 24, no. 4, pp. 730-739, October 10, 2015.
[7] Spaccapietra Stefano, Parent Christine, Damiani Maria Luisa, e.t. A conceptual view on trajectories. Data and Knowledge Engineering, vol. 65, no. 1, pp. 126-146, April 2008.
[8] Zheni Donia, Frihida Ali, Claramunt Christophe, e.t. A semantic-based data model for the manipulation of trajectories:Application to urban transportation. Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), vol. 9080, pp. 124-142, 2015.
[9] Liu Dunwei. The vessels route mining based on AIS date[D]. Dalian Maritime University, 2017.
[10] Zhang Shukai, Liu Zhengjiang, Zhang Xianku, e.t. A method for AIS track data compression based on Douglas-Peucker algorithm[J]. Journal of Harbin Engineering University, 2015, 36(05):595-599.