Hello, I trying a WMS web service with gdal, but I have different results 
depend on I use a url in a web browser or I use the gdal commands.
If I put this url in Crome:
https://wms.mapa.gob.es/sigpac/ows?FORMAT=image/jpeg&HEIGHT=99&LAYERS=EEPP&WIDTH=183&SERVICE=WMS&BBOX=413276.0389803443,4066482.0439935336,675346.7028941214,4208125.2305295570&REQUEST=GetMap&TRANSPARENT=FALSE&STYLES=&VERSION=1.3.0&CRS=EPSG:25830

I get an image:

[cid:image002.jpg@01D72C65.1B877460]

But If I use the same parameters in a XML file, like as this:

<GDAL_WMS>
  <Service name="WMS">
    <Version>1.3.0</Version>
    
<ServerUrl>https://wms.mapa.gob.es/sigpac/ows?SERVICE=WMS&amp;username=&amp;password=</ServerUrl>
    <Layers>EEPP</Layers>
    <CRS>EPSG:25830</CRS>
    <ImageFormat>image/jpeg</ImageFormat>
    <Transparent>FALSE</Transparent>
    <BBoxOrder>xyXY</BBoxOrder>
  </Service>
  <DataWindow>
    <UpperLeftX>413276.0389803443</UpperLeftX>
    <UpperLeftY>4208125.2305295570</UpperLeftY>
    <LowerRightX>675346.7028941214</LowerRightX>
    <LowerRightY>4066482.0439935336</LowerRightY>
    <SizeX>183</SizeX>
    <SizeY>99</SizeY>
  </DataWindow>
  <Timeout>1600</Timeout>
  <BandsCount>3</BandsCount>
  <BlockSizeX>1024</BlockSizeX>
  <BlockSizeY>1024</BlockSizeY>
  <OverviewCount>20</OverviewCount>
  <UserPwd>:</UserPwd>
  <UnsafeSSL>true</UnsafeSSL>
  <ZeroBlockHttpCodes></ZeroBlockHttpCodes>
</GDAL_WMS>


And then I run the next gdal command: gdal_translate -of JPEG -outsize 183 99 
C:\Users\elena\AppData\Local\Temp\tmpnuevo.xml 
C:\Users\elena\AppData\Local\Temp\miimagen.jpeg
The result is :

Input file size is 183, 99
0ERROR 1: GDALWMS: Unable to download block 0, 0.
URL: <!doctype html><html lang="es"><head><title>Estado HTTP 401 ÔÇô No 
autorizado</title><style type="text/css">body 
{font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b 
{color:white;background-color:#525D76;} h1 {font-size:22px;} h2 
{font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} 
.line 
{height:1px;background-color:#525D76;border:none;}</style></head><body><h1>Estado
 HTTP 401 ÔÇô No autorizado</h1><hr class="line" /><p><b>Tipo</b> Informe de 
estado</p><p><b>mensaje</b> Unauthorized</p><p><b>Descripci├│n</b> Este 
requerimiento requiere autenticaci├│n HTTP.</p><hr class="line" /><h3>Apache 
Tomcat/9.0.37</h3></body></html>
  HTTP status code: 401, error: <!doctype html><html 
lang="es"><head><title>Estado HTTP 401 ÔÇô No autorizado</title><style 
type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b 
{color:white;background-color:#525D76;} h1 {font-size:22px;} h2 
{font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} 
.line 
{height:1px;background-color:#525D76;border:none;}</style></head><body><h1>Estado
 HTTP 401 ÔÇô No autorizado</h1><hr class="line" /><p><b>Tipo</b> Informe de 
estado</p><p><b>mensaje</b> Unauthorized</p><p><b>Descripci├│n</b> Este 
requerimiento requiere autenticaci├│n HTTP.</p><hr class="line" /><h3>Apache 
Tomcat/9.0.37</h3></body></html>.
Add the HTTP status code to <ZeroBlockHttpCodes> to ignore this error (see 
http://www.gdal.org/frmt_wms.html).
ERROR 1: C:\Users\elena\AppData\Local\Temp\tmpnuevo.xml, band 1: IReadBlock 
failed at X offset 0, Y offset 0: GDALWMS: Unable to download block 0, 0.
URL: <!doctype html><html lang="es"><head><title>Estado HTTP 401 ÔÇô No 
autorizado</title><style type="text/css">body 
{font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b 
{color:white;background-color:#525D76;} h1 {font-size:22px;} h2 
{font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} 
.line 
{height:1px;background-color:#525D76;border:none;}</style></head><body><h1>Estado
 HTTP 401 ÔÇô No autorizado</h1><hr class="line" /><p><b>Tipo</b> Informe de 
estado</p><p><b>mensaje</b> Unauthorized</p><p><b>Descripci├│n</b> Este 
requerimiento requiere autenticaci├│n HTTP.</p><hr class="line" /><h3>Apache 
Tomcat/9.0.37</h3></body></html>
  HTTP status code: 401, error: <!doctype html><html 
lang="es"><head><title>Estado HTTP 401 ÔÇô No autorizado</title><style 
type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b 
{color:white;background-color:#525D76;} h1 {font-size:22px;} h2 
{font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} 
.line 
{height:1px;background-color:#525D76;border:none;}</style></head><body><h1>Estado
 HTTP 401 ÔÇô No autorizado</h1><hr class="line" /><p><b>Tipo</b> Informe de 
estado</p><p><b>mensaje</b> Unauthorized</p><p><b>Descripci├│n</b> Este 
requerimiento requiere autenticaci├│n HTTP.</p><hr class="line" /><h3>Apache 
Tomcat/9.0.37</h3></body></html>.
Add the HTTP status code to <ZeroBlockHttpCodes> to ignore this error (see 
http://www.gdal.org/frmt_wms.html).

And there are not any image.
I´m using gdal 3.0, and I don´t understand why works at web browser and don´t 
works with gdal, I am doing something wrong? Thank you very much and regards
________________________________

[https://www.aplitop.com/descargas/firma1.jpg]


Elena Ruiz
Sofware Development & Technical Support
Tel. +34 952 43 97 71
er...@aplitop.com
Sumatra, 9 - 29190 Málaga (Spain)
www.aplitop.com

[cid:SocialLink_Facebook_32x32_a745adb8-c250-4372-8480-e77f503dad3d.png]<https://www.facebook.com/AplitopSL/>
   [cid:SocialLink_Twitter_32x32_858247f6-9d4a-4740-a6b3-9b5ebfd98a97.png] 
<https://twitter.com/aplitop>    
[cid:SocialLink_Linkedin_32x32_154d63de-bf68-468f-9eb0-ffed102fac77.png] 
<https://www.linkedin.com/company/aplitop>    
[cid:SocialLink_Youtube_32x32_0dea15dd-3774-4086-be9d-f62560b70c86.png] 
<https://www.youtube.com/user/aplitop>


In accordance with the provisions of the European Regulation of Data Protection 
2016/679 (Reglamento Europeo de Protección de Datos 2016/679), we inform you 
that the data and the information you provide us through this medium will be 
used by APLITOP, S.L., with C.I.F. B-92543396 and with address at C / Sumatra, 
9, Malaga, 29190, in order to answer your questions and inform you about our 
products. The data provided will be kept as long as it does not request its 
cessation and will not be transferred to third parties except in cases where 
there is a legal obligation. You have the right to access your personal data, 
correct inaccurate data or request its deletion when the data is no longer 
necessary for the purposes that were collected, as well as any rights 
recognized in the RGPD 2016/679

<https://www.aplitop.com/Event/en/358/intergeo-2019>

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to