Package uk.ac.rdg.resc.edal.dataset.cdm
Class CdmGridDatasetFactory
- java.lang.Object
-
- uk.ac.rdg.resc.edal.dataset.DatasetFactory
-
- uk.ac.rdg.resc.edal.dataset.cdm.CdmDatasetFactory
-
- uk.ac.rdg.resc.edal.dataset.cdm.CdmGridDatasetFactory
-
- All Implemented Interfaces:
Serializable
public class CdmGridDatasetFactory extends CdmDatasetFactory implements Serializable
DatasetFactory
that createsDataset
s representing gridded data read through the Unidata Common Data Model. Although multiple instances of thisDatasetFactory
can be created, all share a common cache of NetcdfDataset objects to speed up operations where the same dataset is accessed multiple times. To avoid excess file handles being open, this is a LRU cache which closes the datasets when they expire.- Author:
- Guy Griffiths, Jon Blower
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class uk.ac.rdg.resc.edal.dataset.DatasetFactory
workingDir
-
-
Constructor Summary
Constructors Constructor Description CdmGridDatasetFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DiscreteLayeredDataset<? extends DataSource,? extends DiscreteLayeredVariableMetadata>
generateDataset(String id, String location, ucar.nc2.dataset.NetcdfDataset nc)
Generate aDiscreteLayeredDataset
for the given ID, location, andNetcdfDataset
.-
Methods inherited from class uk.ac.rdg.resc.edal.dataset.cdm.CdmDatasetFactory
createDataset, createDataset, getNetcdfDatasetFromLocation, getParameter, getVariableName
-
Methods inherited from class uk.ac.rdg.resc.edal.dataset.DatasetFactory
forName, setDefaultDatasetFactoryClass, setWorkingDirectory
-
-
-
-
Method Detail
-
generateDataset
protected DiscreteLayeredDataset<? extends DataSource,? extends DiscreteLayeredVariableMetadata> generateDataset(String id, String location, ucar.nc2.dataset.NetcdfDataset nc) throws IOException
Description copied from class:CdmDatasetFactory
Generate aDiscreteLayeredDataset
for the given ID, location, andNetcdfDataset
. Subclasses should use this to generate a simpleDiscreteLayeredDataset
- i.e. one with no additional plugins etc. All requiredVariablePlugin
s will be detected and handled by this class.- Specified by:
generateDataset
in classCdmDatasetFactory
- Parameters:
id
- The ID of theDataset
location
- The location of theDataset
(either on disk or online)nc
- TheNetcdfDataset
representing theDataset
- Returns:
- A
DiscreteLayeredDataset
- Throws:
IOException
- If there is a problem reading the underlyingNetcdfDataset
-
-