|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectMetadataTranscoder<Metadata>
NetcdfTranscoder
public class NetcdfTranscoder
Mapping from NetCDF metadata to ISO 19115-2 metadata. The mapping is defined in the following web pages:
The String constants declared in this class are the name of attributes examined by this class.
The attribute values are extracted using the NetcdfFile.findGlobalAttributeIgnoreCase(String)
or Group.findAttributeIgnoreCase(String) methods. The current implementation searches the
attribute values in the following places, in that order:
"NCISOMetadata" group"CFMetadata" group"THREDDSMetadata" group
The "CFMetadata" group has precedence over the global attributes because the
longitude and latitude resolutions are
often more accurate in that group.
NetCDF attributes
The NetCDF attributes parsed by this class are
"acces_constraint", "acknowledgment", "comment",
"contributor_email",
"contributor_name",
"contributor_role",
"contributor_url",
"creator_email",
"creator_name",
"creator_url",
"cdm_data_type", "date_created", "date_issued", "date_modified",
"flag_masks", "flag_meanings", "flag_names", "flag_values",
"full_name",
"geographic_identifier",
"geospatial_lat_max",
"geospatial_lat_min",
"geospatial_lat_resolution",
"geospatial_lat_units",
"geospatial_lon_max",
"geospatial_lon_min",
"geospatial_lon_resolution",
"geospatial_lon_units",
"geospatial_vertical_max",
"geospatial_vertical_min",
"geospatial_vertical_positive",
"geospatial_vertical_resolution",
"geospatial_vertical_units",
"history", "id", "institution", "keywords",
"license", "metadata_creation", "name", "naming_authority",
"processing_level", "project",
"publisher_email",
"publisher_name",
"publisher_url",
"purpose", "references", "standard_name",
"standard_name_vocabulary", "summary",
"time_coverage_duration",
"time_coverage_end",
"time_coverage_resolution",
"time_coverage_start",
"time_coverage_units",
"title", "topic_category" and "keywords_vocabulary".
Known limitations
"degrees_west" and "degrees_south" units not correctly handledBand elements.FLAG_VALUES and FLAG_MASKS not yet included in the
RangeElementDescription elements.
| coverage/geotk-coverageio-netcdf (download) | View source code for this class |
| Nested Class Summary | |
|---|---|
static class |
NetcdfTranscoder.Dimension
Holds the attribute names describing a simple latitude, longitude, and vertical bounding box. |
static class |
NetcdfTranscoder.Responsible
Holds the attribute names describing a responsible party. |
| Field Summary | |
|---|---|
static String |
ACCESS_CONSTRAINT
The "acces_constraint" attribute name for the access constraints applied to assure the protection of privacy or intellectual property. |
static String |
ACKNOWLEDGMENT
The "acknowledgment" attribute name for a place to acknowledge various type of support for the project that produced this data (Recommended). |
static String |
COMMENT
The "comment" attribute name for miscellaneous information about the data (Recommended). |
static NetcdfTranscoder.Responsible |
CONTRIBUTOR
The set of attribute names for the contributor (Suggested). |
static NetcdfTranscoder.Responsible |
CREATOR
The set of attribute names for the creator (Recommended). |
static String |
DATA_TYPE
The "cdm_data_type" attribute name for the THREDDS data type appropriate for this dataset (Recommended). |
static String |
DATE_CREATED
The "date_created" attribute name for the date on which the data was created (Recommended). |
static String |
DATE_ISSUED
The "date_issued" attribute name for a date on which this data was formally issued (Suggested). |
static String |
DATE_MODIFIED
The "date_modified" attribute name for the date on which this data was last modified (Suggested). |
protected NetcdfFile |
file
The NetCDF file from which to extract ISO metadata. |
static String |
FLAG_MASKS
The "flag_masks" attribute name for bitmask to apply on sample values before to compare them to the flag values. |
static String |
FLAG_MEANINGS
The "flag_meanings" attribute name for the meaning of flag values. |
static String |
FLAG_NAMES
The "flag_names" attribute name for the designation associated with a range element. |
static String |
FLAG_VALUES
The "flag_values" attribute name for sample values to be flagged. |
static String |
GEOGRAPHIC_IDENTIFIER
The "geographic_identifier" attribute name for an identifier of the geographic area. |
static String |
HISTORY
The "history" attribute name for providing an audit trail for modifications to the original data (Recommended). |
static String |
IDENTIFIER
The "id" attribute name for an identifier (Recommended). |
static String |
KEYWORDS
The "keywords" attribute name for a comma separated list of key words and phrases (Highly Recommended). |
static NetcdfTranscoder.Dimension |
LATITUDE
The set of attribute names for the minimal and maximal latitudes of the bounding box, resolution and units. |
static String |
LICENSE
The "license" attribute name for a description of the restrictions to data access and distribution (Recommended). |
static NetcdfTranscoder.Dimension |
LONGITUDE
The set of attribute names for the minimal and maximal longitudes of the bounding box, resolution and units. |
static String |
METADATA_CREATION
The "metadata_creation" attribute name for the date on which the metadata was created (Suggested). |
static String |
NAMING_AUTHORITY
The "naming_authority" attribute name for the identifier authority (Recommended). |
static String |
PROCESSING_LEVEL
The "processing_level" attribute name for a textual description of the processing (or quality control) level of the data. |
static String |
PROJECT
The "project" attribute name for the scientific project that produced the data (Recommended). |
static NetcdfTranscoder.Responsible |
PUBLISHER
The set of attribute names for the publisher (Suggested). |
static String |
PURPOSE
The "purpose" attribute name for the summary of the intentions with which the resource(s) was developed. |
static String |
REFERENCES
The "references" attribute name for bibliographical references. |
static String |
STANDARD_NAME
The "standard_name" attribute name for a long descriptive name for the variable taken from a controlled vocabulary of variable names. |
static String |
STANDARD_NAME_VOCABULARY
The "standard_name_vocabulary" attribute name for indicating which controlled list of variable names has been used in the "standard_name" attribute. |
static String |
SUMMARY
The "summary" attribute name for a paragraph describing the dataset (Highly Recommended). |
static NetcdfTranscoder.Dimension |
TIME
The set of attribute names for the start and end times of the bounding box, resolution and units. |
static String |
TITLE
The "title" attribute name for a short description of the dataset (Highly Recommended). |
static String |
TOPIC_CATEGORY
The "topic_category" attribute name for a high-level geographic data thematic classification. |
static NetcdfTranscoder.Dimension |
VERTICAL
The set of attribute names for the minimal and maximal elevations of the bounding box, resolution and units. |
static String |
VOCABULARY
The "keywords_vocabulary" attribute name for the guideline for the words/phrases in the "keywords" attribute (Recommended). |
| Fields inherited from interface WarningProducer |
|---|
LOGGER |
| Constructor Summary | |
|---|---|
NetcdfTranscoder(NetcdfFile file,
WarningProducer owner)
Creates a new NetCDF to ISO mapper for the given file. |
|
| Method Summary | |
|---|---|
protected Band |
createSampleDimension(VariableSimpleIF variable)
Creates a <gmd:dimension> element from the given NetCDF variable. |
protected GridSpatialRepresentation |
createSpatialRepresentationInfo(CoordinateSystem cs)
Creates a <gmd:spatialRepresentationInfo> element from the given NetCDF coordinate
system. |
protected Attribute |
getAttribute(Group group,
String name)
Returns the NetCDF attribute of the given name in the given group, or null if none. |
Identifier |
getFileIdentifier()
Returns a globally unique identifier for the current NetCDF file. |
protected String |
getKeywordSeparator(Group group)
Returns the string to use as a keyword separator. |
Metadata |
readMetadata()
Creates an ISO Metadata object from the information found in the NetCDF file. |
| Methods inherited from class MetadataTranscoder |
|---|
getLocale, warningOccurred |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TITLE
NetcdfTranscoder will look for "full_name" and "name".
Path:
NetcdfFile.getTitle(),
UCAR reference,
Constant Field Valuespublic static final String SUMMARY
Path:
public static final String IDENTIFIER
Path:
getFileIdentifier(),
NetcdfFile.getId(),
UCAR reference,
Constant Field Valuespublic static final String NAMING_AUTHORITY
Path:
IDENTIFIER,
getFileIdentifier(),
UCAR reference,
Constant Field Valuespublic static final String STANDARD_NAME
Path:
STANDARD_NAME_VOCABULARY,
KEYWORDS,
UCAR reference,
Constant Field Valuespublic static final String STANDARD_NAME_VOCABULARY
Path:
STANDARD_NAME,
VOCABULARY,
UCAR reference,
Constant Field Valuespublic static final String KEYWORDS
Path:
VOCABULARY,
STANDARD_NAME,
getKeywordSeparator(Group),
UCAR reference,
Constant Field Valuespublic static final String VOCABULARY
Path:
KEYWORDS,
STANDARD_NAME_VOCABULARY,
UCAR reference,
Constant Field Valuespublic static final String TOPIC_CATEGORY
"farming", "biota", "boundaries",
"climatology meteorology atmosphere", "economy", "elevation",
"environment", "geoscientific information", "health",
"imagery base maps earth cover", "intelligence military",
"inland waters", "location", "oceans", "planning cadastre",
"society", "structure", "transportation" and
"utilitiesCommunication".
Path:
TopicCategory,
Constant Field Valuespublic static final String DATA_TYPE
"Vector", "TextTable", "Grid",
"Image", "Video", "Tin", "StereoModel", "Station",
"Swath" or "Trajectory".
Path:
SpatialRepresentationType,
UCAR reference,
Constant Field Valuespublic static final String HISTORY
Path:
public static final String COMMENT
Path:
public static final String METADATA_CREATION
NCISOMetadata"
subgroup.
Path:
public static final String DATE_CREATED
Path:
Metadata /
identificationInfo /
citation /
date /
date with DateType.CREATION
public static final String DATE_MODIFIED
Path:
Metadata /
identificationInfo /
citation /
date /
date with DateType.REVISION
public static final String DATE_ISSUED
Path:
Metadata /
identificationInfo /
citation /
date /
date with DateType.PUBLICATION
public static final NetcdfTranscoder.Responsible CREATOR
Path:
CONTRIBUTOR,
PUBLISHER,
UCAR referencepublic static final NetcdfTranscoder.Responsible CONTRIBUTOR
Path:
CREATOR,
PUBLISHER,
UCAR referencepublic static final NetcdfTranscoder.Responsible PUBLISHER
Path:
Metadata /
distributionInfo /
distributors /
distributorContact with Role.PUBLISHERMetadata /
identificationInfo /
descriptiveKeywords /
keyword with the "dataCenter" KeywordType
CREATOR,
CONTRIBUTOR,
UCAR referencepublic static final String PROJECT
Path:
Metadata /
identificationInfo /
descriptiveKeywords /
keyword with the "project" KeywordType
public static final String PURPOSE
Path:
public static final String REFERENCES
Path:
Metadata /
identificationInfo /
citation in its own instance
public static final String PROCESSING_LEVEL
Path:
public static final String ACKNOWLEDGMENT
Path:
public static final String LICENSE
Path:
public static final String ACCESS_CONSTRAINT
"copyright", "patent",
"patent pending", "trademark", "license",
"intellectual property rights" or "restricted".
Path:
Restriction,
Constant Field Valuespublic static final String GEOGRAPHIC_IDENTIFIER
Path:
public static final NetcdfTranscoder.Dimension LATITUDE
Path:
Metadata /
identificationInfo /
extent /
geographicElement /
southBoundLatitude or
northBoundLatitudeMetadata /
spatialRepresentationInfo /
axisDimensionProperties /
resolution
LONGITUDE,
VERTICAL,
TIME,
UCAR referencepublic static final NetcdfTranscoder.Dimension LONGITUDE
Path:
Metadata /
identificationInfo /
extent /
geographicElement /
westBoundLongitude or
eastBoundLongitudeMetadata /
spatialRepresentationInfo /
axisDimensionProperties /
resolution
LATITUDE,
VERTICAL,
TIME,
UCAR referencepublic static final NetcdfTranscoder.Dimension VERTICAL
Path:
Metadata /
identificationInfo /
extent /
verticalElement /
minimumValue or
maximumValueMetadata /
spatialRepresentationInfo /
axisDimensionProperties /
resolution
LATITUDE,
LONGITUDE,
TIME,
UCAR referencepublic static final NetcdfTranscoder.Dimension TIME
Path:
Metadata /
identificationInfo /
extent /
temporalElement /
extentMetadata /
spatialRepresentationInfo /
axisDimensionProperties /
resolution
LATITUDE,
LONGITUDE,
VERTICAL,
UCAR referencepublic static final String FLAG_NAMES
Path:
public static final String FLAG_MASKS
Path:
public static final String FLAG_VALUES
Path:
public static final String FLAG_MEANINGS
Path:
protected final NetcdfFile file
| Constructor Detail |
|---|
public NetcdfTranscoder(NetcdfFile file,
WarningProducer owner)
NetcdfFile instance, the NetcdfDataset subclass is
necessary in order to get coordinate system information.
file - The NetCDF file from which to parse metadata.owner - Typically the SpatialImageReader or
SpatialImageWriter object using this
transcoder, or null.| Method Detail |
|---|
protected Attribute getAttribute(Group group,
String name)
null if none.
This method is invoked for every global and group attributes to be read by this class (but
not variable attributes), thus providing a single point where
subclasses can filter the attributes to be read. The name argument is typically (but
is not restricted too) one of the constants defined in this class.
group - The group in which to search the attribute, or null for global attributes.name - The name of the attribute to search (can not be null).
null if none.
public Identifier getFileIdentifier()
throws IOException
NetcdfFile.getId() if no identifier attribute was found.Subclasses can override this method if they need to complete the information.
null if none.
IOException - If an I/O operation was necessary but failed.
protected String getKeywordSeparator(Group group)
throws IOException
",".
Subclasses can override this method in an other separator (possibly determined from
the file content) is desired.
group - The NetCDF group from which keywords are read.
IOException - If an I/O operation was necessary but failed.
protected GridSpatialRepresentation createSpatialRepresentationInfo(CoordinateSystem cs)
throws IOException
<gmd:spatialRepresentationInfo> element from the given NetCDF coordinate
system. Subclasses can override this method if they need to complete the information
provided in the returned object.
cs - The NetCDF coordinate system.
IOException - If an I/O operation was necessary but failed.
protected Band createSampleDimension(VariableSimpleIF variable)
throws IOException
<gmd:dimension> element from the given NetCDF variable. Subclasses can
override this method if they need to complete the information provided in the returned
object.
variable - The NetCDF variable.
IOException - If an I/O operation was necessary but failed.
public Metadata readMetadata()
throws IOException
Metadata object from the information found in the NetCDF file.
readMetadata in class MetadataTranscoder<Metadata>IOException - If an I/O operation was necessary but failed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||