- 积分
- 38
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-7-12
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
一样的数据,maskout图形出来的结果就没有边缘的锯齿。请问怎么解决边缘锯齿,像maskout图形出来的结果一样?因为我要导出kml数据,在地图上面显示。
maskout数据
maskout图形
maskout数据导出KML,叠加地图效果
- MapLayer countryLayer = MapDataManage.loadLayer("F:/MeteoInfo_Java_1.3.3R3_Files/MeteoInfo/map/bou2_4p.shp");
- PolygonBreak lb = (PolygonBreak)countryLayer.getLegendScheme().getLegendBreaks().get(0);
- lb.setDrawFill(false);
- //lb.setOutlineColor(Color.blue);
- mapFrame.addLayer(countryLayer);
-
- MapLayer chinaLayer = MapDataManage.loadLayer("F:/MeteoInfo_Java_1.3.3R3_Files/MeteoInfo/map/china.shp");
- //chinaLayer.setMaskout(true);
- lb = (PolygonBreak) chinaLayer.getLegendScheme().getLegendBreaks().get(0);
- lb.setDrawFill(false);
- lb.setOutlineColor(Color.blue);
- mapFrame.addLayer(chinaLayer);
-
- //MapLayer bouLayer = MapDataManage.loadLayer("F:/MeteoInfo_Java_1.3.3R3_Files/MeteoInfo/map/bou1_4l.shp");
- // PolylineBreak lineBreak = (PolylineBreak) bouLayer.getLegendScheme().getLegendBreaks().get(0);
- //lineBreak.setColor(Color.cyan);
- // lineBreak.setSize(2);
- // mapFrame.addLayer(bouLayer);
- //Open GrADS data file
- String dataDir = "F:/MeteoInfo_Java_1.3.3R3_Files/MeteoInfo/";
- String fileName = dataDir + "sample/LonLatStation/AERONET_Stations2.csv";
- aDataInfo.openLonLatData(fileName);
- StationData _stationData = aDataInfo.getStationData("Elevation");
- Extent aExtent = _stationData.dataExtent;
-
- aExtent.minX = 73.6786;
- aExtent.maxX = 134.71864;
- aExtent.minY =17.96961;
- aExtent.maxY =53.945184;
-
- //Interpolate
- GridDataSetting aGDP = new GridDataSetting();
- aGDP.xNum = 90;
- aGDP.yNum = 180;
- aGDP.dataExtent=aExtent;
-
- InterpolationSetting gridInterp = new InterpolationSetting();
- gridInterp.setGridDataSetting(aGDP);
- gridInterp.setInterpolationMethod(InterpolationMethods.IDW_Radius);
- gridInterp.setRadius(20);
- GridData gridData = _stationData.interpolateData(gridInterp);
- ColorMap cmap=new ColorMap();
- Color[] cls={new Color(104,203,0),new Color(0,160,255),new Color(0,200,200),new Color(0,220,0),new Color(160,230,50),new Color(230,220,50)
- ,new Color(230,175,45),new Color(240,130,40),new Color(250,60,60),new Color(240,0,130)
- };
- cmap.setColors(cls);
- List<Number> lst=new ArrayList<Number>();
- lst.add(300);
- lst.add(600);
- lst.add(900);
- lst.add(1200);
- lst.add(1500);
- lst.add(1800);
- lst.add(2100);
- lst.add(2400);
- lst.add(2700);
- <font color="#ff0000"><b> GridData t= gridData.maskout((VectorLayer) chinaLayer);//这里maskout数据,</b></font>
- LegendScheme aLS = LegendManage.createLegendScheme(t.getMinValue(), t.getMaxValue(), lst, cmap);
- //Create a shaded layer
- VectorLayer layer = DrawMeteoData.createShadedLayer(t, aLS, "Shaded_PS", "PS", false);
-
- layer.setMaskout(true);
- layer.saveAsKMLFile("D:/56735.kml");
复制代码
|
|