本文整理汇总了C#中OSGeo.GDAL.Dataset.GetDriver方法的典型用法代码示例。如果您正苦于以下问题:C# Dataset.GetDriver方法的具体用法?C# Dataset.GetDriver怎么用?C# Dataset.GetDriver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSGeo.GDAL.Dataset
的用法示例。
在下文中一共展示了Dataset.GetDriver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GDAL_Info
public GDAL_Info(Dataset ds)
{
Projection = ds.GetProjectionRef();
Resolution = new Size(ds.RasterXSize, ds.RasterYSize);
Bands = new DataBandInfo[ds.RasterCount];
for (int i = 0; i < ds.RasterCount; i++)
{
Band band = ds.GetRasterBand(i + 1);
Bands[i] = new DataBandInfo();
int temp;
band.GetMaximum(out Bands[i].MaxValue, out temp);
band.GetMaximum(out Bands[i].MinValue, out temp);
band.GetNoDataValue(out Bands[i].NODATAValue, out temp);
ColorInterp clr = band.GetRasterColorInterpretation();
switch (clr)
{
case ColorInterp.GCI_RedBand:
Bands[i].Name = "RedBand";
Bands[i].Image = Resource1.red_layer;
BppType += "R";
break;
case ColorInterp.GCI_GreenBand:
Bands[i].Name = "GreenBand";
Bands[i].Image = Resource1.green_layer;
BppType += "G";
break;
case ColorInterp.GCI_BlueBand:
Bands[i].Name = "BlueBand";
Bands[i].Image = Resource1.blue_layer;
BppType += "B";
break;
default:
Bands[i].Name = clr.ToString();
Bands[i].Image = null;
BppType += "?";
break;
}
BppType += "[" + Gdal.GetDataTypeName(band.DataType) + "]";
Bpp += (ushort)Gdal.GetDataTypeSize(band.DataType);
if (i + 1 < ds.RasterCount)
BppType += ",";
}
BppType += " (" + Bpp + ")";
Driver = ds.GetDriver().LongName;
Metadata = ds.GetMetadata("");
ImgMetadata = ds.GetMetadata("IMAGE_STRUCTURE");
SubDSMetadata = ds.GetMetadata("SUBDATASETS");
GeoLocMetadata = ds.GetMetadata("GEOLOCATION");
GDALInfoGetPosition(ds, 0.0, 0.0, out UpperLeftX, out UpperLeftY);
GDALInfoGetPosition(ds, 0.0, ds.RasterYSize, out UpperRightX, out UpperRightY);
GDALInfoGetPosition(ds, ds.RasterXSize, 0.0, out LowerLeftX, out LowerLeftY);
GDALInfoGetPosition(ds, ds.RasterXSize, ds.RasterYSize, out LowerRightX, out LowerRightY);
GDALInfoGetPosition(ds, ds.RasterXSize / 2, ds.RasterYSize / 2, out CenterX, out CenterY);
}