Opened 7 years ago

Closed 7 years ago

#5841 closed defect (invalid)

Case sensitive comparisons with "epsg"

Reported by: rolandhill Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: 1.11.0
Severity: normal Keywords:
Cc:

Description

Hi,

I have recently been struggling with setting the projection of newly created ERS file. While there was another issue involved (another bug report), I think that a case sensitive comparison with "epsg" was also causing problems. "EPSG" in WKT strings is always upper case that I have seen, so EQUAL("epsg") doesn't match. eg, in ecwcreatcopy.cpp

    if( oSRS.IsProjected() )
    {
        const char *pszAuthName = oSRS.GetAuthorityName( "PROJCS" );

        if( pszAuthName != NULL && EQUAL(pszAuthName,"epsg") )
        {
            nEPSGCode = atoi(oSRS.GetAuthorityCode( "PROJCS" ));
        }
    }

there are many cases throughout GDAL where there are comparisons with upper case "PROJCS", "GEOCS" etc then "epsg". It looks to be a global search and replace issue.

Just do a case sensitive search for "epsg" (including quotes) to pick them up.

I have replaced all "epsg" with "EPSG" (except JSON driver - not tested) and it appears to be working OK now. This was before I found another problem, so can't be certain it was causing an issue.

Using 1.11.0

Regards,

Roland

Change History (2)

comment:1 Changed 7 years ago by Even Rouault

EQUAL() in GDAL is case-insensitive, so EQUAL(pszAuthName, "epsg") or EQUAL(pszAuthName, "EPSG") are equivalent. This ticket, as such, seems invalid. There might be a problem with epsg somewhere, but not in the snippet you quote

comment:2 Changed 7 years ago by rolandhill

Resolution: invalid
Status: newclosed

Thanks for clearing that up rouault. I'll mark it as invalid. Roland

Note: See TracTickets for help on using tickets.