Package thredds.server.wms
Class ThreddsWmsCatalogue
java.lang.Object
thredds.server.wms.ThreddsWmsCatalogue
- All Implemented Interfaces:
uk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue,uk.ac.rdg.resc.edal.graphics.utils.FeatureCatalogue,uk.ac.rdg.resc.edal.wms.WmsCatalogue
Example of an implementation of a
WmsCatalogue to work with the TDS.
This is a working example, but many of the specifics will need to be
implemented differently based on how the THREDDS team decide to configure WMS
layers.
This WmsCatalogue provides access to a SINGLE dataset. As such, each
different dataset requested will have a new instance of this class.
NB - No caching is implemented in this WmsCatalogue. I would
recommend a cache which is shared amongst all WmsCatalogues, passed
in on object construction, and which performs the caching/retrieval in the
FeatureCatalogue.getFeaturesForLayer(String, PlottingDomainParams)
method. The cache keys will be a pair of the layerName and the
PlottingDomainParams, and the cached values will be
Collections of DiscreteFeatures.-
Nested Class Summary
Nested classes/interfaces inherited from interface uk.ac.rdg.resc.edal.graphics.utils.FeatureCatalogue
uk.ac.rdg.resc.edal.graphics.utils.FeatureCatalogue.FeaturesAndMemberName -
Constructor Summary
ConstructorsConstructorDescriptionThreddsWmsCatalogue(ucar.nc2.dataset.NetcdfDataset ncd, String tdsDatasetPath) -
Method Summary
Modifier and TypeMethodDescriptionbooleanCollection<uk.ac.rdg.resc.edal.dataset.Dataset>uk.ac.rdg.resc.edal.wms.util.ContactInfouk.ac.rdg.resc.edal.dataset.DatasetgetDatasetFromId(String layerName) getDatasetTitle(String layerName) Get the title of the dataset.uk.ac.rdg.resc.edal.graphics.utils.FeatureCatalogue.FeaturesAndMemberNamegetFeaturesForLayer(String layerName, uk.ac.rdg.resc.edal.graphics.utils.PlottingDomainParams params) org.joda.time.DateTimeuk.ac.rdg.resc.edal.graphics.utils.EnhancedVariableMetadatagetLayerMetadata(uk.ac.rdg.resc.edal.metadata.VariableMetadata metadata) uk.ac.rdg.resc.edal.graphics.utils.LayerNameMapperuk.ac.rdg.resc.edal.wms.util.ServerInfouk.ac.rdg.resc.edal.graphics.utils.StyleCataloguebooleanisDisabled(String layerName) booleanisDownloadable(String layerName) booleanisQueryable(String layerName) static voidstatic voidsetWmsConfig(WmsConfigBean config)
-
Constructor Details
-
ThreddsWmsCatalogue
public ThreddsWmsCatalogue(ucar.nc2.dataset.NetcdfDataset ncd, String tdsDatasetPath) throws IOException, uk.ac.rdg.resc.edal.exceptions.EdalException - Throws:
IOExceptionuk.ac.rdg.resc.edal.exceptions.EdalException
-
-
Method Details
-
getTdsDatasetPath
-
getFeaturesForLayer
public uk.ac.rdg.resc.edal.graphics.utils.FeatureCatalogue.FeaturesAndMemberName getFeaturesForLayer(String layerName, uk.ac.rdg.resc.edal.graphics.utils.PlottingDomainParams params) throws uk.ac.rdg.resc.edal.exceptions.EdalException - Specified by:
getFeaturesForLayerin interfaceuk.ac.rdg.resc.edal.graphics.utils.FeatureCatalogue- Throws:
uk.ac.rdg.resc.edal.exceptions.EdalException
-
getAllDatasets
- Specified by:
getAllDatasetsin interfaceuk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue
-
allowsGlobalCapabilities
public boolean allowsGlobalCapabilities() -
getDatasetFromId
- Specified by:
getDatasetFromIdin interfaceuk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue
-
getDatasetTitle
Get the title of the dataset. If the title is null (i.e. not found), return the string value "Untitled Dataset" The title is found by the getTitle() method in NetcdfDataset, or by a global attribute "title" (not case-sensitive)- Specified by:
getDatasetTitlein interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue- Parameters:
layerName- name of the layer- Returns:
- title of the dataset
-
isDisabled
- Specified by:
isDisabledin interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
isDownloadable
- Specified by:
isDownloadablein interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
isQueryable
- Specified by:
isQueryablein interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
getLastUpdateTime
public org.joda.time.DateTime getLastUpdateTime()- Specified by:
getLastUpdateTimein interfaceuk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue
-
getContactInfo
public uk.ac.rdg.resc.edal.wms.util.ContactInfo getContactInfo()- Specified by:
getContactInfoin interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
setTdsServerInfo
-
setWmsConfig
-
getServerInfo
public uk.ac.rdg.resc.edal.wms.util.ServerInfo getServerInfo()- Specified by:
getServerInfoin interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
getLayerNameMapper
public uk.ac.rdg.resc.edal.graphics.utils.LayerNameMapper getLayerNameMapper()- Specified by:
getLayerNameMapperin interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
getStyleCatalogue
public uk.ac.rdg.resc.edal.graphics.utils.StyleCatalogue getStyleCatalogue()- Specified by:
getStyleCataloguein interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
getLayerMetadata
public uk.ac.rdg.resc.edal.graphics.utils.EnhancedVariableMetadata getLayerMetadata(uk.ac.rdg.resc.edal.metadata.VariableMetadata metadata) throws uk.ac.rdg.resc.edal.graphics.exceptions.EdalLayerNotFoundException - Specified by:
getLayerMetadatain interfaceuk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue- Throws:
uk.ac.rdg.resc.edal.graphics.exceptions.EdalLayerNotFoundException
-