Class CoordSystemFactory


  • public class CoordSystemFactory
    extends Object
    Static methods for managing CoordSystemBuilderFactory classes
    • Constructor Detail

      • CoordSystemFactory

        public CoordSystemFactory()
    • 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 convention
        convAtts - 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 modify
        cancelTask - allow user to bail out.
        Returns:
        the builder to be used
        Throws:
        IOException - on io error