<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi James,<br>
    <br>
    As the server didn't provide information about levels, some help
    needed to calculate this values. Also the all layers switched off,
    so we need to tell which layers should be shown.<br>
    I create such xml file based on information from here:
<a class="moz-txt-link-freetext" href="https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=true">https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=true</a><br>
    <br>
     <GDAL_WMS><br>
        <Service name="AGS"><br>
           
<ServerUrl><a class="moz-txt-link-freetext" href="https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer">https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer</a></ServerUrl><br>
            <ImageFormat>png</ImageFormat><br>
            <Layers>show:1,2,3</Layers><br>
            <BBoxOrder>xyXY</BBoxOrder><br>
            <SRS>3857</SRS><br>
        </Service><br>
        <DataWindow><br>
            <UpperLeftX>-1821098.1612395868</UpperLeftX><br>
            <UpperLeftY>9441422.428028269</UpperLeftY><br>
            <LowerRightX>1157719.0542395862</LowerRightX><br>
            <LowerRightY>6462605.212549096</LowerRightY><br>
            <SizeX>1024</SizeX><br>
            <SizeY>1024</SizeY><br>
        </DataWindow><br>
    </GDAL_WMS><br>
    <br>
    $ gdal_translate -of PNG ~/tmp/ags.xml ~/tmp/ags_test.png --config
    CPL_DEBUG ON<br>
    GDAL: GDALOpen(/home/bishop/tmp/ags.xml, this=0x15138c0) succeeds as
    WMS.<br>
    Input file size is 512, 512<br>
    AGS: URL =
<a class="moz-txt-link-freetext" href="https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer/export?f=image&bbox=-1821098.16123959,6462605.21254910,1157719.05423959,9441422.42802827&size=512,512&dpi=&imageSR=3857&bboxSR=3857&format=png&layerdefs=&layers=show:1,2,3&transparent=false&time=&layerTimeOptions=&dynamicLayers=">https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer/export?f=image&bbox=-1821098.16123959,6462605.21254910,1157719.05423959,9441422.42802827&size=512,512&dpi=&imageSR=3857&bboxSR=3857&format=png&layerdefs=&layers=show:1,2,3&transparent=false&time=&layerTimeOptions=&dynamicLayers=</a><br>
    <br>
    HTTP: Requesting [1/1]
<a class="moz-txt-link-freetext" href="https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer/export?f=image&bbox=-1821098.16123959,6462605.21254910,1157719.05423959,9441422.42802827&size=512,512&dpi=&imageSR=3857&bboxSR=3857&format=png&layerdefs=&layers=show:1,2,3&transparent=false&time=&layerTimeOptions=&dynamicLayers=">https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer/export?f=image&bbox=-1821098.16123959,6462605.21254910,1157719.05423959,9441422.42802827&size=512,512&dpi=&imageSR=3857&bboxSR=3857&format=png&layerdefs=&layers=show:1,2,3&transparent=false&time=&layerTimeOptions=&dynamicLayers=</a><br>
    HTTP: Request [0]
    <a class="moz-txt-link-freetext" href="https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer/export?f=image&bbox=-1821098.16123959,6462605.21254910,1157719.05423959,9441422.42802827&size=512,512&dpi=&imageSR=3857&bboxSR=3857&format=png&layerdefs=&layers=show:1,2,3&transparent=false&time=&layerTimeOptions=&dynamicLayers=">https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer/export?f=image&bbox=-1821098.16123959,6462605.21254910,1157719.05423959,9441422.42802827&size=512,512&dpi=&imageSR=3857&bboxSR=3857&format=png&layerdefs=&layers=show:1,2,3&transparent=false&time=&layerTimeOptions=&dynamicLayers=</a>
    : status = 200, content type = image/png, error = (null)<br>
    GDAL: GDALOpen(/vsimem/wms/0x15dc720/wmsresult.dat, this=0x15c3d00)
    succeeds as PNG.<br>
    GDAL: GDALClose(/vsimem/wms/0x15dc720/wmsresult.dat, this=0x15c3d00)<br>
    0...10...20...30...40...50...60...70...80...90...100 - done.<br>
    GDAL: GDALClose(/home/bishop/tmp/ags_test.png, this=0x1599830)<br>
    GDAL: GDALClose(/home/bishop/tmp/ags.xml, this=0x15138c0)<br>
    <br>
    <br>
    <img src="cid:part1.03050104.08070309@gmail.com" alt=""><br>
    <br>
    Also I test this xml in QGIS - works fine.<br>
    <pre class="moz-signature" cols="72">Best regards,
    Dmitry</pre>
    <div class="moz-cite-prefix">07.07.2015 18:42, Passmore, James H.
      пишет:<br>
    </div>
    <blockquote
cite="mid:DBXPR06MB432D3FE2F78962D966878F9EB920@DBXPR06MB432.eurprd06.prod.outlook.com"
      type="cite">
      <pre wrap="">>From <a class="moz-txt-link-freetext" href="http://www.gdal.org/frmt_wms.html">http://www.gdal.org/frmt_wms.html</a>  I see you can access an ArcGIS REST API like:

gdalinfo <a class="moz-txt-link-rfc2396E" href="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty=true">"http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty=true"</a>

and

gdal_translate <a class="moz-txt-link-rfc2396E" href="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json">"http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json"</a> wms.xml -of WMS

These above examples work for me.

When I try on a BGS service it fails as below:

...:\>gdalinfo <a class="moz-txt-link-rfc2396E" href="https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=true">"https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=true"</a>
gdalinfo failed - unable to open '<a class="moz-txt-link-freetext" href="https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=">https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=</a>
true'.

And:

..:\>gdal_translate <a class="moz-txt-link-rfc2396E" href="https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=true">"https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=true"</a> bgs.xml -of WMS --debug ON
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_BAG.dll using GDALRegister_BAG.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_ECW_JP2ECW.dll using GDALRegister_ECW_JP2ECW.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_FITS.dll using GDALRegister_FITS.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_GMT.dll using GDALRegister_GMT.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_HDF4.dll using GDALRegister_HDF4.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_HDF4Image.dll using GDALRegister_HDF4Image.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_HDF5.dll using GDALRegister_HDF5.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_HDF5Image.dll using GDALRegister_HDF5Image.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_KEA.dll using GDALRegister_KEA.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_MG4Lidar.dll using GDALRegister_MG4Lidar.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_MrSID.dll using GDALRegister_MrSID.
GDAL: Auto register C:\apps\gisinternals\bin\gdaL\plugins\gdal_netCDF.dll using GDALRegister_netCDF.
HTTP: Fetch(<a class="moz-txt-link-freetext" href="https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=true">https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=true</a>)
WMS: Did not get levels
HTTP: Fetch(<a class="moz-txt-link-freetext" href="https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=true">https://map.bgs.ac.uk/arcgis/rest/services/UKSO/UKSO_BGS/MapServer?f=json&pretty=true</a>)
GDALOpen failed - 0

Is the reason that HTTPS is not supported here at all, or if not what might be wrong with the service/request/ configuration?

Thanks

James



________________________________
 This message (and any attachments) is for the recipient only. NERC is subject to the Freedom of Information Act 2000 and the contents of this email and any reply you make may be disclosed by NERC unless it is exempt from release under the Act. Any material supplied to NERC may be stored in an electronic records management system.
________________________________
_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a>


</pre>
    </blockquote>
    <br>
  </body>
</html>