| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | public String downloadShp(UserEntity ue, List<MarkJsonEntity> list) throws Exception { |
| | | String parent = pathHelper.getTempPath(); |
| | | String path = pathHelper.getTempPath(); |
| | | createShapeFiles(ue, list, path); |
| | | |
| | | String path = createShapeFiles(ue, list, parent); |
| | | File[] files = new File(path).listFiles(); |
| | | if (files == null || files.length == 0) { |
| | | return null; |
| | | } |
| | | |
| | | String zip = getZipPath(); |
| | | ZipHelper.zip(zip, parent); |
| | | FileHelper.deleteDir(parent); |
| | | ZipHelper.zip(zip, path); |
| | | FileHelper.deleteDir(path); |
| | | |
| | | String guid = FileHelper.getFileMd5(zip); |
| | | DownloadEntity entity = downloadService.selectByGuid(guid); |
| | |
| | | /** |
| | | * 创建shp文件 |
| | | */ |
| | | private String createShapeFiles(UserEntity ue, List<MarkJsonEntity> list, String parent) { |
| | | String path = getShpDir(ue, parent); |
| | | |
| | | private String createShapeFiles(UserEntity ue, List<MarkJsonEntity> list, String path) { |
| | | List<MarkJsonEntity> points = getMarkByType(list, "POINT"); |
| | | if (points.size() > 0) { |
| | | ShpHelper.createShp(points, path, "POINT"); |