Package ucar.nc2.internal.dataset
Class CoordSystemFactory
- java.lang.Object
-
- ucar.nc2.internal.dataset.CoordSystemFactory
-
public class CoordSystemFactory extends Object
Static methods for managing CoordSystemBuilderFactory classes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CoordSystemFactory.ConventionNameOk
Allow plug-ins to determine if it owns a file based on the file's Convention attribute.
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
log
static String
resourcesDir
-
Constructor Summary
Constructors Constructor Description CoordSystemFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>
breakupConventionNames(String convAttValue)
Breakup list of Convention names in the Convention attribute in CF compliant way.static String
buildConventionAttribute(String mainConv, String... convAtts)
Build a list of Conventionsstatic Optional<CoordSystemBuilder>
factory(NetcdfDataset.Builder ds, CancelTask cancelTask)
Get a CoordSystemBuilder whose job it is to add Coordinate information to a NetcdfDataset.Builder.static boolean
getUseMaximalCoordSys()
Get whether to make records into Structures.static void
registerConvention(String conventionName, CoordSystemBuilderFactory c)
Register a class that implements a Convention.static void
registerConvention(String conventionName, CoordSystemBuilderFactory factory, CoordSystemFactory.ConventionNameOk match)
Register a class that implements a Convention.static void
registerNcml(String conventionName, String ncmlLocation)
Register an NcML file that implements a Convention by wrapping the dataset in the NcML.static void
setUseMaximalCoordSys(boolean b)
If true, assign implicit CoordinateSystem objects to variables that dont have one yet.
-
-
-
Field Detail
-
log
protected static org.slf4j.Logger log
-
resourcesDir
public static final String resourcesDir
- See Also:
- Constant Field Values
-
-
Method Detail
-
registerNcml
public static void registerNcml(String conventionName, String ncmlLocation)
Register an NcML file that implements a Convention by wrapping the dataset in the NcML. It is then processed by CoordSystemBuilder, using the _Coordinate attributes.- Parameters:
conventionName
- name of Convention, must be in the "Conventions" global attribute.ncmlLocation
- location of NcML file, may be local file or URL.
-
registerConvention
public static void registerConvention(String conventionName, CoordSystemBuilderFactory c)
Register a class that implements a Convention. Will match (ignoring case) the COnvention name.- Parameters:
conventionName
- name of Convention. This name will be used to look in the "Conventions" global attribute.c
- implementation of CoordSystemBuilderFactory that parses those kinds of netcdf files.
-
registerConvention
public static void registerConvention(String conventionName, CoordSystemBuilderFactory factory, CoordSystemFactory.ConventionNameOk match)
Register a class that implements a Convention.- Parameters:
conventionName
- name of Convention. This name will be used to look in the "Conventions" global attribute. Otherwise, you must implement the isMine() static method.match
- pass in your own matcher. if null, equalsIgnoreCase() will be used.factory
- implementation of CoordSystemBuilderFactory that parses those kinds of netcdf files.
-
setUseMaximalCoordSys
public static void setUseMaximalCoordSys(boolean b)
If true, assign implicit CoordinateSystem objects to variables that dont have one yet. Default value is false.- Parameters:
b
- true if if you want to guess at Coordinate Systems
-
getUseMaximalCoordSys
public static boolean getUseMaximalCoordSys()
Get whether to make records into Structures.- Returns:
- whether to make records into Structures.
-
breakupConventionNames
public static List<String> breakupConventionNames(String convAttValue)
Breakup list of Convention names in the Convention attribute in CF compliant way.- Parameters:
convAttValue
- original value of Convention attribute- Returns:
- list of Convention names
-
buildConventionAttribute
public static String buildConventionAttribute(String mainConv, String... convAtts)
Build a list of Conventions- Parameters:
mainConv
- this is the main conventionconvAtts
- list of others, only use "extra" Conventions- Returns:
- comma separated list of Conventions
-
factory
@Nonnull public static Optional<CoordSystemBuilder> factory(NetcdfDataset.Builder ds, CancelTask cancelTask) throws IOException
Get a CoordSystemBuilder whose job it is to add Coordinate information to a NetcdfDataset.Builder.- Parameters:
ds
- the NetcdfDataset.Builder to modifycancelTask
- allow user to bail out.- Returns:
- the builder to be used
- Throws:
IOException
- on io error
-
-