Skip to content
Permalink
Browse files
maproject.c: restrict a compatibility hack to PROJ < 6.2
  • Loading branch information
rouault committed Dec 19, 2019
1 parent b0c3a29 commit d945c8bd4dae21f3446294aff6ed100f642528a8
Showing 1 changed file with 5 additions and 1 deletion.
@@ -825,18 +825,22 @@ int msProcessProjection(projectionObj *p)

#if PROJ_VERSION_MAJOR >= 6
{
char szTemp[24];
char** args = (char**)msSmallMalloc(sizeof(char*) * (p->numargs+1));
memcpy(args, p->args, sizeof(char*) * p->numargs);

#if PROJ_VERSION_MAJOR == 6 && PROJ_VERSION_MINOR < 2
/* PROJ lookups are faster with EPSG in uppercase. Fixed in PROJ 6.2 */
/* Do that only for those versions, as it can create confusion if using */
/* a real old-style 'epsg' file... */
char szTemp[24];
if( p->numargs && strncmp(args[0], "init=epsg:", strlen("init=epsg:")) == 0 &&
strlen(args[0]) < 24)
{
strcpy(szTemp, "init=EPSG:");
strcat(szTemp, args[0] + strlen("init=epsg:"));
args[0] = szTemp;
}
#endif

args[p->numargs] = (char*) "type=crs";
if( !(p->proj = proj_create_argv(p->proj_ctx->proj_ctx, p->numargs + 1, args)) ) {

0 comments on commit d945c8b

Please sign in to comment.