- 积分
- 410
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-11-18
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
大家好,我在做二次开发时候 做了色斑图后 用该地区的掩膜图层(直接用arcmap工具 处理出来的该地区的面图层) 但是淹膜不起作用
代码如下:
StationData stationData = openinfo.GetStationData("值"); ;
//GridDataPara aGDP = new GridDataPara();
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 = 2;
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;
// S = ContourDraw.FilterDiscreteData_Radius(S, gridInterp.Radius,
// gridInterp.GridDataParaV.dataExtent, stationData.UNDEF);
S = ContourDraw.FilterDiscreteData_Radius(S, gridInterp.Radius,
gridInterp.GridDataSet.DataExtent, stationData.MissingValue);
GridData gridData = ContourDraw.InterpolateDiscreteData_Radius(S,
X, Y, gridInterp.MinPointNum, gridInterp.Radius, stationData.MissingValue);
LegendScheme aLS2 = new LegendScheme(ShapeTypes.Polygon);
aLS2.ImportFromXMLFile(Application.StartupPath + @"\lgs\" + lgs);
//Create layer
VectorLayer aLayer2 = new VectorLayer(ShapeTypes.Polygon);
aLayer2 = DrawMeteoData.CreateShadedLayer(gridData, aLS2, shpname, shpfieldnme);
aLayer2.IsMaskout = true;
//Add layer
layersLegend1.ActiveMapFrame.AddLayer(aLayer2);
layersLegend1.ActiveMapFrame.MoveLayer(aLayer2.Handle, 1);
layersLegend1.Refresh();
//图例
LayoutLegend aLegend;
if (mapLayout1.GetLegends().Count > 0)
aLegend = mapLayout1.GetLegends()[1];
else
aLegend = mapLayout1.AddLegend(550, 250);
aLegend.LegendStyle = LegendStyles.Normal;
aLegend.LegendLayer = aLayer2;
if (tabControl2.SelectedIndex == 5)
mapLayout1.PaintGraphics();
//设置掩模
//设置掩膜
layersLegend1.ActiveMapFrame.MapView.MaskOut.SetMaskLayer = true;
layersLegend1.ActiveMapFrame.MapView.MaskOut.MaskLayer = Application.StartupPath + @"\map\dazhoumask.shp";
layersLegend1.ActiveMapFrame.MapView.PaintLayers();
layersLegend1.Refresh();
|
-
|