java调用 tippecanoe 对geojson进行pbf(mvt)切片

项目场景:

参考 https://github.com/mapbox/tippecanoe 进行下载安装和查看使用的参数说明
使用程序动态调用 tippecanoe 对geojson进行矢量切片,前端使用mapboxjs


问题描述

整体为了解决百兆geojson前端无法加载或加载卡顿的问题,添加的参数是为了解决 tippecanoe 会对geojson按照层级抽稀的问题,有抽稀需求可以参照官方文档调整参数值

			ProcessBuilder builder = new ProcessBuilder(
                    "tippecanoe", "-z14", "-l", "default", "--no-tile-compression",
                    "--no-feature-limit", "--no-tile-size-limit", "--simplification=1",
                    "--drop-rate=0", "--extend-zooms-if-still-dropping", "-f", "-e",
                    nginxPath + "aisFile/pbfFile/",
                    jsonFile.getAbsolutePath()
            );
            Process process = builder.start();

            // 处理标准输出
            BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
            String line;
            while ((line = reader.readLine()) != null) {
                log.info("生成矢量切片------返回结果: {}", line);
            }

            // 处理错误输出
            BufferedReader errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
            String errorLine;
            while ((errorLine = errorReader.readLine()) != null) {
                log.info("生成矢量切片 111------返回结果: {}", errorLine);
            }

            boolean exitCode = process.waitFor(Constants.twenty, TimeUnit.MINUTES);
            log.info("生成矢量切片------执行完任务断开连接");

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值