Class NetCdfReader
java.lang.Object
org.apache.sedona.common.raster.netcdf.NetCdfReader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.geotools.coverage.grid.GridCoverage2DReturn a raster containing the record variable data, assuming the last two dimensions of the variable as Y and X respectivelystatic org.geotools.coverage.grid.GridCoverage2DgetRaster(ucar.nc2.NetcdfFile netcdfFile, String variableShortName, String latDimShortName, String lonDimShortName) static MapgetRasterMetadata(org.geotools.coverage.grid.GridCoverage2D raster) Return the properties map of the raster which contains metadata information about a netCDF filestatic StringgetRecordInfo(ucar.nc2.NetcdfFile netcdfFile) Return a string depicting information about record variables in the provided netcdf file along with its dimensions
-
Constructor Details
-
NetCdfReader
public NetCdfReader()
-
-
Method Details
-
getRecordInfo
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 readvariableShortName- short name of the variable to read- Returns:
- GridCoverage2D object
- Throws:
org.geotools.api.referencing.FactoryExceptionIOException
-
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 readvariableShortName- short name of the variable to readlatDimShortName- short name of the variable that serves as the lat dimension of the record variablelonDimShortName- short name of the variable that serves as the lon dimension of the record variable- Returns:
- GridCoverage2D object
- Throws:
org.geotools.api.referencing.FactoryExceptionIOException
-
getRasterMetadata
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
-