simplify 2D polyline of arrays