4

I am trying to import WMS from geoserver link to QGIS 2.8.4 & the latest 2.12.1: http://geoportal.asig.gov.al/Services/host/host.ashx?url=http://localhost:8080/geoserver/asig/wms&

QGIS get the request and show the layers of the workspace, and also the get info. My problem is that the layer is not visible in the view.

It works fine with version 2.2:

enter image description here

  • have you checked the do not use URL from capabilities box? or does that URL appear in the getCapabilities file? – Ian Turton Feb 25 '16 at 13:07
  • yes i have tried , and its the same problem. – Klaudio Collaku Feb 25 '16 at 13:17
  • what happens when you pan around the map? Sometimes that helps my WMS/OpenLayers problems in QGIS. – til_b Feb 25 '16 at 13:33
  • No its doesn't show anything , i have tried and in udig and it works perfect – Klaudio Collaku Feb 25 '16 at 13:48
  • It appears it might be a bug. I agree I can load the service and QGIS seems to be firing off the correct requests in the background like (geoportal.asig.gov.al/Services/host/host.ashx?url=http://…) but I, like you, have a blank map. on Linux Mint with QGIS 2.12-3 – nmtoken Feb 25 '16 at 18:11
3

As far as I can tell this appears to be an error with QGIS stripping the host name off the url; so I get errors in the console like:

Map request failed [error:Protocol "" is unknown url:/Services/host/host.ashx?url=http://localhost:8080/geoserver/asig/ows&&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=345119.95276619656942785,4499106.68403259478509426,503972.04766661184839904,4603200.33713638130575418&CRS=EPSG:32634&WIDTH=640&HEIGHT=419&LAYERS=cz_division&STYLES=&FORMAT=image/png&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE&AspxAutoDetectCookieSupport=1]

I checked the value of the URL stored in the registry something like:

HKEY_CURRENT_USER\SOFTWARE\QGIS\QGIS2\Qgis\connections-wms\your-service-name

And that seems correct

I created a GDAL WMS mini driver (see http://www.gdal.org/frmt_wms.html for all the options) as below

<GDAL_WMS>
    <Service name="WMS">
        <ServerUrl>http://geoportal.asig.gov.al/Services/host/host.ashx?url=http://localhost:8080/geoserver/asig/wms</ServerUrl>
        <ImageFormat>image/png</ImageFormat>
        <Layers>cz_division</Layers>
        <BBoxOrder>xyXY</BBoxOrder>
        <SRS>EPSG:32634</SRS>
        <CRS>EPSG:32634</CRS>
        <Transparent>TRUE</Transparent>
    </Service>
    <DataWindow>
        <UpperLeftX>359060.34375</UpperLeftX>
        <UpperLeftY>4719675.5</UpperLeftY>
        <LowerRightX>505375.90625</LowerRightX>
        <LowerRightY>4387020.0</LowerRightY>
        <SizeX>1024</SizeX>
        <SizeY>1024</SizeY>
    </DataWindow>
    <UserAgent>GDAL WMS driver (http://www.gdal.org/frmt_wms.html)</UserAgent>
</GDAL_WMS>

Then I add this through the add raster layer tool, and I get the map.

So you can use one or more mini drivers to get the maps showing in QGIS, but really you should probably report the issue to QGIS to get a proper fix:

http://hub.qgis.org/projects/quantum-gis/issues

If you look at the layer properties > layer source of a WMS layer that works, for example :

contextualWMSLegend=0&crs=EPSG:4326&dpiMode=2&featureCount=10&format=image/png&layers=BMNG&styles=&url=http://mapsref.brgm.fr/wxs/1GG /monde1GG?

You can see that it chops the request up into several pieces including an url parameter. I think the QGIS issue with the ASIG service is that the ASIG service itself defines an URL parameter.

  • I saved this as .xml file and used gdal_translate -of JPEG in.xml out.jpg but with error. How did you use this driver ? – Artec Feb 28 '16 at 17:39
  • Save the file as an XML file, then in QGIS select 'Add Raster Layer' (for me the second icon down on the left hand side, or through Layer > Add Layer > Add Raster Layer) and browse to the XML file. That's it – nmtoken Feb 28 '16 at 18:04
  • I tried this to, but I've got an error "Raster layer: C:\...\Test.xml is not a supported raster data source" – Artec Feb 28 '16 at 22:23
  • Is the file valid, does it have the the closing </GDAL_WMS> tag? I see that the example file I pasted wasn't showing that tag (now corrected), so if you just did a copy/save on that original example there would have been some error. – nmtoken Feb 29 '16 at 8:52
  • I did as you wrote but still I have the same error: "Raster layer: C:\Users\...\Desktop\Test\Test.xml is not a supported raster data source". Only after changing file encoding to ANSI driver works fine. Thanks. – Artec Mar 6 '16 at 22:11

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.