[Qgis-developer] Adding The Selection of Image Type To WMS Setup?

Jürgen E. Fischer jef at norbit.de
Sat Apr 13 00:36:21 PDT 2013

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

More information about the Qgis-developer mailing list