<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_polyline(features):
 """Encode and iterable of features as a polyline """

    points = list(read_points(features))
    latlon_points = [(x[1], x[0]) for x in points]
    return polyline.encode(latlon_points)