- 积分
- 76
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-12-23
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我的程序是读nc文件,做风的图。照着您的关于MeteoInfo二次开发教程(六)里边的步骤做的。这是我的代码:
- private void TSIVector_Click(object sender, EventArgs e) { MeteoDataInfo aDataInfo = new MeteoDataInfo(); string file = Application.StartupPath + @"\WRF_Meteo_QD_2013070212UTC_180_1hr.nc"; aDataInfo.OpenNCData(file); GridData uData = aDataInfo.GetGridData("u10m"); GridData vData = aDataInfo.GetGridData("v10m"); LegendScheme aLS = LegendManage.CreateLegendSchemeFromGridData(vData,LegendType.GraduatedColor,MeteoInfoC.Shape.ShapeTypes.Point); VectorLayer aLayer = DrawMeteoData.CreateGridVectorLayer(uData, vData, vData, aLS, true, "Vector_T", true); mapView1.AddLayer(aLayer); mapView1.MoveLayer(aLayer, 2); layersLegend1.ActiveMapFrame.AddLayer(aLayer); layersLegend1.ActiveMapFrame.MoveLayer(aLayer.Handle, 2); LayoutGraphic aTitle = mapLayout1.GetTexts()[0]; aTitle.SetLabelText("MeteoInfo Class Library Demo - "); } private void TSIBarb_Click(object sender, EventArgs e) { MeteoDataInfo aDataInfo = new MeteoDataInfo(); string file = Application.StartupPath + @"\WRF_Meteo_QD_2013070212UTC_180_1hr.nc"; aDataInfo.OpenNCData(file); //aDataInfo.TimeIndex = 2; //aDataInfo.LevelIndex = 3; GridData uData = aDataInfo.GetGridData("u10m"); GridData vData = aDataInfo.GetGridData("v10m"); LegendScheme aLS = LegendManage.CreateSingleSymbolLegendScheme(MeteoInfoC.Shape.ShapeTypes.Point, Color.Blue, 10); VectorLayer aLayer = DrawMeteoData.CreateGridBarbLayer(uData, vData, uData, aLS, false, "Barb_F", true); mapView1.AddLayer(aLayer); layersLegend1.ActiveMapFrame.AddLayer(aLayer); layersLegend1.ActiveMapFrame.MoveLayer(aLayer.Handle, 2); layersLegend1.Refresh(); LayoutGraphic aTitle = mapLayout1.GetTexts()[0]; aTitle.SetLabelText("MeteoInfo Class Library Demo - Wind Barb Layer"); } private void TSIStreamLine_Click(object sender, EventArgs e) { MeteoDataInfo aDataInfo = new MeteoDataInfo(); string file = Application.StartupPath + @"\WRF_Meteo_QD_2013070212UTC_180_1hr.nc"; aDataInfo.OpenNCData(file); GridData uData = aDataInfo.GetGridData("u10m"); GridData vData = aDataInfo.GetGridData("v10m"); LegendScheme aLS = LegendManage.CreateSingleSymbolLegendScheme(MeteoInfoC.Shape.ShapeTypes.Polyline, Color.Blue, 1); VectorLayer aLayer = DrawMeteoData.CreateStreamlineLayer(uData, vData, 4, aLS, "StreamLine_F", true); mapView1.AddLayer(aLayer); layersLegend1.ActiveMapFrame.AddLayer(aLayer); layersLegend1.Refresh(); LayoutGraphic aTitle = mapLayout1.GetTexts()[0]; aTitle.SetLabelText("MeteoInfo Class Library Demo - Wind StreamLine Layer"); }
这是我的nc文件信息:
Dimensions: 3
latitude = 151;
longitude = 251;
times = 181;
Global Attributes: 0
Variations: 5
NC_FLOAT latitude(latitude);
latitude: units = "degrees_north";
latitude: long_name = "latitude";
NC_FLOAT longitude(longitude);
longitude: units = "degrees_east";
longitude: long_name = "longitude";
NC_FLOAT u10m(times,latitude,longitude);
u10m: units = "m/s";
u10m: _FillValue = 1E+30;
u10m: long_name = "U at 10m";
NC_FLOAT v10m(times,latitude,longitude);
v10m: units = "m/s";
v10m: _FillValue = 1E+30;
v10m: long_name = "V at 10m";
NC_FLOAT slp(times,latitude,longitude);
slp: units = "hPa";
slp: _FillValue = 1E+30;
slp: long_name = "Sea Level Pressure";
Unlimited dimension: -1
在做Vector图层时,关于“T”变量是否是时间?tData变量在创建LegendScheme和VectorLayer两个函数里边都用到了,由于对NetCDF文件格式只是初步了解,所以不太明白。
另外,做Barb和StreamLine图层时,由于nc文件数据过密,画出来的图也过密。如图:
这该如何解决?
期待您的解答
|
|