| | |
| | | package com.lf.server.service.show; |
| | | |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.MarkJsonEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | |
| | | * |
| | | * @param ue 用户实体 |
| | | * @param list 标绘JSON实体类集合 |
| | | * @param req 请求 |
| | | * @param res 响应 |
| | | * @return GUID |
| | | * @throws Exception 异常 |
| | | */ |
| | | public String downloadShp(UserEntity ue, List<MarkJsonEntity> list, HttpServletRequest req, HttpServletResponse res) throws Exception { |
| | | public String downloadShp(UserEntity ue, List<MarkJsonEntity> list) throws Exception { |
| | | String parent = pathHelper.getTempPath(); |
| | | |
| | | String path = createShapeFiles(ue, list, parent); |
| | |
| | | * 获取shp目录 |
| | | */ |
| | | private String getShpDir(UserEntity ue, String parent) { |
| | | String path = parent + File.separator + WebHelper.getRandomInt(100000, 1000000); |
| | | String path = parent + File.separator + StringHelper.YMDHMS2_FORMAT.format(new Date()); |
| | | |
| | | File file = new File(path); |
| | | if (!file.exists() && !file.isDirectory()) { |
| | |
| | | if (StringHelper.isEmpty(mark.getWkt())) { |
| | | continue; |
| | | } |
| | | if (mark.getWkt().indexOf(type) > -1) { |
| | | if (mark.getWkt().contains(type)) { |
| | | rs.add(mark); |
| | | } |
| | | } |
| | |
| | | public List<MarkJsonEntity> readShpForMarks(List<MetaFileEntity> list) { |
| | | String fileName = null; |
| | | for (MetaFileEntity mf : list) { |
| | | if (mf.getName().toLowerCase().contains(".shp")) { |
| | | if (mf.getName().toLowerCase().contains(StaticData.SHP)) { |
| | | fileName = mf.getPath(); |
| | | break; |
| | | } |