管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-01-14 d06e9c0007b4bcde6b397d62bf3ff3fbc0359065
1
已修改2个文件
11 ■■■■ 文件已修改
src/main/java/com/lf/server/config/InitConfig.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/helper/GdalHelper.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/config/InitConfig.java
@@ -21,6 +21,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
@@ -58,6 +59,9 @@
    @Autowired
    LocateService locateService;
    @Autowired
    Environment env;
    @Override
    public void run(ApplicationArguments args) {
        // noinspection AlibabaRemoveCommentedCode
@@ -85,7 +89,7 @@
            //boolean f4 = Zip4jHelper.unzip("D:\\LF\\data\\zip\\resources.zip", "D:\\LF\\data\\zip\\res", "12345");
            // 初始化
            GdalHelper.init();
            GdalHelper.init(env.getProperty("sys.gdal_driver_path"));
            pathHelper.init();
            argsService.initSettingData();
src/main/java/com/lf/server/helper/GdalHelper.java
@@ -28,7 +28,7 @@
public class GdalHelper {
    private final static Log log = LogFactory.getLog(GdalHelper.class);
    public static void init() {
    public static void init(String driverPath) {
        // 注册所有的驱动
        gdal.AllRegister();
@@ -38,6 +38,9 @@
        // 配置GDAL_DATA路径(gdal根目录下的bin\gdal-data)
        // gdal.SetConfigOption("GDAL_DATA", "E:\\terrait\\TianJin\\Zip\\release-1928-x64-dev\\release-1928-x64\\bin\\gdal-data");
        // gdal.SetConfigOption("PROJ_LIB", "E:\\terrait\\TianJin\\Zip\\release-1928-x64-dev\\release-1928-x64\\bin\\proj7\\share");
        if (null != driverPath) {
            gdal.SetConfigOption("GDAL_DRIVER_PATH", driverPath);
        }
        // 为了使属性表字段支持中文,请添加下面这句:CP936
        gdal.SetConfigOption("SHAPE_ENCODING", "");