Unidata/thredds — pull request #43 by bielfrontera (2014-02-28 17:16:44+00:00)
Title: Fix VectorLayer components look up in wms server

Fixes a bug searching the two components in a vector layer request.
We have found this problem after adding QC flags to our dataset.

This is our scenario:

We have variables with these standard names:
- eastward_sea_water_velocity
- eastward_sea_water_velocity status_flag
- northward_sea_water_velocity
- northward_sea_water_velocity status_flag

It follows the CF-conventions (see
http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/cf-conventions.html#flags )

In this scenario, sea_water_velocity is listed as an available layer of the dataset.
But when this layer is requested, we get this exception:
uk.ac.rdg.resc.ncwms.exceptions.LayerNotDefinedException:
The layer "sea_water_velocity" is not provided by this server

The problem was getting the layer components. The function isComponent was returning
both eastward_sea_water_velocity and eastward_sea_water_velocity status_flag as
sea_water_velocity components.

We have modified isComponent function in order to return only the variables which
match with the layer requested. With these changes, ThreddsDataset.getLayerComponents
is compatible with what WMSUtils.findVectorLayers does. According to this, a better
solution would be to move this functionality to WMSUtils, so both functions would be
in the same package.

Note: you can see this problem at
http://thredds.socib.es/thredds/godiva2/godiva2.html?server=http://thredds.socib.es/thredds/wms/hf_radar/hf_radar_ibiza-scb_codarssproc001/L1/2013/dep0001_hf-radar-ibiza_scb-codarssproc001_L1_2013-12.nc