
public boolean dzjyfbPicture(Map<String, Object> map)
throws UnknownHostException, IOException {
try {
// 参数初始化
String sType = (String)map.get("sType");
String dzjyfb_date = (String)map.get("dzjyfb_date");
String dzjyfb_year = (String)map.get("dzjyfb_year");
String pictureName = "0".equals(sType)?dzjyfb_date:dzjyfb_year;//图片名称以日期命名
String path = ConstantVO.shapeFilePath;
String name = ConstantVO.shapeFileName;
String bbox = ConstantVO.exportPictureBbox;
int width = ConstantVO.exportPictureWidth;
int height = ConstantVO.exportPictureHeight;
String pngFile = ConstantVO.exportPictureBasepath + "/"+pictureName+".png";
// 如果图片已存在,直接返回
if(new File(pngFile).exists())return true;
// 初始化arcgis许可
initArcGISLicense();
// 数据库查询测站和降雨量信息
Map<String, Double> dyp = findJylData(map);
// 根据查询的测站和降雨量信息更新shap文件
updateShapeFile(path, name, dyp);
// 利用gp工具,将shap文件转为降雨量分布的栅格文件
createRaster();
// 将栅格文件加入地图
com.esri.arcgis.carto.Map esriMap = addRasterToMap();
// 将地图导出为png图片
exportMapToImg((IActiveView) esriMap, bbox, pngFile, height, width);
System.out.println(pngFile);
// 释放地图(important)
Cleaner.release(esriMap);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}