How to set the GDAL_DATA environment variable to point to the directory containing EPSG csv files?

后端 未结 5 648
故里飘歌
故里飘歌 2021-02-03 22:14

I want to wrap(re-project) one variable in this netcdf file.

D:\\ gdalwarp -t_srs EPSG:4326 NETCDF:"C:\\fie.nc":var "C:\\Desktop\\SM.img"
         


        
5条回答
  •  广开言路
    2021-02-03 23:18

    You can also use for making programmatically(with C# API). Sample code:

    string path = @"C:\abc\";
    _SetValueNewVariable("GDAL_DATA", path + "\\data");
    _SetValueNewVariable("GEOTIFF_CSV", path + "\\data");
    _SetValueNewVariable("GDAL_DRIVER_PATH", path + "\\gdalplugins");
    
    private static void _SetValueNewVariable(string sVar, string sValue)
    {
        if (System.Environment.GetEnvironmentVariable(sVar) == null)
           System.Environment.SetEnvironmentVariable(sVar, sValue);
    }
    

提交回复
热议问题