| | |
| | | import org.gdal.gdal.WarpOptions; |
| | | import org.gdal.gdal.gdal; |
| | | import org.gdal.gdalconst.gdalconst; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.client.RestTemplate; |
| | |
| | | if (!ShpHelper.createShp(path, layer)) { |
| | | throw new Exception(layer.getName() + ",创建ShapeFile文件失败!"); |
| | | } |
| | | // 管网集水点 |
| | | if (layer.getShpName().equals(config.getShpNames().get(0))) { |
| | | GeLayer juncLayer = new GeLayer(layer, filterLayerData(layer.getData())); |
| | | if (!ShpHelper.createShp(basePath + File.separator + config.getJunctionName(), juncLayer)) { |
| | | throw new Exception("集水点" + ",创建ShapeFile文件失败!"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private JSONArray filterLayerData(JSONArray data) { |
| | | JSONArray arr = new JSONArray(); |
| | | String[] strs = config.getJunctionFilter().split("="); |
| | | for (int i = 0, c = data.size(); i < c; i++) { |
| | | JSONObject obj = data.getJSONObject(i).getJSONObject("properties"); |
| | | if (strs[1].equals(obj.getStr(strs[0]))) { |
| | | arr.put(data.getJSONObject(i)); |
| | | } |
| | | } |
| | | |
| | | return arr; |
| | | } |
| | | |
| | | public void copeDem(String token, DataPo data) throws Exception { |
| | | GeDb fileDb = getFileDb(token); |
| | | String fileId = getFileId(token, fileDb.getDbid()); |