无法获得带有光栅的单波段tiff图像的颜色图

问题描述

我想使用FAA here提供的航空图的TIFF文件

python模块Rasterio似乎是适合我的正确工具,并且我已经阅读了一些教程和参考文档。它们都为我工作,但不适用于我要使用的数据。我似乎无法使其正确显示颜色。

主要区别似乎是我的数据是单个波段(由dataset.count报告),而所有教程都有三个或更多波段。

例如,以下代码显示图表:

       protected void Page_Load(object sender,EventArgs e)
    {
        ProductList.Add("Milk");
        ProductList.Add("Food");
        ProductList.Add("Cooked");
        ProductList.Add("Beef");

        foreach (string product in ProductList)
        {
            Button button = new Button();
            button.ID = this.ProductList[i].ToString();
            button.Text = this.ProductList[i].ToString();
            //button.Attributes["src"] = "trash.png";
            place.Controls.Add(button);
            i++;
        }

    }

    

生成的图的颜色全部错误

Screen shot of image produced by above code

但是它应该像这样:

Screen shot of image shown with macOS Finder

我确定我缺少一些基本知识,但找不到。有人可以指出吗?

谢谢!

解决方法

我已将其发布在Stack Exchange上可能属于的位置。那里有更多信息。抱歉,要发布交叉内容。