arcgis出圖步驟(縮減版)


    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;
        }
    }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM