def location_dict(lat=None, lon=None, height=None):
    """
    Create a location dict from the single values

    Args:
        lat, lon, height (float, optional) : the position

    Returns:
        dict : the location dict

    Raises:
        ValueError : if not enough values are specified
    """
    if lat is not None and lon is not None:
        if height is not None:
            return {'lat': lat, 'lng': lon, 'height': height}
        else:
            return {'lat': lat, 'lng': lon}
    else:
        raise ValueError("At least 'lat' and 'lon' need to be defined")
