0

Has anyone managed to get QGIS to successfully load TMS tiles when the QGIS client is behind an HTTP proxy?

I host a number of TMS layers, and make them available to GIS users as well as to my own website. They layers are accessible in QGIS via the XML scripts on the following page:

http://mapspast.org.nz/gdal

These scripts load and the maps are displayed fine in QGIS when the client has direct access to the internet (just open them as raster layers in QGIS and they work). However, when the QGIS client is behind a firewall I have not managed to get the HTTP GET requests to go via the proxy.

What I have tried:
QGIS network settings: ignored - GET requests go direct to target
GDAL_HTTP_PROXY environment variable: ignored - GET requests go direct to target

I should state that the clients are running on windows PCs and so I may be setting the environment variable in the wrong place (I set it as a windows environment variable)

Has anyone got this to work?

  • So you've set QGIS proxy (Settings->Options->Network)? – BradHards Jul 31 '16 at 10:05
  • Yes. The proxy settings in the qgis network settings tab have no effect on GDAL_WMS GETs. They do change other qgis traffic (eg plugin downloads) but not the GDAL driver traffic. – madpom Jul 31 '16 at 18:49
  • Have you tried to set plain HTTP_PROXY environment variable before launching QGIS? – user30184 Aug 7 '16 at 13:06
1

To answer my own question:

The environment variable needs to be set from within QGIS, not externally in Windows nor from the command prompt prior to launching QGIS. Proxy operation works ok by setting the following in QGIS:

  • Navigate to Settings -> Options -> System and scroll to the Environment section
  • Click on Add
  • Specify the variable name: GDAL_HTTP_PROXY
  • Enter the value as the proxy address in the format ###.###.###.###:PORT
  • Click OK
  • Restart QGIS

GDAL TMS layers (and presumably any other GDAL layers using HTTP/HTTPs transport) will now be loaded via the proxy specified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.