Data derived from the Automatic Identification System (AIS) plays a key role in water traffic data mining. However, there are various errors regarding time and space. To improve availability, AIS data quality dimensions are presented for detecting errors of AIS tracks including physical integrity, spatial logical integrity and time accuracy. After systematic summary and analysis, algorithms for error pre-processing are proposed. Track comparison maps and traffic density maps for different types of ships are derived to verify applicability based on the AIS data from the Chinese Zhoushan Islands from January to February 2015. The results indicate that the algorithms can effectively improve the quality of AIS trajectories.