def from_gca_linestring(gca_obj):
    """
    Converts LineString GCA to an EGF string.

    Returns
    -------
    egf_str : str
        LineString GCA as an EGF string

    """

    if gca_obj.geometry_type != "LS":
        raise ValueError(f"Expected geometry type to be 'LS' and got '{gca_obj.geometry_type}' instead")

    features = gca_obj.features

    egf_str = ""

    egf_str += str(gca_obj.geometry_type)
    egf_str += "\n" * 4
    egf_str += ', '.join(str(i) for i in gca_obj.headers)

    for ft in features:
        egf_str += "\n" * 4
        egf_str += ', '.join(str(i) for i in ft[0])

        for coord_set in ft[1]:
            lng, lat, elev = coord_set[:3]
            egf_str += "\n"
            egf_str += ', '.join(str(coord) for coord in [lat, lng, elev])

    egf_str += "\n"

    return egf_str