'Validate a linestring.'

def _validate_linestring(self, value, top_level=True):

    if (not isinstance(value, (list, tuple))):
        return 'LineStrings    must    contain    list    of    coordinate    pairs'
    try:
        value[0][0]
    except (TypeError, IndexError):
        return 'Invalid    LineString    must    contain    at    least    one    valid    point'
    errors = []
    for val in value:
        error = self._validate_point(val)
        if (error and (error not in errors)):
            errors.append(error)
    if errors:
        if top_level:
            return ('Invalid    LineString:\n%s' % ',    '.join(errors))
        else:
            return ('%s' % ',    '.join(errors))
