We present an algorithm for polyline (and polygon) similarity testing that is based on the double-cross formalism. To determine the degree of similarity between two polylines, the algorithm first computes their generalized polygons, that consist of almost equally long line segments and that approximate the length of the given polylines within an -error margin. Next, the algorithm determines the double-cross matrices of the generalized polylines and the difference between these matrices is used as a measure of dissimilarity between the given polylines. We prove termination of our algorithm and show that its sequential time complexity is bounded by O " (max(N1,N2) )2 " , where N1 and N2 are the number of vertices of the given polylines. We apply our method to query-by-sketch, indexing of polyline databases, and classification of terrain features and show experimental results for each of these applications. Categories and Subject Descriptors H.2.1 [Database Management]: Logica...