def build_tile_url(
    image_path: str, rgb: bool = False, url_root: str = "/", is_product: bool = False
) -> str:
    """Build a Tile URL for the given image path.

    Args:
        image_path: the path to the image to be processed
        rgb (optional): if the path should be to the DEM RGB version of tiles

    Returns:
        The URL for the specified tile set.

    """
    prefix = ""
    if is_product:
        prefix = "products/"
    return (
        f"{url_root}{prefix}{'rgb' if rgb else 'tile'}/{image_path}/"
        + r"{z}/{x}/{y}.png"
    )