Class NetCdfReader

java.lang.Object
org.apache.sedona.common.raster.netcdf.NetCdfReader

public class NetCdfReader extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.geotools.coverage.grid.GridCoverage2D
    getRaster(ucar.nc2.NetcdfFile netcdfFile, String variableShortName)
    Return a raster containing the record variable data, assuming the last two dimensions of the variable as Y and X respectively
    static org.geotools.coverage.grid.GridCoverage2D
    getRaster(ucar.nc2.NetcdfFile netcdfFile, String variableShortName, String latDimShortName, String lonDimShortName)
     
    static Map
    getRasterMetadata(org.geotools.coverage.grid.GridCoverage2D raster)
    Return the properties map of the raster which contains metadata information about a netCDF file
    static String
    getRecordInfo(ucar.nc2.NetcdfFile netcdfFile)
    Return a string depicting information about record variables in the provided netcdf file along with its dimensions

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NetCdfReader

      public NetCdfReader()
  • Method Details

    • getRecordInfo

      public static String getRecordInfo(ucar.nc2.NetcdfFile netcdfFile)
      Return a string depicting information about record variables in the provided netcdf file along with its dimensions
      Parameters:
      netcdfFile - NetCDF file to retrieve info of
      Returns:
      a string containing information about all record variables present within the file
    • getRaster

      public static org.geotools.coverage.grid.GridCoverage2D getRaster(ucar.nc2.NetcdfFile netcdfFile, String variableShortName) throws org.geotools.api.referencing.FactoryException, IOException
      Return a raster containing the record variable data, assuming the last two dimensions of the variable as Y and X respectively
      Parameters:
      netcdfFile - NetCDF file to read
      variableShortName - short name of the variable to read
      Returns:
      GridCoverage2D object
      Throws:
      org.geotools.api.referencing.FactoryException
      IOException
    • getRaster

      public static org.geotools.coverage.grid.GridCoverage2D getRaster(ucar.nc2.NetcdfFile netcdfFile, String variableShortName, String latDimShortName, String lonDimShortName) throws org.geotools.api.referencing.FactoryException, IOException
      Parameters:
      netcdfFile - NetCDF file to read
      variableShortName - short name of the variable to read
      latDimShortName - short name of the variable that serves as the lat dimension of the record variable
      lonDimShortName - short name of the variable that serves as the lon dimension of the record variable
      Returns:
      GridCoverage2D object
      Throws:
      org.geotools.api.referencing.FactoryException
      IOException
    • getRasterMetadata

      public static Map getRasterMetadata(org.geotools.coverage.grid.GridCoverage2D raster)
      Return the properties map of the raster which contains metadata information about a netCDF file
      Parameters:
      raster - GridCoverage2D raster created from a NetCDF file
      Returns:
      a map of containing metadata