[Qgis-developer] PROBLEM SOLVED - QGIS Misses GetCapabilites Version - RE: Adding The Selection of Image Type To WMS Setup?

Bruce, Bob (CON) Bob.Bruce at gov.mb.ca
Wed Apr 17 13:45:04 PDT 2013

	After consulting Cubewerx yesterday, I realized that we weren't seeing the image types because QGIS wasn't reading the default version of the Cubewerx GetCapabilites document.

The Cubewerx default OGC version is 1.3.2 which has request section headers like: 
<Operation name="GetCapabilities">
<Operation name="GetMap">
<Operation name="GetFeatureInfo">

Version 1.3.0 of the OGC GetCapabilites document has request section headers:

I managed to force QGIS to read the GetCapabilities document by adding the string &version=1.3.0 to the end of my URL. Once I did this then I saw four image types appear as options:
I did not see an option for the encoding image/x-jpegorpng that Cubewerx is offering.

So I have two questions:
1) will QGIS soon accommodate a OGC GetCapabilites format version 1.3.2 document?
2) will it be possible to have the image type of jpegorpng allowed to be used?

Having 2) accommodated will allow the server to decide if a PNG file is needed in areas where part of the image is transparent and send JPEG images where no transparency is required. The PNG images are roughly 8X larger than the JPEG images so accommodating this image type would reduce network traffic significantly.

	Bob Bruce

-----Original Message-----
From: qgis-developer-bounces at lists.osgeo.org [mailto:qgis-developer-bounces at lists.osgeo.org] On Behalf Of Bruce, Bob (CON)
Sent: April-14-13 7:37 AM
To: qgis-developer at lists.osgeo.org
Subject: Re: [Qgis-developer] Adding The Selection of Image Type To WMS Setup?

        Thanks for getting back to me on this. I cannot seem to find where I can select the image type when I connect to my WMS server. Could you please help me to locate this feature?

My WMS server is:

My GetCapabilities request returns image formats of:

<Format>image/png; PhotometricInterpretation="PaletteColor"</Format>
<Format>image/png; PhotometricInterpretation="RGB"</Format>
<Format>image/png; PhotometricInterpretation="BlackIsZero"</Format>
<Format>image/tiff</Format><Format>image/tiff; PhotometricInterpretation="PaletteColor"</Format>
<Format>image/tiff; PhotometricInterpretation="RGB"</Format>
<Format>image/tiff; PhotometricInterpretation="BlackIsZero"</Format>
<Format>application/x-cubewerx-wkb; version="3"</Format>
<Format>application/x-cubewerx-wkb; version="3"; PhotometricInterpretation="PaletteColor"</Format>
<Format>application/x-cubewerx-wkb; version="3"; PhotometricInterpretation="RGB"</Format>
<Format>application/x-cubewerx-wkb; version="3"; PhotometricInterpretation="BlackIsZero"</Format>
<Format>application/vnd.google-earth.kml+bxml; bxmlVersion="0.0.8"</Format>

but I don't see how to select these.

As for the user-agent string, we are not seeing anything on the server in the HTTP header to let us know that it is coming from QGIS, however that would not be important to us to know if we could select the image type when we add the WMS layer.

       Bob Bruce

----- Original Message -----
From: "Jürgen E. Fischer" <jef at norbit.de>
To: qgis-developer at lists.osgeo.org
Sent: Saturday, April 13, 2013 2:36:21 AM
Subject: Re: [Qgis-developer] Adding The Selection of Image Type To WMS Setup?

Hi Bob,

On Fri, 12. Apr 2013 at 18:25:32 -0500, Bruce, Bob (CON) wrote:
> Would it be possible to get QGIS modified to allow the selection of the image
> format type (i.e. PNG, JPEG, or others) in the setup of a WMS connection?

No, because it's already there.  If a WMS server offers multiple formats you
can select the one you want in the wms selection dialog.

> Cubewerx provides an image type of "image/x-jpegorpng" where it decides if it
> needs to send PNG images if we are doing a draw that includes some
> transparent areas, otherwise it sends JPEG images. This image type is stated
> in the GetCapabilities response along with the other image types that are
> supported and if we had the opportunity to select this image type in QGIS
> then we could get much smaller images most of the time.

Supporting that image type shouldn't be a problem.  Everything the server
supplies is passed to QImage and that transparently figures out what format it
is - the format selection is only used to form the request.

> We have also discovered that ArcGIS identifies itself through a user-agent
> string in the header of the request (HTTP method), it sends the following
> user-agent string: "ArcGIS Client Using WinInet" and Cubewerx has adapted
> their server to automatically handle the image types that are provided to
> ArcGIS. Unfortunately we see no such user-agent string provided by QGIS so we
> are not able to have the server adapted to QGIS image requests. Other clients
> may need PNG files so we can't have the server force the adaptation of images
> for every client so it would be helpful to have QGIS provide a user-agent
> string if we couldn't get the selection of image type for WMS requests.

Hm, sounds like two new features.  Can you rephrase it as a bug? ;)

We could have QgsNetworkManager set a different or a configurable User-Agent
string.  That way almost all requests should have it - should be easy, but I'm
not sure if that's a good thing for everything - as we also use that in the
form widget and there at least a different user agent string might hurt.

The question is how many different agents, we need - per provider?  per server?


Jürgen E. Fischer         norBIT GmbH               Tel. +49-4931-918175-31
Dipl.-Inf. (FH)           Rheinstraße 13            Fax. +49-4931-918175-50
Software Engineer         D-26506 Norden               http://www.norbit.de
committ(ed|ing) to Quantum GIS                         IRC: jef on FreeNode

norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
Rheinstrasse 13, 26506 Norden
GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502

Qgis-developer mailing list
Qgis-developer at lists.osgeo.org
Qgis-developer mailing list
Qgis-developer at lists.osgeo.org

More information about the Qgis-developer mailing list