<div dir="ltr"><br><div style>Hi again,</div><div style><br></div><div style>I am still trying to come up to speed on WMS using GDAL 1.9.2 and am interested in some examples beyond what are</div><div style>posted at the bottom of <a href="http://www.gdal.org/frmt_wms.html">http://www.gdal.org/frmt_wms.html</a> .</div>
<div style><br></div><div style>I can run the various gdal_translate examples and some of them even work.  (All of them need to be adjusted since the XML file name printed in the examples actually has "frmt_wms_" prepended, by the way.)</div>
<div style><br></div><div style>However, I can't get anything BUT those few examples to work.  For example, the metacarta example says this:</div><div style><span style="color:rgb(0,0,0)"><br></span></div><div style><span style="color:rgb(0,0,0)">  gdal_translate -of PNG -outsize 500 250 metacarta_wmsc.xml metacarta_wmsc.png</span><br>
</div><div style><span style="color:rgb(0,0,0)"><br></span></div><div style><span style="color:rgb(0,0,0)">However, I would like to specify a smaller area than the entire world.  The provided XML file specifies the whole world:</span></div>
<div style><br></div><div style><div><GDAL_WMS></div><div>    <Service name="WMS"></div><div>        <Version>1</Version></div><div>        <ServerUrl><a href="http://labs.metacarta.com/wms-c/Basic.py">http://labs.metacarta.com/wms-c/Basic.py</a>?</ServerUrl></div>
<div>        <Layers>basic</Layers></div><div>    </Service></div><div>    <DataWindow></div><div>        <UpperLeftX>-180.0</UpperLeftX></div><div>        <UpperLeftY>90.0</UpperLeftY></div>
<div>        <LowerRightX>180.0</LowerRightX></div><div>        <LowerRightY>-90.0</LowerRightY></div><div>        <TileLevel>19</TileLevel></div><div>        <TileCountX>2</TileCountX></div>
<div>        <TileCountY>1</TileCountY></div><div>    </DataWindow></div><div>    <Projection>EPSG:4326</Projection></div><div>    <BlockSizeX>256</BlockSizeX></div><div>    <BlockSizeY>256</BlockSizeY></div>
<div>    <BandsCount>3</BandsCount></div><div></GDAL_WMS></div><div><br></div><div style>Merely changing the UpperLeft/LowerRight values in the DataWindow section does not work, and I think it's because the server only serves data at specific multiples of 180/256 = 0.703125 step sizes (or something like that).</div>
<div style><br></div><div style>For example, I tried to specify the window 24 to 25 degrees E and 60 to 61 degrees N which makes a request to the server like this:</div><div style><br></div><div style><a href="http://labs.metacarta.com/wms-c/Basic.py?service=WMS&request=GetMap&version=1&layers=basic&styles=&srs=EPSG:4326&format=image/jpeg&width=256&height=256&bbox=24,60,25,61">http://labs.metacarta.com/wms-c/Basic.py?service=WMS&request=GetMap&version=1&layers=basic&styles=&srs=EPSG:4326&format=image/jpeg&width=256&height=256&bbox=24,60,25,61</a><br>
</div><div style><br></div><div style>If I paste that URL into my browser, I get this reply:</div><div style><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><pre style="word-wrap:break-word;white-space:pre-wrap">
An error occurred: can't find resolution index for 0.003906. Available resolutions are: 
[0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125, 0.001373291015625, 0.0006866455078125, 0.00034332275390625, 0.000171661376953125, 8.58306884765625e-05, 4.291534423828125e-05, 2.1457672119140625e-05, 1.0728836059570312e-05, 5.3644180297851562e-06, 2.6822090148925781e-06, 1.3411045074462891e-06]</pre>
<pre style="word-wrap:break-word;white-space:pre-wrap"><span style="font-family:arial"> </span><br></pre><pre style="word-wrap:break-word;white-space:pre-wrap"><span style="font-family:arial">I have a feeling that I'm making this a lot harder than it should be.  Is there some bit of conditioning code somewhere that I'm overlooking?</span></pre>
<pre style="word-wrap:break-word;white-space:pre-wrap"><font face="arial">Can someone fashion an XML GDAL_WMS request that will retrieve a 1000 x 1000 image from the lat/lon range above?</font></pre><pre style="word-wrap:break-word;white-space:pre-wrap">
<font face="arial">Thank you very much for any enlightenment,</font></pre><pre style="word-wrap:break-word;white-space:pre-wrap"><font face="arial">carl</font></pre></pre></div></div></div>