Changeset 14767

Show
Ignore:
Timestamp:
06/25/08 10:12:03 (5 months ago)
Author:
ilucena
Message:

Fix #2444 (lat/long) and #2442 (uppercase file extension)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/frmts/idrisi/IdrisiDataset.cpp

    r13973 r14767  
    5858#define extSMP          "smp" 
    5959#define extREF          "ref" 
     60#define extRSTu         "RST" 
     61#define extRDCu         "RDC" 
     62#define extSMPu         "SMP" 
     63#define extREFu         "REF" 
    6064 
    6165//----- field names on rdc file: 
     
    117121#define rstMETER        "m" 
    118122#define rstLATLONG      "latlong" 
     123#define rstLATLONG2     "lat/long" 
    119124#define rstPLANE        "plane" 
    120125#define rstUTM          "utm-%d%c" 
     
    440445    if( ! FileExists( pszLDocFilename ) ) 
    441446    { 
    442         return NULL; 
     447        pszLDocFilename = CPLResetExtension( poOpenInfo->pszFilename, extRDCu ); 
     448 
     449        if( ! FileExists( pszLDocFilename ) ) 
     450        { 
     451            return NULL; 
     452        } 
    443453    } 
    444454 
     
    10811091    const char *pszAssociated; 
    10821092         
     1093    // -------------------------------------------------------------------- 
     1094    //      Symbol table file 
     1095    // -------------------------------------------------------------------- 
     1096 
    10831097    pszAssociated = CPLResetExtension( pszFilename, extSMP ); 
    10841098 
     
    10871101        papszFileList = CSLAddString( papszFileList, pszAssociated ); 
    10881102    } 
     1103    else 
     1104    { 
     1105        pszAssociated = CPLResetExtension( pszFilename, extSMPu ); 
     1106 
     1107        if( FileExists( pszAssociated ) ) 
     1108        { 
     1109            papszFileList = CSLAddString( papszFileList, pszAssociated ); 
     1110        } 
     1111    } 
     1112 
     1113    // -------------------------------------------------------------------- 
     1114    //      Documentation file 
     1115    // -------------------------------------------------------------------- 
    10891116 
    10901117    pszAssociated = CPLResetExtension( pszFilename, extRDC ); 
     
    10941121        papszFileList = CSLAddString( papszFileList, pszAssociated ); 
    10951122    } 
     1123    else 
     1124    { 
     1125        pszAssociated = CPLResetExtension( pszFilename, extRDCu ); 
     1126 
     1127        if( FileExists( pszAssociated ) ) 
     1128        { 
     1129            papszFileList = CSLAddString( papszFileList, pszAssociated ); 
     1130        } 
     1131    } 
     1132 
     1133    // -------------------------------------------------------------------- 
     1134    //      Reference file 
     1135    // -------------------------------------------------------------------- 
    10961136 
    10971137    pszAssociated = CPLResetExtension( pszFilename, extREF ); 
     
    11001140    { 
    11011141        papszFileList = CSLAddString( papszFileList, pszAssociated ); 
     1142    } 
     1143    else 
     1144    { 
     1145        pszAssociated = CPLResetExtension( pszFilename, extREFu ); 
     1146 
     1147        if( FileExists( pszAssociated ) ) 
     1148        { 
     1149            papszFileList = CSLAddString( papszFileList, pszAssociated ); 
     1150        } 
    11021151    } 
    11031152 
     
    20982147    // --------------------------------------------------------- 
    20992148 
    2100     if( EQUAL( pszRefSystem, rstLATLONG ) ) 
     2149    if( EQUAL( pszRefSystem, rstLATLONG  ) ||  
     2150        EQUAL( pszRefSystem, rstLATLONG2 ) ) 
    21012151    { 
    21022152        oSRS.SetWellKnownGeogCS( "WGS84" ); 
     
    21722222 
    21732223        const char *pszIdrisiDir = CPLGetConfigOption( "IDRISIDIR", NULL ); 
     2224 
    21742225        if( ( pszIdrisiDir ) != NULL ) 
    21752226        {