管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-25 b6b0cb226fcf184525ee7b36af3a09471e9c0057
src/main/java/com/lf/server/helper/GdalHelper.java
@@ -30,10 +30,6 @@
    private final static Log log = LogFactory.getLog(GdalHelper.class);
    public static void init(String gdalPath) {
        // 注册所有的驱动
        gdal.AllRegister();
        ogr.RegisterAll();
        // 支持中文路径
        gdal.SetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
        // 属性表支持中文:CP936
@@ -45,7 +41,7 @@
        if (!StringHelper.isEmpty(gdalPath)) {
            gdal.SetConfigOption("GDAL_DATA", gdalPath + File.separator + "gdal-data");
            gdal.SetConfigOption("PROJ_LIB", gdalPath + File.separator + "proj7" + File.separator + "share");
            System.setProperty("PROJ_LIB", gdalPath + File.separator + "proj7" + File.separator + "share");
            //System.setProperty("PROJ_LIB", gdalPath + File.separator + "proj7" + File.separator + "share")
            gdal.SetConfigOption("GDAL_DRIVER_PATH", gdalPath + File.separator + "gdalplugins");
            String path = System.getenv("PATH");
@@ -53,6 +49,10 @@
                System.setProperty("PATH", path + ";" + gdalPath);
            }
        }
        // 注册所有的驱动
        gdal.AllRegister();
        ogr.RegisterAll();
    }
    /**