@@ -433,6 +433,7 @@ OSRImportFromWkt(a1, a2) = acare(ccall((:OSRImportFromWkt, libgdal), Cint, (pVoi
433433OSRImportFromProj4 (a1, a2) = acare (ccall ((:OSRImportFromProj4 , libgdal), Cint, (pVoid, Cstring), a1, a2))
434434OSRImportFromEPSG (a1, a2) = acare (ccall ((:OSRImportFromEPSG , libgdal), Cint, (pVoid, Cint), a1, a2))
435435OSRNewSpatialReference (a1) = acare (ccall ((:OSRNewSpatialReference , libgdal), pVoid, (Cstring,), a1))
436+ OSRSetPROJSearchPaths (a1) = acare (ccall ((:OSRSetPROJSearchPaths , libgdal), Cvoid, (Ptr{Cstring},), a1))
436437
437438function OSRSetAxisMappingStrategy (hSRS, strategy)
438439 # (Gdal.GDALVERSION[] < v"3.0.0") && return # This breakes precompile if called from one PrecompileTools call
@@ -2680,6 +2681,14 @@ end
26802681 CPLSetConfigOption (" GDAL_HTTP_UNSAFESSL" , " YES" )
26812682 isdir (GDAL_DATA_DIR) && CPLSetConfigOption (" GDAL_DATA" , GDAL_DATA_DIR)
26822683 # CPLSetConfigOption("GDAL_NUM_THREADS", "ALL_CPUS")
2684+
2685+ # set PROJ_LIB location, this overrides setting the environment variable
2686+ if (isJLL)
2687+ PROJ_LIB = Ref {String} (joinpath (GMT. PROJ_jll. artifact_dir, " share" , " proj" ))
2688+ OSRSetPROJSearchPaths ([PROJ_LIB[]])
2689+ # else
2690+ # PROJ_LIB = Ref{String}(dirname(GMT.libproj) * "/../share/proj") # Fails for me because GMTdir is symlink of bin only
2691+ end
26832692 end
26842693
26852694"""
0 commit comments