def convert_to_x_and_y(pos, lon_min, lon_max, lat_min, lat_max, w, h):
    """Convert from a pos to its x/y coordinates in the image."""

    x = (pos["lon"] - lon_min) / (lon_max - lon_min) * w
    y = (lat_max - pos["lat"]) / (lat_max - lat_min) * h

    return (x, y)