| | |
| | | package com.lf.server.service.show; |
| | | |
| | | import com.lf.server.entity.ctrl.MarkJsonEntity; |
| | | import com.lf.server.entity.ctrl.ShpRecordEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.show.MarkEntity; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | List<MarkJsonEntity> points = getMarkByType(list, "POINT"); |
| | | if (points.size() > 0) { |
| | | String pointFile = GdalHelper.createShp(points, path, "POINT"); |
| | | String pointFile = ShpHelper.createShp(points, path, "POINT"); |
| | | } |
| | | List<MarkJsonEntity> lines = getMarkByType(list, "LINESTRING"); |
| | | if (lines.size() > 0) { |
| | | String lineFile = GdalHelper.createShp(lines, path, "LINESTRING"); |
| | | String lineFile = ShpHelper.createShp(lines, path, "LINESTRING"); |
| | | } |
| | | List<MarkJsonEntity> polygons = getMarkByType(list, "POLYGON"); |
| | | if (polygons.size() > 0) { |
| | | String polygonFile = GdalHelper.createShp(polygons, path, "POLYGON"); |
| | | String polygonFile = ShpHelper.createShp(polygons, path, "POLYGON"); |
| | | } |
| | | |
| | | return path; |
| | |
| | | } |
| | | |
| | | private String getZip() { |
| | | String path = pathHelper.getDownloadFullPath() + File.separator + WebHelper.getRandomInt(100000, 1000000) + ".zip"; |
| | | String path = pathHelper.getDownloadFullPath() + File.separator + StringHelper.YMDHMS2_FORMAT.format(new Date()) + ".zip"; |
| | | |
| | | File file = new File(path); |
| | | if (file.exists() && !file.isDirectory()) { |
| | |
| | | de.setDcount(0); |
| | | // de.setPwd(null) |
| | | de.setUrl(FileHelper.getRelativePath(file)); |
| | | de.setDescr("下载ShapeFile文件"); |
| | | de.setDescr("ShapeFile文件"); |
| | | de.setGuid(FileHelper.getFileMd5(file)); |
| | | de.setCreateUser(ue.getId()); |
| | | // de.setGeom(null) |
| | |
| | | return null; |
| | | } |
| | | |
| | | List<MarkJsonEntity> mjeList = GdalHelper.readShpForMarks(fileName); |
| | | List<MarkJsonEntity> mjeList = ShpHelper.readShpForMarks(fileName); |
| | | FileHelper.deleteFiles(list); |
| | | |
| | | return mjeList; |