Changeset 11892
- Timestamp:
- 08/17/07 14:16:39 (1 year ago)
- Files:
-
- trunk/gdal/frmts/wcs/wcsdataset.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/frmts/wcs/wcsdataset.cpp
r11713 r11892 972 972 CPLXMLNode *psSF = CPLGetXMLNode( psCO, "supportedFormats" ); 973 973 CPLXMLNode *psNode; 974 char **papszFormatList = NULL; 974 975 CPLString osPreferredFormat; 976 int iFormat; 975 977 976 978 if( psSF == NULL ) … … 986 988 if( psNode->eType == CXT_Element 987 989 && EQUAL(psNode->pszValue,"formats") 990 && psNode->psChild != NULL 988 991 && psNode->psChild->eType == CXT_Text ) 989 992 { 990 if( strlen(osPreferredFormat) == 0 ) 991 osPreferredFormat = psNode->psChild->pszValue; 992 993 if( strstr(psNode->psChild->pszValue,"tiff") != NULL 994 || strstr(psNode->psChild->pszValue,"TIFF") != NULL 995 || strstr(psNode->psChild->pszValue,"Tiff") != NULL ) 993 // This check is looking for deprecated WCS 1.0 capabilities 994 // with multiple formats space delimited in a single <formats> 995 // element per GDAL ticket 1748 (done by MapServer 4.10 and 996 // earlier for instance). 997 if( papszFormatList == NULL 998 && psNode->psNext == NULL 999 && strstr(psNode->psChild->pszValue," ") != NULL 1000 && strstr(psNode->psChild->pszValue,";") == NULL ) 996 1001 { 997 osPreferredFormat = psNode->psChild->pszValue; 998 break; 1002 char **papszSubList = 1003 CSLTokenizeString( psNode->psChild->pszValue ); 1004 papszFormatList = CSLInsertStrings( papszFormatList, 1005 -1, papszSubList ); 1006 CSLDestroy( papszSubList ); 1007 } 1008 else 1009 { 1010 papszFormatList = CSLAddString( papszFormatList, 1011 psNode->psChild->pszValue); 999 1012 } 1000 1013 } 1001 1014 } 1015 1016 for( iFormat = 0; 1017 papszFormatList != NULL && papszFormatList[iFormat] != NULL; 1018 iFormat++ ) 1019 { 1020 if( strlen(osPreferredFormat) == 0 ) 1021 osPreferredFormat = papszFormatList[iFormat]; 1022 1023 if( strstr(papszFormatList[iFormat],"tiff") != NULL 1024 || strstr(papszFormatList[iFormat],"TIFF") != NULL 1025 || strstr(papszFormatList[iFormat],"Tiff") != NULL ) 1026 { 1027 osPreferredFormat = papszFormatList[iFormat]; 1028 break; 1029 } 1030 } 1031 1032 CSLDestroy( papszFormatList ); 1002 1033 1003 1034 if( strlen(osPreferredFormat) > 0 ) … … 1030 1061 /* "Band", with a set of ascending numerical values. */ 1031 1062 /* -------------------------------------------------------------------- */ 1063 osBandIdentifier = CPLGetXMLValue( psService, "BandIdentifier", "" ); 1032 1064 CPLXMLNode * psAD = CPLGetXMLNode( psService, 1033 1065 "CoverageOffering.rangeSet.RangeSet.axisDescription.AxisDescription" ); 1034 1066 CPLXMLNode *psValues; 1035 1067 1036 if( psAD != NULL 1068 if( strlen(osBandIdentifier) == 0 1069 && psAD != NULL 1037 1070 && EQUAL(CPLGetXMLValue(psAD,"name",""),"Band") 1038 1071 && ( (psValues = CPLGetXMLNode( psAD, "values" )) != NULL ) )
