Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a certain WCS layer that I'd like to save it to my local computer for analysis.

According to GDAL WCS driver draft:

"Accessing a WCS server is accomplished by creating a local service description xml file looking something like the following, with the coverage server url, and the name of the coverage to access. It is important that there be no spaces or other content before the element.


I tried to create the xml file but I was unsuccessful.

Does anyone has any experience about extracting WCS layers? Are there any pointers (sites, tutorials, tips) on how to create the xml file?


The xml file im using to grab the first layer for a specific time is the following:


But for somereason returns an error

share|improve this question
Are you trying to automate the download? Because the data's available from website: – mkennedy Nov 14 '12 at 17:25
Yes that's why I trying to use gdal_translate. I want to check how the index changes over a period of time. – nickves Nov 14 '12 at 18:02
What does gdalinfo wcs.xml return? I found that OWSLib ( was very useful for accessing WCS'. – dmci Nov 15 '12 at 7:59
I didn't know about geopythons OWSlib. Sounds really promising I might be able to use that instead! – nickves Nov 15 '12 at 16:20
up vote 2 down vote accepted

Using python's OWSlib which was suggest by I was able to programmatically acquire the data.

Here's the script I used for future reference:

import os
from owslib.wcs import WebCoverageService as w  #owslib ->
                                                #easy_install owslib

folder = 'c:\\path\\to\\folder\\'
wcs = w(url="",version="1.0.0")
spi6 = w.['SPI6']  #The layer I am interested in 

for timep in spi6.timepositions :
   output = wcs.getCoverage('SPI6',time=[timep],bbox=(10.0,31.995,48.005,50),format='GTiff',CRS='EPSG:4326', WIDTH=380, HEIGHT=120)
   f = open(os.path.join(folder,'spi6_'+str(timep)+'.tiff'),'wb')

The above python script successfully downloaded and wrote 270+ geotiffs with their georeferenced data.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.