Skip to content

Commit d945c8b

Browse files
committed
maproject.c: restrict a compatibility hack to PROJ < 6.2
1 parent b0c3a29 commit d945c8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mapproject.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -825,18 +825,22 @@ int msProcessProjection(projectionObj *p)
825825

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

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

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

0 commit comments

Comments
 (0)