[gdal-dev] The new WCS driver

Ari Jolma ari.jolma at gmail.com
Thu Nov 16 11:50:17 PST 2017


I'm happy to suggest that

https://github.com/ajolma/gdal/tree/trunk/gdal/frmts/wcs

would be accepted into the GDAL trunk, thus to be included into the 
coming version 2.3.

I'm not making a PL since the GDAL at github is not a primary source. 
There is a python test program in the above directory (it should be 
moved to autotest eventually but it's now there for easier access).

There are a couple of things that I've done:

1) Introduced "WCS:<URL>" syntax for the driver.

2) Introduced a cache for various XML files (GDA WCS service file, GDAL 
metadata files, server responses).

3) Split the driver into a base class and version specific subclasses.

I have tested the driver with four real servers (ArcGIS, GeoServer, 
MapServer, and Rasdaman) and it can work with all of them in all 
versions they support. I have checked the responses (scaled and in CRS 
with inverted axis order (except ArcGIS)) in QGIS and they are ok - not 
always identical with each other but close enough. There is 
documentation and test code - Perl code to run gdal_translate calls to 
real servers and Python code to run tests against the responses obtained).

However, I assume there to be many small things in the code to 
review/change. I find the typical GDAL code often difficult to read and 
especially write. So I have written the code in a way that's easier for 
me to work with. I think there could be more strict rules for writing 
the code, and an automatic code checker (linter) would be useful. 
Besides things that a linter would check, I find it useful to write and 
debug shorter functions (max a screenful), while GDAL functions tend to 
be long, which often make them hard for me to understand and follow. 
Some issues specific to this work:

- I ended up writing quite many utility functions. Some may reinvent 
some wheels.

- The initial call to the server returns a dataset with subdatasets but 
without bands. It may be that opening a subdataset returns a dataset 
without bands (there are more than 2 dimensions). Then the additional 
subdataset metadata is added to the SUBDATASETS metadata domain.

- The idea is that the service file in the cache is maintained through 
options, which is used to change values in the file. The current set of 
options is expected to grow.

- I have not tested the more exotic features of the driver - especially 
mapping the time dimension to bands etc. I hope I have not broken what 
worked before. This is an area where more work is needed.

- The code compiles and the tests run ok in a new Linux machine.

Ari




More information about the gdal-dev mailing list