管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-19 5a6e173298a10b22285b67044fa29ab96e22ef22
1
已修改2个文件
19 ■■■■ 文件已修改
src/main/java/com/lf/server/controller/data/WmtsController.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/wmts/说明.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/WmtsController.java
@@ -101,11 +101,11 @@
            ServletServerHttpResponse ssRes = new ServletServerHttpResponse(res);
            // æ£€æŸ¥ç¼“存是否过期
            if (checkIfNotModify(ssReq, ssRes)) {
                // è®¾ç½®ç¼“存头
                setBrowerCache(ssRes);
                return;
            }
//            if (checkIfNotModify(ssReq, ssRes)) {
//                // è®¾ç½®ç¼“存头
//                setBrowerCache(ssRes);
//                return;
//            }
            // è®¾ç½®è¿”回图片类型
            res.setContentType("image/png");
@@ -116,27 +116,28 @@
            // å®šä¹‰è¾“入流,通过输入流读取文件内容
            FileInputStream fileInputStream;
            // y = (1 << z) - y - 1
            y = (int) Math.pow(2, z) - y - 1;
            String path = config.getTilePath() + File.separator + layer + File.separator + z + File.separator + x + File.separator + y + ".png";
            File file = new File(path);
            if (!file.exists() || file.isDirectory()) {
                ClassPathResource resource = new ClassPathResource("wmts/nofound.png");
                fileInputStream = new FileInputStream(resource.getFile());
            } else {
                System.out.println(path);
                fileInputStream = new FileInputStream(file);
            }
            int len = 0;
            byte[] bytes = new byte[1024];
            while ((len = fileInputStream.read(bytes)) != -1) {
                // é€šè¿‡è¾“入流读取文件数据,然后通过上述的输出流写回浏览器
                outputStream.write(bytes, 0, len);
                outputStream.flush();
            }
            // å…³é—­èµ„源
            outputStream.close();
            fileInputStream.close();
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
src/main/resources/wmts/˵Ã÷.txt
@@ -7,7 +7,7 @@
QGIS:安装 HCMGIS æ’件。
QGIS:安装 HCMGIS å’Œ OSM æ’件。
-----------------------------------------------------------------------------------------------
http://103.85.165.99:8050/LFData/2d/tiles/img/{z}/{x}/{y}.png