0

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:

enter image description here

How can I get this layer in QGIS?

Vince
20.5k16 gold badges49 silver badges65 bronze badges
asked Jun 29, 2022 at 9:12

1 Answer 1

3

There is a referer parameter in the Create a New WMS/WMTS Connection dialog.

preview

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:

ru

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.

answered Jun 29, 2022 at 9:35
4
  • 2
    I think simply checking the ignore GetMap ... URL in capabilities box should fix that Commented 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. Commented Jun 29, 2022 at 10:38
  • @IanTurton - didn't know about that flag. updated my answer. Commented Jun 29, 2022 at 12:11
  • @KliverMax - guess that is a different issue. Commented Jun 29, 2022 at 12:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.