@@ -4081,25 +4081,37 @@ QMap<int, QVariant> QgsWmsProvider::identify( const QgsPoint & thePoint, Identif
40814081
40824082 int gmlPart = -1 ;
40834083 int xsdPart = -1 ;
4084- if ( mIdentifyResultBodies .size () == 1 )
4084+ for ( int i = 0 ; i < mIdentifyResultHeaders .size (); i++ )
40854085 {
4086- QgsDebugMsg ( " Simple GML" );
4087- gmlPart = 0 ;
4088- }
4089- else if ( mIdentifyResultBodies .size () == 2 ) // GML+XSD
4090- {
4091- QgsDebugMsg ( " Multipart with 2 parts - expected GML + XSD" );
4092- // How to find which part is GML and which XSD? Both have
4093- // Content-Type: application/binary
4094- // different are Content-Disposition but it is not reliable.
4095- // We could analyze beginning of bodies...
4096- gmlPart = 0 ;
4097- xsdPart = 1 ;
4086+ if ( xsdPart == -1 && mIdentifyResultHeaders [i].value ( " Content-Disposition" ).contains ( " .xsd" ) )
4087+ {
4088+ xsdPart = i;
4089+ }
4090+ else if ( gmlPart == -1 && mIdentifyResultHeaders [i].value ( " Content-Disposition" ).contains ( " .dat" ) )
4091+ {
4092+ gmlPart = i;
4093+ }
4094+
4095+ if ( gmlPart != -1 && xsdPart != -1 )
4096+ break ;
40984097 }
4099- else
4098+
4099+ if ( xsdPart == -1 && gmlPart == -1 )
41004100 {
4101- QgsDebugMsg ( QString ( " %1 parts in multipart response not supported" ).arg ( mIdentifyResultBodies .size () ) );
4102- continue ;
4101+ if ( mIdentifyResultBodies .size () == 1 ) // GML
4102+ {
4103+ gmlPart = 0 ;
4104+ }
4105+ if ( mIdentifyResultBodies .size () == 2 ) // GML+XSD
4106+ {
4107+ QgsDebugMsg ( " Multipart with 2 parts - expected GML + XSD" );
4108+ // How to find which part is GML and which XSD? Both have
4109+ // Content-Type: application/binary
4110+ // different are Content-Disposition but it is not reliable.
4111+ // We could analyze beginning of bodies...
4112+ gmlPart = 0 ;
4113+ xsdPart = 1 ;
4114+ }
41034115 }
41044116
41054117 QgsDebugMsg ( " GML (first 2000 bytes):\n " + QString::fromUtf8 ( mIdentifyResultBodies .value ( gmlPart ).left ( 2000 ) ) );
0 commit comments