Skip to content

Commit a8e9a24

Browse files
Apply CONFIG PROJ_LIB to GDAL/OGR PROJ settings
1 parent 0c4b66c commit a8e9a24

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mapproject.c

+10
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#include <sys/stat.h>
3737
#include "mapaxisorder.h"
3838

39+
#include "ogr_srs_api.h"
40+
3941
static char *ms_proj_lib = NULL;
4042
#if PROJ_VERSION_MAJOR >= 6
4143
static unsigned ms_proj_lib_change_counter = 0;
@@ -2399,6 +2401,14 @@ void msSetPROJ_LIB( const char *proj_lib, const char *pszRelToPath )
23992401
#endif
24002402
msReleaseLock( TLOCK_PROJ );
24012403

2404+
#if GDAL_VERSION_MAJOR >= 3
2405+
if( ms_proj_lib != NULL )
2406+
{
2407+
const char* const apszPaths[] = { ms_proj_lib, NULL };
2408+
OSRSetPROJSearchPaths(apszPaths);
2409+
}
2410+
#endif
2411+
24022412
if ( extended_path )
24032413
msFree( extended_path );
24042414
}

0 commit comments

Comments
 (0)