管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-04-25 c0bdfd481aaa7f5f88187992244954adf96ae0eb
1
已修改1个文件
16 ■■■■■ 文件已修改
src/main/java/com/lf/server/service/show/InquiryService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/show/InquiryService.java
@@ -91,7 +91,7 @@
     * 瓦片路径是否存在
     */
    private boolean isTilePathExist(PublishEntity pub) {
        String tilePath = pathHelper.getConfig().getTilePath().replace("2d\\tiles", "") + File.separator + pub.getPath();
        String tilePath = pathHelper.getConfig().getTilePath().replace("2d\\tiles", "") + pub.getPath();
        File f = new File(tilePath);
        if (!f.exists() || !f.isDirectory()) {
@@ -109,7 +109,10 @@
    private List<File> findTiles(DownloadTileEntity dt, PublishEntity pub) {
        List<File> list = new ArrayList<>();
        for (int i = 0; i < StaticData.I23; i++) {
            findTilesByZoom(dt, pub, i, list);
            List<File> files = findTilesByZoom(dt, pub, i);
            if (files.size() > 0) {
                list.addAll(files);
            }
        }
        return list;
@@ -118,10 +121,11 @@
    /**
     * 根据层次查找瓦片
     */
    private void findTilesByZoom(DownloadTileEntity dt, PublishEntity pub, int zoom, List<File> list) {
    private List<File> findTilesByZoom(DownloadTileEntity dt, PublishEntity pub, int zoom) {
        List<File> list = new ArrayList<>();
        File f = new File(pub.getPath() + File.separator + zoom);
        if (!f.exists() || !f.isDirectory()) {
            return;
            return list;
        }
        int[] leftTop = deg2num(zoom, dt.getXmin(), dt.getYmax());
@@ -129,7 +133,7 @@
        for (int x = leftTop[0]; x <= rightBottom[0]; x++) {
            for (int y = leftTop[1]; y <= rightBottom[1]; y++) {
                String pngPath = String.format("%s\\%d\\%d.png", pub.getPath(), x, y);
                String pngPath = String.format("%s\\%d\\%d\\%d.png", pub.getPath(), zoom, x, y);
                File pngFile = new File(pngPath);
                if (pngFile.exists()) {
@@ -137,6 +141,8 @@
                }
            }
        }
        return list;
    }
    /**