Opened 14 years ago

Last modified 14 years ago

#3464 closed defect

gdal_translate cannot download from WMS interface at geoportal.cuzk.cz — at Version 1

Reported by: voland Owned by: nowakpl
Priority: normal Milestone: 1.8.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: WMS useragent
Cc: warmerdam

Description (last modified by warmerdam)

There is a WMS service in Czech Republic. It can be configured the following way:

<GDAL_WMS>
<Service name="WMS">
<Version>1.3.0</Version>
<ServerUrl>http://geoportal.cuzk.cz/wmsdata13/RASZM10/wms.asp?SID=&amp;</ServerUrl>

<CRS>EPSG:32633</CRS>
<ImageFormat>image/png</ImageFormat>
<Layers>GR_ZM10</Layers>
</Service>

<DataWindow>
<UpperLeftX>540000</UpperLeftX>
<LowerRightX>545000</LowerRightX>
<LowerRightY>5608000</LowerRightY>
<UpperLeftY>5614000</UpperLeftY>

<SizeX>2500</SizeX>
<SizeY>3000</SizeY>
</DataWindow>

<Cache>
<Path>/cache</Path>
<Depth>1</Depth>
</Cache>

<MaxConnections>1</MaxConnections>

<BlockSizeX>500</BlockSizeX>
<BlockSizeY>500</BlockSizeY>

</GDAL_WMS>

It can be run with the following command:

gdal_translate -of ENVI wms.xml test.envi

The very first URL generated by gdal_translate cannot be downloaded:

Input file size is 2500, 3000
0ERROR 1: GDALWMS: Unable to download block 0, 0.
  URL:
http://geoportal.cuzk.cz/wmsdata13/RASZM10/wms.asp?SID=&request=GetMap&version=1.3.0&layers=GR_ZM10&styles=&crs=EPSG:32633&format=image/png&width=500&height=500&bbox=540000.00000000,5613000.00000000,541000.00000000,5614000.00000000
  HTTP status code: 200, error: (null).
ERROR 1: IReadBlock failed at X offset 0, Y offset 0
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0

But if opened in Firefox, this URL is downloaded immediately.

It is possible that gdal_translate is missing something in HTTP Header like user agent, session ID or something that allows WMS server to check if it is a web browser or other piece of software.

Change History (1)

comment:1 by warmerdam, 14 years ago

Cc: warmerdam added
Component: defaultGDAL_Raster
Description: modified (diff)
Keywords: WMS added
Owner: changed from warmerdam to nowakpl

Adam,

Would you be interested in investigating this? If not, reassign back to me, and perhaps I can have Chaitanya look into it.

Note: See TracTickets for help on using tickets.