def project_gdf(
    gdf: gpd.GeoDataFrame,
    *,
    to_crs: Any | None = None,  # noqa: ANN401
    to_latlong: bool = False,
) -> gpd.GeoDataFrame:
    """
    Project a GeoDataFrame from its current CRS to another.

    If `to_latlong` is True, this projects the GeoDataFrame to the coordinate
    reference system defined by `settings.default_crs`. Otherwise it projects
    it to the CRS defined by `to_crs`. If `to_crs` is `None`, it projects it
    to the CRS of an appropriate UTM zone given `gdf`'s bounds.

    Parameters
    ----------
    gdf
        The GeoDataFrame to be projected.
    to_crs
        If None, project to an appropriate UTM zone. Otherwise project to
        this CRS.
    to_latlong
        If True, project to `settings.default_crs` and ignore `to_crs`.

    Returns
    -------
    gdf_proj
        The projected GeoDataFrame.
    """
    if gdf.crs is None or len(gdf) == 0:  # pragma: no cover
        msg = "`gdf` must have a valid CRS and cannot be empty."
        raise ValueError(msg)

    # if to_latlong is True, project the gdf to the default_crs
    if to_latlong:
        to_crs = settings.default_crs

    # else if to_crs is None, project gdf to an appropriate UTM zone
    elif to_crs is None:
        to_crs = gdf.estimate_utm_crs()

    # project the gdf
    gdf_proj = gdf.to_crs(to_crs)
    crs_desc = f"{gdf_proj.crs.to_string()} / {gdf_proj.crs.name}"

    msg = f"Projected GeoDataFrame to {crs_desc!r}"
    utils.log(msg, level=lg.INFO)
    return gdf_proj

    Project a GeoDataFrame from its current CRS to another.

    If `to_latlong` is True, this projects the GeoDataFrame to the coordinate
    reference system defined by `settings.default_crs`. Otherwise it projects
    it to the CRS defined by `to_crs`. If `to_crs` is `None`, it projects it
    to the CRS of an appropriate UTM zone given `gdf`'s bounds.

    Parameters
    ----------
    gdf
        The GeoDataFrame to be projected.
    to_crs
        If None, project to an appropriate UTM zone. Otherwise project to
        this CRS.
    to_latlong
        If True, project to `settings.default_crs` and ignore `to_crs`.

    Returns
    -------
    gdf_proj
        The projected GeoDataFrame.
    
osmnx/projection.py