| | |
| | | String tempPath = pathHelper.getTempPath() + File.separator, guid = StringHelper.getGuid(); |
| | | String fileList = tempPath + guid + ".txt"; |
| | | FileWriter fw = new FileWriter(fileList); |
| | | for (MetaEntity meta : metas) { |
| | | fw.write((basePath + meta.getPath()).toCharArray()); |
| | | for (int i = 0, c = metas.size(); i < c; i++) { |
| | | String str = (i > 0 ? "\r\n" : "") + basePath + metas.get(i).getPath(); |
| | | fw.write(str.toCharArray()); |
| | | } |
| | | fw.close(); |
| | | |
| | |
| | | } |
| | | |
| | | for (PublishEntity pub : pubs) { |
| | | AnalysisResultEntity entity = new AnalysisResultEntity(); |
| | | entity.setLayerName(pub.getName()); |
| | | try { |
| | | AnalysisResultEntity entity = new AnalysisResultEntity(); |
| | | entity.setLayerName(pub.getName()); |
| | | |
| | | List<MetaEntity> metas = publishService.selectMetasByPubid(pub.getId()); |
| | | if (null == metas || metas.isEmpty()) { |
| | | setError(entity, "找不到发布数据"); |
| | | continue; |
| | | List<MetaEntity> metas = publishService.selectMetasByPubid(pub.getId()); |
| | | if (null == metas || metas.isEmpty()) { |
| | | setError(entity, "找不到发布数据"); |
| | | continue; |
| | | } |
| | | |
| | | String filePath = getFilePath(metas); |
| | | File file = new File(filePath); |
| | | if (!file.exists() || file.isDirectory()) { |
| | | setError(entity, "源数据不存在"); |
| | | continue; |
| | | } |
| | | |
| | | openRaster(entity, filePath, geo, size); |
| | | rs.add(entity); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | |
| | | String filePath = pathHelper.getConfig().getUploadPath() + File.separator + metas.get(0).getPath(); |
| | | File file = new File(filePath); |
| | | if (!file.exists() || file.isDirectory()) { |
| | | setError(entity, "源数据不存在"); |
| | | continue; |
| | | } |
| | | |
| | | openRaster(entity, filePath, geo, size); |
| | | rs.add(entity); |
| | | } |
| | | |
| | | return rs; |
| | | } |
| | | |