I want to use some layer from WMS server that use HTTP Referer header
in QGIS (3.22.3-Białowieża).
Here is a original URL to wms server responce:
https://maps.roslesinforg.ru/proxy/service?&service=WMS&request=GetMap&layers=shape_forestries&styles=&format=image%2Fpng&transparent=true&version=1.1.1&width=256&height=256&srs=EPSG%3A3857&bbox=6261721.357121639,7827151.696402045,6574807.424977722,8140237.764258131
and Referer header
https://maps.roslesinforg.ru/
So i created a new WMS connection with parameters:
Server URL - https://maps.roslesinforg.ru/proxy/service
Referer - https://maps.roslesinforg.ru/
And this allows me to recive Capabilities. But if I add layer to the map I don't get any images.
I the same time I can get image if send request from postman
:
How can I get this layer in QGIS?
1 Answer 1
There is a referer
parameter in the Create a New WMS/WMTS Connection
dialog.
EDIT:
But it looks like the capabilities document returned points to a mapproxy and not to the endpoint you want to reach:
endpoint So using WMS in QGIS always queries the capabilities document first. This one is not the one you would like to use. You could download the XML
Capabilties and replace the wrong parts. Something like this. You would need to host it on some local webserver and point the url to it. Works fine for me:
EDIT2:
As mentioned by Ian Turton in the comments the easist way is to check the flag "Ignore GetMap/GetTile/GetLegendGraphic URI reported in capabilities"
. So no need for a custom XML.
-
2I think simply checking the
ignore GetMap ... URL in capabilities
box should fix thatIan Turton– Ian Turton2022年06月29日 10:08:08 +00:00Commented Jun 29, 2022 at 10:08 -
@bloigge I just checked Qgis log and found that layer's url replaced with mapproxy address. So i check option from Ian comment and i get my layer! But on low levels i get black tiles only. Looks strange because on maps.roslesinforg.ru webmap everything fine.Kliver Max– Kliver Max2022年06月29日 10:38:33 +00:00Commented Jun 29, 2022 at 10:38
-
@IanTurton - didn't know about that flag. updated my answer.Bernd Loigge– Bernd Loigge2022年06月29日 12:11:13 +00:00Commented Jun 29, 2022 at 12:11
-
@KliverMax - guess that is a different issue.Bernd Loigge– Bernd Loigge2022年06月29日 12:12:03 +00:00Commented Jun 29, 2022 at 12:12