<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-fareast-language:EN-US;}
span.EmailStyle23
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="PT" link="#0563C1" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Tanks again Momtchil. Your example works indeed … but not with my layer<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">curl <a href="http://svs.gsfc.nasa.gov/cgi-bin/wms?SERVICE=WMS&LAYERS=3140_21200&CRS=CRS:84&FORMAT=image/png&TRANSPARENT=FALSE&HEIGHT=512&BGCOLOR=&REQUEST=GetMap&WIDTH=2048&BBOX=-50.2,69.11,-49.6,69.26&STYLES=&VERSION=1.3.0">
http://svs.gsfc.nasa.gov/cgi-bin/wms?SERVICE=WMS&LAYERS=3140_21200&CRS=CRS:84&FORMAT=image/png&TRANSPARENT=FALSE&HEIGHT=512&BGCOLOR=&REQUEST=GetMap&WIDTH=2048&BBOX=-50.2,69.11,-49.6,69.26&STYLES=&VERSION=1.3.0</a> --output raw.png<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">the output is an html file saying<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>The document has moved <a href=<a href="https://svs.gsfc.nasa.gov/cgi-bin/wms?SERVICE=WMS&LAYERS=3140_21200&CRS=CRS:84&FORMAT=image/png&TRANSPARENT=FALSE&HEIGHT=512&BGCOLOR=&REQUEST=GetMap&WIDTH=2048&BBOX=-50.2,69.11,-49.6,69.26&STYLES=&VERSION=1.3.0">https://svs.gsfc.nasa.gov/cgi-bin/wms?SERVICE=WMS&LAYERS=3140_21200&CRS=CRS:84&FORMAT=image/png&TRANSPARENT=FALSE&HEIGHT=512&BGCOLOR=&REQUEST=GetMap&WIDTH=2048&BBOX=-50.2,69.11,-49.6,69.26&STYLES=&VERSION=1.3.0</a>>here</a>.</p><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"></body></html><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Anyway, the curl solution is of little interest for me because I don’t know how to programmatically select it instead of using gdal_translate.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US" style="mso-fareast-language:PT">From:</span></b><span lang="EN-US" style="mso-fareast-language:PT"> Momtchil Momtchev <momtchil@momtchev.com>
<br>
<b>Sent:</b> Wednesday, January 5, 2022 12:18 AM<br>
<b>To:</b> Joaquim Manuel Freire Luís <jluis@ualg.pt>; gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> Re: [gdal-dev] Experiences with the WMS driver<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><o:p> </o:p></p>
<p> You can get the raw image with curl (it is just a static image):<o:p></o:p></p>
<pre>$ curl <a href="https://svs.gsfc.nasa.gov/cgi-bin/wms?SERVICE=WMS&request=GetMap&version=1.3.0&layers=3170_21483_bg&styles=&format=image/png&bbox=-180,-90,180,90&crs=CRS:84&transparent=FALSE&width=922&height=461">"https://svs.gsfc.nasa.gov/cgi-bin/wms?SERVICE=WMS&request=GetMap&version=1.3.0&layers=3170_21483_bg&styles=&format=image/png&bbox=-180,-90,180,90&crs=CRS:84&transparent=FALSE&width=922&height=461"</a> --output raw.png<o:p></o:p></pre>
<p> Then use gdal_translate to georeference it:<o:p></o:p></p>
<pre>$ gdal_translate -a_srs CRS:84 -a_ullr -180 90 180 -90 raw.png out.png<o:p></o:p></pre>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 03/01/2022 21:15, Joaquim Manuel Freire Luís wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US">Thanks. That’s right that modifying the host name prints the same size info but there is nothing in the url that permits to estimate the “Pixel Size”.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Also, this not the main issue. The main one is when passing a valid “GetMap” string that works in a browser but errors in gdal_translate.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US" style="mso-fareast-language:PT">From:</span></b><span lang="EN-US" style="mso-fareast-language:PT"> Momtchil Momtchev
<a href="mailto:momtchil@momtchev.com"><momtchil@momtchev.com></a> <br>
<b>Sent:</b> Monday, January 3, 2022 3:08 PM<br>
<b>To:</b> <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>; Joaquim Manuel Freire Luís
<a href="mailto:jluis@ualg.pt"><jluis@ualg.pt></a><br>
<b>Subject:</b> Re: [gdal-dev] Experiences with the WMS driver</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p> <o:p></o:p></p>
<p> gdalinfo does not contact the remote server at all, it extracts all the information it displays from the URL.<o:p></o:p></p>
<p> Try replacing the hostname with something invalid, keeping all the parameters and you will still get the same output.<o:p></o:p></p>
<p> <o:p></o:p></p>
<p> <o:p></o:p></p>
<div>
<p class="MsoNormal">On 01/01/2022 19:47, Joaquim Manuel Freire Luís wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">But if I do</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal">gdalinfo "WMS:<a href="http://svs.gsfc.nasa.gov/cgi-bin/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=3170_21483_bg&CRS=CRS:84&BBOX=-180.0,-90.0,180.0,90.0&TRANSPARENT=FALSE">http://svs.gsfc.nasa.gov/cgi-bin/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=3170_21483_bg&CRS=CRS:84&BBOX=-180.0,-90.0,180.0,90.0&TRANSPARENT=FALSE</a>"<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">it seems to work but note the reported sizes and unreasonable resolution.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Data axis to CRS axis mapping: 1,2</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Origin = (-180.000000000000000,90.000000000000000)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Pixel Size = (0.000000335276127,-0.000000335276127)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Image Structure Metadata:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> INTERLEAVE=PIXEL</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Corner Coordinates:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Upper Left (-180.0000000, 90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"N)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Lower Left (-180.0000000, -90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"S)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Upper Right ( 180.0000000, 90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Lower Right ( 180.0000000, -90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"S)</span><o:p></o:p></p>
<p class="MsoNormal">Center ( 0.0000000, 0.0000000) ( 0d 0' 0.01"E, 0d 0' 0.01"N)<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Band 1 Block=1024x1024 Type=Byte, ColorInterp=Red</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> Overviews: 536870912x268435456, 268435456x134217728, 134217728x67108864, 67108864x33554432, 33554432x16777216, 16777216x8388608, 8388608x4194304, 4194304x2097152, 2097152x1048576, 1048576x524288, 524288x262144, 262144x131072,
131072x65536, 65536x32768, 32768x16384, 16384x8192, 8192x4096, 4096x2048, 2048x1024, 1024x512</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:PT"> </span><o:p></o:p></p>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre>Momtchil Momtchev <a href="mailto:momtchil@momtchev.com"><momtchil@momtchev.com></a><o:p></o:p></pre>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre>Momtchil Momtchev <a href="mailto:momtchil@momtchev.com"><momtchil@momtchev.com></a><o:p></o:p></pre>
</div>
</body>
</html>