Class NetCDFProjection
Object
NetCDFProjection
Class used to properly setup NetCDF CF Projection parameters. Given a known OGC Projection, it will take care of
remapping the Projection's parameters to NetCDF CF GridMapping parameters if supported.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NetCDFProjectionCurrently supported NetCDF projections.static final NetCDFProjectionstatic final NetCDFProjectionstatic final NetCDFProjectionstatic final NetCDFProjectionstatic final NetCDFProjectionstatic final NetCDFProjectionstatic final Stringstatic final NetCDFProjectionstatic final NetCDFProjectionstatic final NetCDFProjectionstatic final NetCDFProjection -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()Return the NetCDF CF GridMapping namegetNetcdfParameters(ParameterValueGroup ogcParameters) Subclasses override this if they wish to adjust OGC parameters before they are written to NetCDF.Return the OGC/GeoTools projection namegetOgcParameters(ParameterValueGroup netcdfParameters) Subclasses override this if they wish to adjust OGC parameters after they are read from NetCDF.Returns the underlying unmodifiable Referencing to NetCDF parameters mapping.static NetCDFProjectiongetSupportedProjection(String projectionName) Get a NetCDF Projection definition referred by namestatic CoordinateReferenceSystemlookForDatasetCRS(NetcdfDataset dataset) Look for a dataset globalCoordinateReferenceSystemdefinition provided through a spatial_ref global attribute.static CoordinateReferenceSystemlookForVariableCRS(NetcdfDataset dataset, CoordinateReferenceSystem defaultCrs) static CoordinateReferenceSystemlookForVariableCRS(NetcdfDataset dataset, CoordinateReferenceSystem defaultCrs, Map<String, Object> crsProperties) Look for a CoordinateReferenceSystem defined into a variablestatic CoordinateReferenceSystemCheck if any custom EPSG maps the provided crs and return that onestatic CoordinateReferenceSystemparseProjection(NetcdfDataset dataset) Look for a SPATIAL_REF global attribute and parsing it (as WKT) to setup aCoordinateReferenceSystemstatic CoordinateReferenceSystemparseProjection(Variable var) Extract the georeferencing projection information from the specified variable and setup aCoordinateReferenceSysteminstancestatic CoordinateReferenceSystemparseProjection(Variable var, NetCDFProjection.CRSParser crsParser) Extract the georeferencing projection information from the specified variable and setup aCoordinateReferenceSysteminstancestatic CoordinateReferenceSystemparseProjection(Variable var, NetCDFProjection.CRSParser crsParser, Map<String, Object> crsProperties) Extract the georeferencing projection information from the specified variable and setup aCoordinateReferenceSysteminstance
-
Field Details
-
PARAMS_SEPARATOR
- See Also:
-
ALBERS_EQUAL_AREA
Currently supported NetCDF projections. Check the CF Document- See Also:
-
MERCATOR_1SP
-
MERCATOR_2SP
-
LAMBERT_AZIMUTHAL_EQUAL_AREA
-
TRANSVERSE_MERCATOR
-
ORTHOGRAPHIC
-
POLAR_STEREOGRAPHIC
-
STEREOGRAPHIC
-
LAMBERT_CONFORMAL_CONIC_1SP
-
LAMBERT_CONFORMAL_CONIC_2SP
-
ROTATED_POLE
-
-
Constructor Details
-
Method Details
-
getParameters
Returns the underlying unmodifiable Referencing to NetCDF parameters mapping. -
getName
Return the NetCDF CF GridMapping name -
getOGCName
Return the OGC/GeoTools projection name -
getOgcParameters
Subclasses override this if they wish to adjust OGC parameters after they are read from NetCDF. This is the inverse ofgetNetcdfParameters(ParameterValueGroup).- Parameters:
netcdfParameters- parameter values read from NetCDF- Returns:
- parameter values used for OGC projection
-
getNetcdfParameters
Subclasses override this if they wish to adjust OGC parameters before they are written to NetCDF. This is the inverse ofgetOgcParameters(ParameterValueGroup).- Parameters:
ogcParameters- parameter values used for OGC projection- Returns:
- parameter values written to NetCDF
-
getSupportedProjection
Get a NetCDF Projection definition referred by name -
parseProjection
Extract the georeferencing projection information from the specified variable and setup aCoordinateReferenceSysteminstance- Throws:
FactoryException
-
parseProjection
public static CoordinateReferenceSystem parseProjection(Variable var, NetCDFProjection.CRSParser crsParser) throws FactoryException Extract the georeferencing projection information from the specified variable and setup aCoordinateReferenceSysteminstance- Throws:
FactoryException
-
parseProjection
public static CoordinateReferenceSystem parseProjection(Variable var, NetCDFProjection.CRSParser crsParser, Map<String, Object> crsProperties) throws FactoryExceptionExtract the georeferencing projection information from the specified variable and setup aCoordinateReferenceSysteminstance- Throws:
FactoryException
-
parseProjection
Look for a SPATIAL_REF global attribute and parsing it (as WKT) to setup aCoordinateReferenceSystem -
lookupForCustomEpsg
public static CoordinateReferenceSystem lookupForCustomEpsg(CoordinateReferenceSystem crs) throws FactoryException Check if any custom EPSG maps the provided crs and return that one- Throws:
FactoryException
-
lookForVariableCRS
public static CoordinateReferenceSystem lookForVariableCRS(NetcdfDataset dataset, CoordinateReferenceSystem defaultCrs) throws FactoryException - Throws:
FactoryException
-
lookForVariableCRS
public static CoordinateReferenceSystem lookForVariableCRS(NetcdfDataset dataset, CoordinateReferenceSystem defaultCrs, Map<String, Object> crsProperties) throws FactoryExceptionLook for a CoordinateReferenceSystem defined into a variable- Throws:
FactoryException
-
lookForDatasetCRS
Look for a dataset globalCoordinateReferenceSystemdefinition provided through a spatial_ref global attribute.
-