- 积分
- 410
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-11-18
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 sskkyy2008 于 2013-9-12 10:20 编辑
if(radioButton2.Checked==true)//等值线
{
StationData stationData = openinfo.GetStationData("值");
MeteoInfoC.Data.MeteoData.GridDataSetting aGDP = new GridDataSetting();
// aGDP.DataExtent
aGDP.DataExtent.minX = 100;
aGDP.DataExtent.maxX = 120;
aGDP.DataExtent.minY = 10;
aGDP.DataExtent.maxY = 40;
aGDP.XNum = 10;
aGDP.YNum = 10;
// MeteoInfoC.Data.MeteoData.InterpolationSetting ttt = new GRIBParameterTable();
MeteoInfoC.Data.MeteoData.InterpolationSetting gridInterp = new InterpolationSetting();
gridInterp.GridDataSet = aGDP;
// gridInterp.GridDataParaV = aGDP;
gridInterp.InterpolationMethod = MeteoInfoC.Data.MeteoData.InterpolationMethods.IDW_Radius;
// gridInterp.GridInterMethodV = GridInterMethod.Cressman;
gridInterp.Radius = 2;//搜索半径
gridInterp.MinPointNum = 1;
double[] X = new double[1];
double[] Y = new double[1];
// ContourDraw.CreateGridXY(gridInterp.GridDataParaV, ref X, ref Y);
ContourDraw.CreateGridXY(gridInterp.GridDataSet, ref X, ref Y);
double[,] S = stationData.Data;
GridData gridData = ContourDraw.InterpolateDiscreteData_Radius(S,
X, Y, gridInterp.MinPointNum, gridInterp.Radius, stationData.MissingValue);
LegendScheme aLS2 = new LegendScheme(ShapeTypes.Polyline);
// aLS2.ImportFromXMLFile(Application.StartupPath + @"\lgs\" + lgs);
bool hasUndefData = false;
LegendScheme aLS = LegendManage.CreateLegendSchemeFromGridData(gridData,
LegendType.UniqueValue, ShapeTypes.Polyline, ref hasUndefData);
VectorLayer aLayer = DrawMeteoData.CreateContourLayer(gridData, aLS2, shpname, shpfieldnme);
layersLegend1.ActiveMapFrame.AddLayer(aLayer);
layersLegend1.ActiveMapFrame.MoveLayer(aLayer.Handle, 2);
layersLegend1.Refresh();
//设置掩膜
layersLegend1.ActiveMapFrame.MapView.MaskOut.SetMaskLayer = true;
// layersLegend1.ActiveMapFrame.MapView.MaskOut.MaskLayer = Application.StartupPath + @"\map\dazhoumask.shp";
MapLayer maskLayer = MapDataManage.OpenLayer(Application.StartupPath + @"\map\" + masktu);
layersLegend1.ActiveMapFrame.MapView.MaskOut.MaskLayer = maskLayer.LayerName;
layersLegend1.ActiveMapFrame.AddLayer(maskLayer);
layersLegend1.ActiveMapFrame.MoveLayer(maskLayer, 1);
layersLegend1.ActiveMapFrame.MapView.PaintLayers();
layersLegend1.Refresh();
}
调试时出错地方 LegendScheme aLS = LegendManage.CreateLegendSchemeFromGridData(gridData,LegendType.UniqueValue, ShapeTypes.Polyline, ref hasUndefData);
绘制时报错 算数溢出错误
|
|