Similarity search over time series and trajectory data