Package ucar.nc2.ft
Class FeatureDatasetFactoryManager
- java.lang.Object
-
- ucar.nc2.ft.FeatureDatasetFactoryManager
-
public class FeatureDatasetFactoryManager extends Object
Manager of factories for FeatureDatasets opened as NetcdfDatasets.Grids, FMRC, Swaths are using GridDatasetStandardFactory
Radial data uses RadialDatasetStandardFactory
All point datasets are going through PointDatasetStandardFactory, which uses TableAnalyzer to deal with specific dataset conventions.
- Since:
- Mar 19, 2008
- See Also:
FeatureDatasetFactory
-
-
Constructor Summary
Constructors Constructor Description FeatureDatasetFactoryManager()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
featureTypeOk(FeatureType want, FeatureType facType)
Determine if factory type matches wanted feature type.static FeatureType
findFeatureType(NetcdfFile ncd)
Try to determine the feature type of the dataset, by examining its metadata.static FeatureDataset
open(String location)
static FeatureDataset
open(FeatureType wantFeatureType, String location, CancelTask task)
Deprecated.use open(FeatureType wantFeatureType, String location, ucar.nc2.util.CancelTask task, Formatter errlog)static FeatureDataset
open(FeatureType wantFeatureType, String location, CancelTask task, Formatter errlog)
Open a dataset as a FeatureDataset.static void
registerFactory(Class c)
Register a class that implements a FeatureDatasetFactory.static void
registerFactory(String className)
Register a class that implements a FeatureDatasetFactory.static void
registerFactory(FeatureType datatype, Class c)
Register a class that implements a FeatureDatasetFactory.static boolean
registerFactory(FeatureType datatype, String className)
Register a class that implements a FeatureDatasetFactory.static FeatureDataset
wrap(FeatureType wantFeatureType, NetcdfDataset ncd, CancelTask task, Formatter errlog)
Wrap a NetcdfDataset as a FeatureDataset.
-
-
-
Method Detail
-
registerFactory
public static boolean registerFactory(FeatureType datatype, String className)
Register a class that implements a FeatureDatasetFactory.- Parameters:
datatype
- scientific data typeclassName
- name of class that implements FeatureDatasetFactory.- Returns:
- true if successfully loaded
-
registerFactory
public static void registerFactory(FeatureType datatype, Class c)
Register a class that implements a FeatureDatasetFactory.- Parameters:
datatype
- scientific data typec
- class that implements FeatureDatasetFactory.
-
registerFactory
public static void registerFactory(String className) throws ClassNotFoundException
Register a class that implements a FeatureDatasetFactory.- Parameters:
className
- name of class that implements FeatureDatasetFactory.- Throws:
ClassNotFoundException
- if loading error
-
registerFactory
public static void registerFactory(Class c)
Register a class that implements a FeatureDatasetFactory. Find out which type by calling getFeatureType().- Parameters:
c
- class that implements FeatureDatasetFactory.
-
open
public static FeatureDataset open(String location) throws IOException
- Throws:
IOException
-
open
public static FeatureDataset open(FeatureType wantFeatureType, String location, CancelTask task) throws IOException, NoFactoryFoundException
Deprecated.use open(FeatureType wantFeatureType, String location, ucar.nc2.util.CancelTask task, Formatter errlog)- Throws:
IOException
NoFactoryFoundException
-
open
public static FeatureDataset open(FeatureType wantFeatureType, String location, CancelTask task, Formatter errlog) throws IOException
Open a dataset as a FeatureDataset.- Parameters:
wantFeatureType
- open this kind of FeatureDataset; may be null, which means search all factories. If datatype is not null, only return correct FeatureDataset (eg PointFeatureDataset for DataType.POINT).location
- URL or file location of the dataset. This may be a- thredds catalog#dataset (with a thredds: prefix)
- cdmrFeature dataset (with a cdmrFeature: prefix)
- cdmremote dataset (with a cdmremote: prefix)
- collection dataset (with a collection: prefix)
- file location for a CDM dataset opened with NetcdfDataset.acquireDataset()
task
- user may cancelerrlog
- place errors here, may not be null- Returns:
- a subclass of FeatureDataset, or null if no suitable factory was found, message in errlog
- Throws:
IOException
- on io error
-
wrap
public static FeatureDataset wrap(FeatureType wantFeatureType, NetcdfDataset ncd, CancelTask task, Formatter errlog) throws IOException
Wrap a NetcdfDataset as a FeatureDataset.- Parameters:
wantFeatureType
- open this kind of FeatureDataset; may be null, which means search all factories. If datatype is not null, only return FeatureDataset with objects of that typencd
- the NetcdfDataset to wrap as a FeatureDatasettask
- user may cancelerrlog
- place errors here, may not be null- Returns:
- a subclass of FeatureDataset, or null if no suitable factory was found
- Throws:
IOException
- on io error
-
featureTypeOk
public static boolean featureTypeOk(FeatureType want, FeatureType facType)
Determine if factory type matches wanted feature type.- Parameters:
want
- want this FeatureTypefacType
- factory is of this type- Returns:
- true if match
-
findFeatureType
public static FeatureType findFeatureType(NetcdfFile ncd)
Try to determine the feature type of the dataset, by examining its metadata.- Parameters:
ncd
- the dataset- Returns:
- FeatureType if found, else null
-
-