|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectIIOMetadataFormatImpl
SpatialMetadataFormat
public class SpatialMetadataFormat
Describes the structure of spatial metadata.
The default stream and image formats are inferred from a subset of the GeoAPI metadata interfaces, especially
Metadata and ImageDescription. Consequently those instances can be considered
as profiles of ISO 19115-2, with a few minor departures:
Band interface defined by ISO 19115-2 is used only when the values are
measurements of wavelengths in the electromagnetic spectrum, as specified in the ISO
specification. Otherwise the SampleDimension interface (which is very similar)
is used.The tree structures are show below. As a general rule, the name of elements start with a upper case letter while the name of attributes start with a lower case letter. The valid types of attributes values are listed here. For browsing these trees in an applet together with additional information, see the IIOMetadataPanel applet.
Stream metadata Image metadata geotk-coverageio_3.07 ├───DiscoveryMetadata : DataIdentification │ ├───citation │ ├───abstract │ ├───purpose │ ├───credits │ ├───status │ ├───DescriptiveKeywords : Keywords[] │ │ └───DescriptiveKeywordsEntry │ │ ├───keywords │ │ ├───thesaurusName │ │ └───type │ ├───SpatialResolution : Resolution │ │ ├───distance │ │ └───EquivalentScale │ │ └───denominator │ ├───topicCategories │ ├───environmentDescription │ ├───Extent : Extent │ │ ├───description │ │ ├───GeographicElement : GeographicBoundingBox │ │ │ ├───inclusion │ │ │ ├───westBoundLongitude │ │ │ ├───eastBoundLongitude │ │ │ ├───southBoundLatitude │ │ │ └───northBoundLatitude │ │ └───VerticalElement : VerticalExtent │ │ ├───minimumValue │ │ ├───maximumValue │ │ └───verticalCRS │ └───supplementalInformation ├───AcquisitionMetadata : AcquisitionInformation │ ├───EnvironmentalConditions : EnvironmentalRecord │ │ ├───averageAirTemperature │ │ ├───maxRelativeHumidity │ │ ├───maxAltitude │ │ └───meteorologicalConditions │ └───Platform : Platform │ ├───citation │ ├───identifier │ ├───description │ └───Instruments │ └───Instrument : Instrument │ ├───citation │ ├───Identifier : Identifier │ │ ├───code │ │ └───authority │ ├───type │ └───description └───QualityMetadata : DataQuality └───Report : Element ├───namesOfMeasure ├───measureIdentification ├───measureDescription ├───evaluationMethodType ├───evaluationMethodDescription ├───evaluationProcedure └───date geotk-coverageio_3.07 ├───ImageDescription : ImageDescription │ ├───contentType │ ├───illuminationElevationAngle │ ├───illuminationAzimuthAngle │ ├───imagingCondition │ ├───ImageQualityCode : Identifier │ │ ├───code │ │ └───authority │ ├───cloudCoverPercentage │ ├───ProcessingLevelCode : Identifier │ │ ├───code │ │ └───authority │ ├───compressionGenerationQuantity │ ├───triangulationIndicator │ ├───radiometricCalibrationDataAvailable │ ├───cameraCalibrationInformationAvailable │ ├───filmDistortionInformationAvailable │ ├───lensDistortionInformationAvailable │ ├───Dimensions : SampleDimension[] │ │ └───Dimension │ │ ├───descriptor │ │ ├───sequenceIdentifier │ │ ├───validSampleValues │ │ ├───fillSampleValues │ │ ├───minValue │ │ ├───maxValue │ │ ├───units │ │ ├───peakResponse │ │ ├───bitsPerValue │ │ ├───toneGradation │ │ ├───scaleFactor │ │ ├───offset │ │ ├───bandBoundaryDefinition │ │ ├───nominalSpatialResolution │ │ ├───transferFunctionType │ │ ├───transmittedPolarization │ │ └───detectedPolarization │ └───RangeElementDescriptions : RangeElementDescription │ └───RangeElementDescription │ ├───name │ ├───definition │ └───rangeElements ├───SpatialRepresentation : Georectified │ ├───numberOfDimensions │ ├───cellGeometry │ ├───centerPoint │ └───pointInPixel └───RectifiedGridDomain : RectifiedGrid ├───Limits : GridEnvelope │ ├───low │ └───high ├───origin ├───OffsetVectors │ └───OffsetVector │ └───values └───CoordinateReferenceSystem : CoordinateReferenceSystem ├───name ├───type ├───CoordinateSystem : CoordinateSystem │ ├───name │ ├───type │ ├───dimension │ └───Axes │ └───CoordinateSystemAxis : CoordinateSystemAxis │ ├───name │ ├───direction │ ├───minimumValue │ ├───maximumValue │ ├───rangeMeaning │ └───unit ├───Datum : Datum │ ├───name │ ├───type │ ├───Ellipsoid : Ellipsoid │ │ ├───name │ │ ├───axisAbbrev │ │ ├───axisUnit │ │ ├───semiMajorAxis │ │ ├───semiMinorAxis │ │ └───inverseFlattening │ └───PrimeMeridian : PrimeMeridian │ ├───name │ ├───greenwichLongitude │ └───angularUnit └───Conversion : Conversion ├───name ├───method └───Parameters : ParameterValueGroup └───ParameterValue : ParameterValue ├───name └───value
SpatialMetadata
| coverage/geotk-coverageio (download) | View source code for this class |
| Field Summary | |
|---|---|
static String |
FORMAT_NAME
The metadata format name, which is "geotk-coverageio_3.07". |
static SpatialMetadataFormat |
IMAGE
Deprecated. Replaced by call to getImageInstance(FORMAT_NAME). |
static String |
ISO_FORMAT_NAME
The ISO-19115 format name, which is "ISO-19115". |
static SpatialMetadataFormat |
STREAM
Deprecated. Replaced by call to getStreamInstance(FORMAT_NAME). |
| Fields inherited from class IIOMetadataFormatImpl |
|---|
standardMetadataFormatName |
| Constructor Summary | |
|---|---|
protected |
SpatialMetadataFormat(String rootName)
Creates an initially empty format. |
| Method Summary | ||
|---|---|---|
protected void |
addTree(MetadataStandard standard,
Class<?> type,
Map<Class<?>,Class<?>> substitution)
Deprecated. Replaced by SpatialMetadataFormatBuilder. |
|
protected void |
addTree(MetadataStandard standard,
Class<?> type,
String elementName,
String parentName,
Map<Class<?>,Class<?>> substitution)
Deprecated. Replaced by SpatialMetadataFormatBuilder. |
|
boolean |
canNodeAppear(String elementName,
ImageTypeSpecifier imageType)
Returns true if the element (and the subtree below it) is allowed to appear
in a metadata document for an image of the given type. |
|
String |
getAttributeDescription(String elementName,
String attrName,
Locale locale)
Returns a description of the named attribute, or null. |
|
|
getDefaultValue(Class<T> type)
Returns the default value for an object reference of the given type. |
|
String |
getElementDescription(String elementName,
Locale locale)
Returns a description of the named element, or null. |
|
String |
getElementParent(String elementName)
Returns the element which is the parent of the named element, or null if none. |
|
String |
getElementPath(String elementName)
Returns the path to the named element, or null if none. |
|
MetadataStandard |
getElementStandard(String elementName)
Returns the metadata standard implemented by the element of the given name. |
|
static SpatialMetadataFormat |
getImageInstance(String name)
Returns the image metadata format for the given name. |
|
static SpatialMetadataFormat |
getStreamInstance(String name)
Returns the stream metadata format for the given name. |
|
protected void |
removeAttribute(String elementName,
String attributeName)
Removes an attribute from a previously defined element. |
|
protected void |
removeElement(String elementName)
Removes an element from the format. |
|
String |
toString()
Returns a string representation of this format. |
|
TreeTableNode |
toTreeTable(Locale locale)
Returns a tree table representation of this metadata standard. |
|
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String FORMAT_NAME
javax.imageio.metadata package
description requires that we provide a version number as part of the format name. The
version number provided in this constant is set to the last Geotk version when this
format has been modified, and may change in any future version.
public static final String ISO_FORMAT_NAME
NetcdfImageReader.
For applications that don't need to full verbosity of ISO 19115, consider using the
stream metadata instance identified by the
FORMAT_NAME name instead.
@Deprecated public static final SpatialMetadataFormat STREAM
getStreamInstance(FORMAT_NAME).
@Deprecated public static final SpatialMetadataFormat IMAGE
getImageInstance(FORMAT_NAME).
| Constructor Detail |
|---|
protected SpatialMetadataFormat(String rootName)
addFoo(...) methods defined in this class or parent class for
adding new elements and attributes.
rootName - the name of the root element.| Method Detail |
|---|
public static SpatialMetadataFormat getStreamInstance(String name)
name - The FORMAT_NAME or ISO_FORMAT_NAME constant, or null
for the default format (currently "geotk-coverageio_3.07").
IllegalArgumentException - If the given name is not one of the supported constants.public static SpatialMetadataFormat getImageInstance(String name)
name - The FORMAT_NAME constant, or null
for the default format (currently "geotk-coverageio_3.07").
IllegalArgumentException - If the given name is not one of the supported constants.
@Deprecated
protected void addTree(MetadataStandard standard,
Class<?> type,
Map<Class<?>,Class<?>> substitution)
SpatialMetadataFormatBuilder.
addTree(MetadataStandard, Class, String, String, Map),
except that the element is added at the root and the name is inferred from the given type
for convenience.
standard - The metadata standard of the element or attribute to be added.type - The type of the element or attribute to be added.substitution - The map of children types to substitute by other types, or null.
@Deprecated
protected void addTree(MetadataStandard standard,
Class<?> type,
String elementName,
String parentName,
Map<Class<?>,Class<?>> substitution)
SpatialMetadataFormatBuilder.
Element type
This method expects a type argument, which can be a CodeList subclass,
one of the interfaces member of the given metadata standard, or a simple JSE
type (boolean, number of String). Do not specify collection
types, since the type of collection elements can not be inferred easily. To specify
a multi-occurrence, use the array type instead (e.g. CoordinateSystemAxis[].class).
Substitution map
This method can be given an optional substitution map. If this map is non
null, then every occurrence of a class in the set of keys is replaced by the associated
class in the collection of values. The purpose of this map is to:
Replace a base class by some specialized subclass. Since IIOMetadata is
about grided data (not generic Features), the exact subtype is often known at
compile time, and we want the additional attributes to be declared unconditionally.
Example:
substitution.put(RangeDimension.class, Band.class);
Exclude a particular class by setting the replacement to null. This is used
for excluding large tree of metadata which may not be applicable. Example:
substitution.put(Objective.class, null);
Replace an element class (including the whole tree behind it) by a single attribute.
This simplification is especially useful for Citation because they typically appear
in many different places with the same name ("citation"), while Image I/O does
not allow many elements to have the same name (actually this is not strictly forbidden, but
the getter methods return information only about the first occurrence of a given name).
Converting an element to an attribute allow it to appear with the same name under different
nodes, and can make the tree considerably simpler (at the cost of losing all the sub-tree
below the converted element). Example:
substitution.put(Citation.class, String.class);
Replace a collection by a singleton, by setting the source type to an array and the target type to the element of that array. This is useful when a collection seems an overkill for the specific case of stream or image metadata. Example:
substitution.put(Identification[].class, Identification.class);
standard - The metadata standard of the element or attribute to be added.type - The type of the element or attribute to be added (see javadoc).elementName - The name of the element or attribute node to be added.parentName - The name of the parent node to where to add the child.substitution - The map of children types to substitute by other types (see javadoc),
or null if none.
protected void removeAttribute(String elementName,
String attributeName)
removeAttribute in class IIOMetadataFormatImplelementName - The name of the element.attributeName - The name of the attribute being removed.protected void removeElement(String elementName)
removeElement in class IIOMetadataFormatImplelementName - the name of the element to be removed.
public boolean canNodeAppear(String elementName,
ImageTypeSpecifier imageType)
true if the element (and the subtree below it) is allowed to appear
in a metadata document for an image of the given type. The default implementation
always returns true.
canNodeAppear in interface IIOMetadataFormatcanNodeAppear in class IIOMetadataFormatImplpublic String getElementParent(String elementName)
null if none.
For example if this metadata format is the stream
instance, then:
"GeographicElement" is "DiscoveryMetadata/Extent/GeographicElement"."GeographicElement" returned by this method is "Extent".Note: An element may have more than one parent, since the same element can be copied under many nodes usingaddChildElement(...). In such case, this method returns only the first path. Such cases do not occur with the Geotk formats identified byFORMAT_NAMEin this class, but occur with the more complex ISO-19115 format.
elementName - The element for which the parent is desired.
null.getElementPath(String)public String getElementPath(String elementName)
null if none. For example if this
metadata format is the stream instance, then the path to the
"GeographicElement" is "DiscoveryMetadata/Extent/GeographicElement".
Note: An element may have more than one path, since the same element can be copied under many nodes usingaddChildElement(...). In such case, this method returns only the first path. Such cases do not occur with the Geotk formats identified byFORMAT_NAMEin this class, but occur with the more complex ISO-19115 format.
elementName - The element for which the path is desired.
null.getElementParent(String)public MetadataStandard getElementStandard(String elementName)
SpatialMetadataFormatBuilder method),
then this method returns null.
elementName - The element for which the standard is desired.
null.
public String getElementDescription(String elementName,
Locale locale)
null. The description will be
localized for the supplied locale if possible.
The default implementation first queries the description map associated with the metadata standard. If no description is found, then the super-class implementation is used.
getElementDescription in interface IIOMetadataFormatgetElementDescription in class IIOMetadataFormatImplelementName - The name of the element.locale - The Locale for which localization will be attempted, or null.
public String getAttributeDescription(String elementName,
String attrName,
Locale locale)
null. The description will be
localized for the supplied locale if possible.
The default implementation first queries the description map associated with the metadata standard. If no description is found, then the super-class implementation is used.
getAttributeDescription in interface IIOMetadataFormatgetAttributeDescription in class IIOMetadataFormatImplelementName - The name of the element.attrName - The name of the attribute.locale - The Locale for which localization will be attempted, or null.
public <T> T getDefaultValue(Class<T> type)
SpatialMetadataFormatBuilder for determining the value
of the defaultValue argument in the call to the addObjectValue method.
This method is also invoked by ReferencingBuilder.getDefault(Class), which does not
rely on IIOMetadataFormat.getObjectDefaultValue(String) because the default value of
some referencing objects depends on the type of the enclosing element. For example the default
coordinate system shall be ellipsoidal for a geographic CRS and Cartesian for a projected
CRS.
The default implementation returns a value determined from the table below. Subclasses can override this method for providing different default values.
T - The compile-time type of classType.type - The class type of the object for which to get a default value.
null if none.ReferencingBuilder.getDefault(Class),
IIOMetadataFormatImpl.getObjectDefaultValue(String)public TreeTableNode toTreeTable(Locale locale)
MetadataTreeTable.
locale - The locale for which localization will be attempted, or null.
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||