def METHOD_NAME(
    traffic: "Traffic",
    nb_samples: Optional[int],
    features: List[str],
    projection: Union[None, "crs.Projection", pyproj.Proj] = None,
    max_workers: int = 1,
) -> Numeric:
    if "last_position" in traffic.data.columns:
        traffic = traffic.drop(columns="last_position")
    resampled = traffic
    if nb_samples is not None:
        _resampled = traffic.resample(nb_samples).eval(max_workers=max_workers)
        # TODO LazyTraffic/LazyOptionalTraffic
        assert _resampled is not None
        resampled = _resampled
    if all(
        [
            "x" in features,
            "y" in features,
            "x" not in resampled.data.columns,
            "y" not in resampled.data.columns,
        ]
    ):
        if projection is None:
            raise RuntimeError(
                "No 'x' and 'y' columns nor projection method passed"
            )
        resampled = resampled.compute_xy(projection)
    return np.stack(list(f.data[features].values.ravel() for f in resampled))