|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.coverage.io.MetadataBuilder
Helper class for creating OpenGIS's object from a set of metadata. Metadata are
key-value pairs, for example . There is a wide
variety of ways to contruct OpenGIS's objects from key-value pairs, and
supporting them is not always straightforward. The class
tries to make the work easier. It defines a set of format-neutral keys (i.e. keys not
related to any specific file format). Before parsing a file, the mapping between
format-neutral keys and "real" keys used in a particuler file format must
be specified. This mapping is constructed with calls to addAlias(org.geotools.coverage.io.MetadataBuilder.Key, java.lang.String)
. For example,
one may want to parse the following informations:
Before to be used for parsing such informations, a object must be setup using the following code:XMinimum = 217904.31 YMaximum = 5663495.1 XResolution = 1000.0000 YResolution = 1000.0000 Units = meters Projection = Mercator_1SP Central meridian = -15.2167 Latitude of origin = 28.0667 False easting = 0.00000000 False northing = 0.00000000 Ellipsoid = Clarke 1866 Datum = Clarke 1866
Once the mapping is etablished, provides a set of methods for constructing various objects from those informations. For example, theaddAlias(X_MINIMUM
, "XMinimum"); addAlias(Y_MAXIMUM
, "YMaximum"); addAlias(X_RESOLUTION
, "XResolution"); addAlias(Y_RESOLUTION
, "YResolution"); // etc...
getCoordinateReferenceSystem()
method constructs a CoordinateReferenceSystem
object using available informations.
Nested Class Summary | |
static class |
MetadataBuilder.Key
A key for fetching metadata in a format independent way. |
Field Summary | |
static MetadataBuilder.Key |
CENTRAL_MERIDIAN
Key for the projection parameter. |
static MetadataBuilder.Key |
COORDINATE_REFERENCE_SYSTEM
Key for the coordinate reference system. |
static MetadataBuilder.Key |
DATUM
Key for the coordinate reference system's datum. |
static MetadataBuilder.Key |
DEPTH
Key for the image's "depth" in pixels. |
static MetadataBuilder.Key |
ELLIPSOID
Key for the coordinate reference system ellipsoid. |
static MetadataBuilder.Key |
FALSE_EASTING
Key for the projection parameter. |
static MetadataBuilder.Key |
FALSE_NORTHING
Key for the projection parameter. |
static MetadataBuilder.Key |
HEIGHT
Key for the image's height in pixels. |
static MetadataBuilder.Key |
LATITUDE_OF_ORIGIN
Key for the projection parameter. |
static MetadataBuilder.Key |
OPERATION_METHOD
Key for the operation method. |
static MetadataBuilder.Key |
PROJECTION
Key for the projection. |
static MetadataBuilder.Key |
SEMI_MAJOR
Key for the projection parameter. |
static MetadataBuilder.Key |
SEMI_MINOR
Key for the projection parameter. |
static MetadataBuilder.Key |
UNITS
Key for the coordinate system axis units. |
static MetadataBuilder.Key |
WIDTH
Key for the image's width in pixels. |
static MetadataBuilder.Key |
X_MAXIMUM
Key for the maximal x value (eastern limit). |
static MetadataBuilder.Key |
X_MINIMUM
Key for the minimal x value (western limit). |
static MetadataBuilder.Key |
X_RESOLUTION
Key for the resolution among the x axis. |
static MetadataBuilder.Key |
Y_MAXIMUM
Key for the maximal y value (northern limit). |
static MetadataBuilder.Key |
Y_MINIMUM
Key for the minimal y value (southern limit). |
static MetadataBuilder.Key |
Y_RESOLUTION
Key for the resolution among the y axis. |
static MetadataBuilder.Key |
Z_MAXIMUM
Key for the maximal z value. |
static MetadataBuilder.Key |
Z_MINIMUM
Key for the minimal z value. |
static MetadataBuilder.Key |
Z_RESOLUTION
Key for the resolution among the z axis. |
Constructor Summary | |
MetadataBuilder()
Constructs a new using default factories. |
|
MetadataBuilder(FactoryGroup factories)
Constructs a new using the specified factories. |
Method Summary | |
void |
add(org.opengis.coverage.grid.GridCoverage coverage)
Add all metadata from the specified grid coverage. |
void |
add(javax.media.jai.PropertySource properties,
java.lang.String prefix)
Add metadata from the specified property source. |
void |
add(java.awt.image.RenderedImage image)
Add all metadata from the specified image. |
void |
add(java.lang.String alias,
java.lang.Object value)
Add a metadata for the specified key. |
void |
addAlias(MetadataBuilder.Key key,
java.lang.String alias)
Add an alias to a key. |
void |
clear()
Clears this metadata set. |
boolean |
contains(MetadataBuilder.Key key)
Checks if this contains a value for the specified key. |
java.lang.Object |
get(MetadataBuilder.Key key)
Returns the metadata for the specified key. |
java.lang.String[] |
getAlias(MetadataBuilder.Key key)
Returns the list of alias for the specified key, or if the key has no alias. |
java.util.Date |
getAsDate(MetadataBuilder.Key key)
Returns a metadata as a Date value. |
double |
getAsDouble(MetadataBuilder.Key key)
Returns a metadata as a value. |
int |
getAsInt(MetadataBuilder.Key key)
Returns a metadata as a value. |
org.opengis.referencing.crs.CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the coordinate reference system. |
org.opengis.referencing.datum.Ellipsoid |
getEllipsoid()
Returns the ellipsoid. |
org.opengis.spatialschema.geometry.Envelope |
getEnvelope()
Returns the envelope. |
java.lang.String |
getFormatPattern(java.lang.Class type)
Returns the pattern used for parsing and formatting values of the specified type. |
org.opengis.referencing.datum.GeodeticDatum |
getGeodeticDatum()
Returns the geodetic datum. |
org.opengis.metadata.extent.GeographicBoundingBox |
getGeographicBoundingBox()
Convenience method returning the envelope in geographic coordinate system using WGS 1984 datum. |
org.opengis.coverage.grid.GridRange |
getGridRange()
Returns the grid range. |
java.util.Locale |
getLocale()
Returns the locale to use when parsing metadata values as numbers, angles or dates. |
org.opengis.referencing.operation.Conversion |
getProjection()
Returns the projection. |
org.opengis.coverage.SampleDimension[] |
getSampleDimensions()
Returns the sample dimensions for each band of the GridCoverage
to be read. |
java.lang.String |
getSeparator()
Returns the characters to use as separator between keys and values. |
java.lang.String |
getSource()
Returns the source file name or URL. |
javax.units.Unit |
getUnit()
Returns the units. |
void |
listMetadata(java.io.Writer out)
List all metadata to the specified stream. |
protected void |
load(java.io.BufferedReader in)
Reads all metadata from a stream. |
void |
load(java.io.File header)
Reads all metadata from a text file. |
void |
load(java.net.URL header)
Reads all metadata from an URL. |
protected boolean |
parseLine(java.lang.String line)
Parses a line and add the key-value pair to this metadata set. |
void |
setFormatPattern(java.lang.Class type,
java.lang.String pattern)
Set the pattern to use for parsing and formatting values of the specified type. |
void |
setSeparator(java.lang.String separator)
Set the characters to use as separator between keys and values. |
java.lang.String |
toString()
Returns a string representation of this metadata set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final MetadataBuilder.Key COORDINATE_REFERENCE_SYSTEM
getCoordinateReferenceSystem()
method looks for this metadata.
UNITS
,
DATUM
,
PROJECTION
public static final MetadataBuilder.Key UNITS
getUnit()
method looks for this metadata. The following heuristic
rule may be applied in order to infer the CRS from the units:
ELLIPSOID
,
DATUM
,
PROJECTION
,
COORDINATE_REFERENCE_SYSTEM
public static final MetadataBuilder.Key DATUM
getGeodeticDatum()
method looks for this metadata.
UNITS
,
ELLIPSOID
,
PROJECTION
,
COORDINATE_REFERENCE_SYSTEM
public static final MetadataBuilder.Key ELLIPSOID
getEllipsoid()
method looks for this metadata.
UNITS
,
DATUM
,
PROJECTION
,
COORDINATE_REFERENCE_SYSTEM
public static final MetadataBuilder.Key OPERATION_METHOD
getProjection()
method looks for this metadata. The operation method name determines the math transform implementation and its list
of parameters. This name is the projection classification.
If this metadata is not defined, then the operation name is inferred from the projection name.
PROJECTION
,
COORDINATE_REFERENCE_SYSTEM
public static final MetadataBuilder.Key PROJECTION
getProjection()
method looks
for this metadata. If the metadata is not defined, then the projection name is assumed
the same than the operation method name.
SEMI_MAJOR
,
SEMI_MINOR
,
LATITUDE_OF_ORIGIN
,
CENTRAL_MERIDIAN
,
FALSE_EASTING
,
FALSE_NORTHING
public static final MetadataBuilder.Key SEMI_MAJOR
getProjection()
.
SEMI_MINOR
,
LATITUDE_OF_ORIGIN
,
CENTRAL_MERIDIAN
,
FALSE_EASTING
,
FALSE_NORTHING
,
PROJECTION
public static final MetadataBuilder.Key SEMI_MINOR
getProjection()
.
SEMI_MAJOR
,
LATITUDE_OF_ORIGIN
,
CENTRAL_MERIDIAN
,
FALSE_EASTING
,
FALSE_NORTHING
,
PROJECTION
public static final MetadataBuilder.Key LATITUDE_OF_ORIGIN
getProjection()
.
SEMI_MAJOR
,
SEMI_MINOR
,
CENTRAL_MERIDIAN
,
FALSE_EASTING
,
FALSE_NORTHING
,
PROJECTION
public static final MetadataBuilder.Key CENTRAL_MERIDIAN
getProjection()
.
SEMI_MAJOR
,
SEMI_MINOR
,
LATITUDE_OF_ORIGIN
,
FALSE_EASTING
,
FALSE_NORTHING
,
PROJECTION
public static final MetadataBuilder.Key FALSE_EASTING
getProjection()
.
SEMI_MAJOR
,
SEMI_MINOR
,
LATITUDE_OF_ORIGIN
,
CENTRAL_MERIDIAN
,
FALSE_NORTHING
,
PROJECTION
public static final MetadataBuilder.Key FALSE_NORTHING
getProjection()
.
SEMI_MAJOR
,
SEMI_MINOR
,
LATITUDE_OF_ORIGIN
,
CENTRAL_MERIDIAN
,
FALSE_EASTING
,
PROJECTION
public static final MetadataBuilder.Key X_MINIMUM
getEnvelope()
method looks for this metadata in order to set the
minimal coordinate for dimension 0.
X_MAXIMUM
,
Y_MINIMUM
,
Y_MAXIMUM
,
X_RESOLUTION
,
Y_RESOLUTION
public static final MetadataBuilder.Key Y_MINIMUM
getEnvelope()
method looks for this metadata. in order to set the
minimal coordinate for dimension 1.
X_MINIMUM
,
X_MAXIMUM
,
Y_MAXIMUM
,
X_RESOLUTION
,
Y_RESOLUTION
public static final MetadataBuilder.Key Z_MINIMUM
getEnvelope()
method looks for this metadata in order to set the
minimal coordinate for dimension 2.
Z_MAXIMUM
,
Z_RESOLUTION
,
DEPTH
public static final MetadataBuilder.Key X_MAXIMUM
getEnvelope()
method looks for this metadata in order to set the
maximal coordinate for dimension 0.
X_MINIMUM
,
Y_MINIMUM
,
Y_MAXIMUM
,
X_RESOLUTION
,
Y_RESOLUTION
public static final MetadataBuilder.Key Y_MAXIMUM
getEnvelope()
method looks for this metadata in order to set the
maximal coordinate for dimension 1.
X_MINIMUM
,
X_MAXIMUM
,
Y_MINIMUM
,
X_RESOLUTION
,
Y_RESOLUTION
public static final MetadataBuilder.Key Z_MAXIMUM
getEnvelope()
method looks for this metadata in order to set the
maximal coordinate for dimension 2.
Z_MINIMUM
,
Z_RESOLUTION
,
DEPTH
public static final MetadataBuilder.Key X_RESOLUTION
getEnvelope()
method looks
for this metadata in order to infer the coordinates for dimension 0.
X_MINIMUM
,
X_MAXIMUM
,
Y_MINIMUM
,
Y_MAXIMUM
,
Y_RESOLUTION
public static final MetadataBuilder.Key Y_RESOLUTION
getEnvelope()
method looks
for this metadata in order to infer the coordinates for dimension 1.
X_MINIMUM
,
X_MAXIMUM
,
Y_MINIMUM
,
Y_MAXIMUM
,
X_RESOLUTION
,
WIDTH
,
HEIGHT
public static final MetadataBuilder.Key Z_RESOLUTION
getEnvelope()
method looks
for this metadata in order to infer the coordinates for dimension 2.
Z_MINIMUM
,
Z_MAXIMUM
,
DEPTH
public static final MetadataBuilder.Key WIDTH
getGridRange()
method looks for this
metadata in order to infer the grid size along the
dimension 0.
HEIGHT
,
X_RESOLUTION
,
Y_RESOLUTION
public static final MetadataBuilder.Key HEIGHT
getGridRange()
method looks for this
metadata in order to infer the grid size along the
dimension 1.
WIDTH
,
X_RESOLUTION
,
Y_RESOLUTION
public static final MetadataBuilder.Key DEPTH
getGridRange()
method looks for this metadata in order to infer the
grid size along the dimension 2.
Z_MINIMUM
,
Z_MAXIMUM
,
Z_RESOLUTION
Constructor Detail |
public MetadataBuilder()
public MetadataBuilder(FactoryGroup factories)
Method Detail |
public java.lang.String getSeparator()
listMetadata(java.io.Writer)
, but will be ignored
when parsing with parseLine(java.lang.String)
. The default value is " = "
.
public void setSeparator(java.lang.String separator)
public java.lang.String getFormatPattern(java.lang.Class type)
DecimalFormat
.SimpleDateFormat
.In any case, this method returns if this object should use the default pattern for the data locale.
type
- The data type ( or ).
IllegalArgumentException
- if is not valid.public void setFormatPattern(java.lang.Class type, java.lang.String pattern)
Number.class
,
then should be a DecimalFormat
pattern (example:
).Date.class
,
then should be a SimpleDateFormat
pattern
(example: ).
type
- The data type ( or ).pattern
- The format pattern for the specified data type, or
for the default locale-dependent pattern.
IllegalArgumentException
- if is not valid.public void clear()
public void load(java.io.File header) throws java.io.IOException
load(BufferedReader)
. Note that this method do not invokes clear()
prior the loading. Consequently, the loaded metadata will be added to the set of
existing metadata.
header
- The file to read until EOF.
IOException
- if an error occurs during loading.clear()
,
load(URL)
,
parseLine(java.lang.String)
,
getSource()
public void load(java.net.URL header) throws java.io.IOException
load(BufferedReader)
. Note that this method do not invokes clear()
prior the loading. Consequently, the loaded metadata will be added to the set of
existing metadata.
header
- The URL to read until EOF.
IOException
- if an error occurs during loading.clear()
,
load(File)
,
parseLine(java.lang.String)
,
getSource()
protected void load(java.io.BufferedReader in) throws java.io.IOException
parseLine(java.lang.String)
for each non-empty line found in the stream. Notes:
source
metadata.clear()
prior the loading.
in
- The stream to read until EOF. The stream will not be closed.
IOException
- if an error occurs during loading.clear()
,
load(File)
,
load(URL)
,
parseLine(java.lang.String)
protected boolean parseLine(java.lang.String line) throws javax.imageio.IIOException
Then, the default implementation will translate this line in the following call:Ellipsoid = WGS 1984
This method returns if it has consumed the line, or otherwise. A line is "consumed" if has either added the key-value pair (usingadd
("Ellipsoid", "WGS 1984");
add(org.opengis.coverage.grid.GridCoverage)
), or determined that the line must be ignored (for example because
detected a character announcing a comment line). A "consumed" line
will not receive any further treatment. The line is not consumed (i.e. this method returns
) if don't know what to do with it. Non-consumed line
will typically go up in a chain of methods (if
has been subclassed) until someone consume it.
line
- The line to parse.
IIOException
- if the line is badly formatted.
AmbiguousMetadataException
- if a different value was already defined for the same
metadata name.load(File)
,
load(URL)
,
add(String,Object)
public void add(org.opengis.coverage.grid.GridCoverage coverage) throws AmbiguousMetadataException
listMetadata(java.io.Writer)
as a way to format the metadata for an arbitrary grid coverage.
The default implementation performs the following step:
addAlias(key, alias)
, fetchs
a value with key.{linkplain Key#getValue getValue}(coverage)
.
coverage
- The grid coverage with metadata to add to this .
AmbiguousMetadataException
- if a metadata is defined twice.add(RenderedImage)
,
add(PropertySource,String)
,
add(String,Object)
,
listMetadata(java.io.Writer)
public void add(java.awt.image.RenderedImage image) throws AmbiguousMetadataException
image
- The image with metadata to add to this .
AmbiguousMetadataException
- if a metadata is defined twice.add(GridCoverage)
,
add(PropertySource,String)
,
add(String,Object)
public void add(javax.media.jai.PropertySource properties, java.lang.String prefix) throws AmbiguousMetadataException
properties
- The properties source.prefix
- The prefix for properties to add, of to add
all properties. If non-null, only properties begining with this prefix
will be added.
AmbiguousMetadataException
- if a metadata is defined twice.add(GridCoverage)
,
add(RenderedImage)
,
add(String,Object)
public void add(java.lang.String alias, java.lang.Object value) throws AmbiguousMetadataException
alias
- The key for the metadata to add. This is usually the name found in the
file to be parsed (this is different from MetadataBuilder.Key
objects, which are keys
in a format neutral way). This key is usually, but not always, one of the alias
defined with addAlias(org.geotools.coverage.io.MetadataBuilder.Key, java.lang.String)
.value
- The value for the metadata to add. If or
Image#UndefinedProperty
, then this method do nothing.
AmbiguousMetadataException
- if a different value already exists for the specified
alias, or for an other alias bound to the same MetadataBuilder.Key
.add(GridCoverage)
,
add(RenderedImage)
,
add(PropertySource,String)
,
parseLine(java.lang.String)
public void addAlias(MetadataBuilder.Key key, java.lang.String alias) throws AmbiguousMetadataException
get
(key)
will really looks for metadata named .
Alias are mandatory in order to get various methods to work for a
particular file format.
For example if the file to be parsed uses the names and for the
coordinate of the upper left corner, then the getEnvelope()
method will not work
unless the following alias are set:
An arbitrary number of alias can be set for the same key. For example,addAlias(X_MINIMUM, "ULX"); addAlias(Y_MAXIMUM, "ULY");
addAlias(Y_MAXIMUM, ...)
could be invoked twice with and
alias. The methods will try alias in the order they
were added and use the first value found.
The same alias can also be set to more than one key. For example, the following code is legal. It means that pixel are square with the same horizontal and vertical resolution:
addAlias(X_RESOLUTION, "Resolution"); addAlias(Y_RESOLUTION, "Resolution");
key
- The key to add an alias. This key is format neutral.alias
- The alias to add. This is the name actually used in the file to be parsed.
Alias are case insensitive and ignore multiple whitespace, like keys. If
this alias is already bound to the specified key, then this method do nothing.
AmbiguousMetadataException
- if the addition of the supplied alias
would introduce an ambiguity in the current set of metadata.
This occurs if the key has already an alias mapping to a different value.getAlias(org.geotools.coverage.io.MetadataBuilder.Key)
,
contains(org.geotools.coverage.io.MetadataBuilder.Key)
,
get(org.geotools.coverage.io.MetadataBuilder.Key)
public boolean contains(MetadataBuilder.Key key)
get(org.geotools.coverage.io.MetadataBuilder.Key)
will thrown a MissingMetadataException
if and only
if contains(org.geotools.coverage.io.MetadataBuilder.Key)
returns for the same key.
key
- The key to test for inclusion in this .
get(org.geotools.coverage.io.MetadataBuilder.Key)
,
addAlias(org.geotools.coverage.io.MetadataBuilder.Key, java.lang.String)
public java.lang.Object get(MetadataBuilder.Key key) throws MissingMetadataException
MetadataBuilder.Key
argument. In order to maps the key to the actual name used in
the underlying metadata file, the method addAlias(org.geotools.coverage.io.MetadataBuilder.Key, java.lang.String)
must have
been invoked prior to any method.
key
- The key of the desired metadata. Keys are case insensitive and format neutral.
MissingMetadataException
- if no value exists for the specified key.getAsDouble(org.geotools.coverage.io.MetadataBuilder.Key)
,
getAsInt(org.geotools.coverage.io.MetadataBuilder.Key)
,
contains(org.geotools.coverage.io.MetadataBuilder.Key)
,
addAlias(org.geotools.coverage.io.MetadataBuilder.Key, java.lang.String)
public double getAsDouble(MetadataBuilder.Key key) throws MetadataException
get
(key)
and parse the resulting value with
NumberFormat#parse(String)
for the current locale.
key
- The key of the desired metadata. Keys are case-insensitive.
MissingMetadataException
- if no value exists for the specified key.
MetadataException
- if the value can't be parsed as a .getAsInt(org.geotools.coverage.io.MetadataBuilder.Key)
,
get(org.geotools.coverage.io.MetadataBuilder.Key)
,
contains(org.geotools.coverage.io.MetadataBuilder.Key)
,
addAlias(org.geotools.coverage.io.MetadataBuilder.Key, java.lang.String)
public int getAsInt(MetadataBuilder.Key key) throws MetadataException
getAsDouble
(key)
and make sure
that the resulting value is an integer.
key
- The key of the desired metadata. Keys are case-insensitive.
MissingMetadataException
- if no value exists for the specified key.
MetadataException
- if the value can't be parsed as an .getAsDouble(org.geotools.coverage.io.MetadataBuilder.Key)
,
get(org.geotools.coverage.io.MetadataBuilder.Key)
,
contains(org.geotools.coverage.io.MetadataBuilder.Key)
,
addAlias(org.geotools.coverage.io.MetadataBuilder.Key, java.lang.String)
public java.util.Date getAsDate(MetadataBuilder.Key key) throws MetadataException
Date
value. The default implementation
invokes get
(key)
and parse the resulting value with
DateFormat#parse(String)
for the current locale.
key
- The key of the desired metadata. Keys are case-insensitive.
Date
.
MissingMetadataException
- if no value exists for the specified key.
MetadataException
- if the value can't be parsed as a date.public java.lang.String[] getAlias(MetadataBuilder.Key key)
key
- The format neutral key.
addAlias(org.geotools.coverage.io.MetadataBuilder.Key, java.lang.String)
public java.lang.String getSource() throws MetadataException
MetadataException
- if this information can't be fetched.public java.util.Locale getLocale() throws MetadataException
Locale#US
, since it is the format used
in most data file.
MetadataException
- if this information can't be fetched.getAsDouble(org.geotools.coverage.io.MetadataBuilder.Key)
,
getAsInt(org.geotools.coverage.io.MetadataBuilder.Key)
,
getAsDate(org.geotools.coverage.io.MetadataBuilder.Key)
public javax.units.Unit getUnit() throws MetadataException
get(UNITS)
and transform the resulting string into an Unit
object.
MissingMetadataException
- if no value exists for the UNITS
key.
MetadataException
- if the operation failed for some other reason.getCoordinateReferenceSystem()
public org.opengis.referencing.datum.GeodeticDatum getGeodeticDatum() throws MetadataException
get(DATUM)
and transform the resulting string into a GeodeticDatum
object.
MissingMetadataException
- if no value exists for the DATUM
key.
MetadataException
- if the operation failed for some other reason.getCoordinateReferenceSystem()
,
getEllipsoid()
public org.opengis.referencing.datum.Ellipsoid getEllipsoid() throws MetadataException
get(ELLIPSOID)
and transform the resulting string into an Ellipsoid
object.
MissingMetadataException
- if no value exists for the ELLIPSOID
key.
MetadataException
- if the operation failed for some other reason.getCoordinateReferenceSystem()
,
getGeodeticDatum()
public org.opengis.referencing.operation.Conversion getProjection() throws MetadataException
get(OPERATION_METHOD)
, or with
get(PROJECTION)
if no value were
defined for the former.addAlias(SEMI_MAJOR, ...)
getEllipsoid()
and uses its semi-axis length.PROJECTION
, then takes it as
the projection name. The projection name is for documentation purpose only and do
not affect any computation. If there is no value for PROJECTION
, then
the projection name will be the same than the operation method name (the first step
above).
MissingMetadataException
- if no value exists for the PROJECTION
or the
OPERATION_METHOD
keys.
MetadataException
- if the operation failed for some other reason
(for example if a parameter value can't be parsed as a ).getCoordinateReferenceSystem()
,
SEMI_MAJOR
,
SEMI_MINOR
,
LATITUDE_OF_ORIGIN
,
CENTRAL_MERIDIAN
,
FALSE_EASTING
,
FALSE_NORTHING
public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem() throws MetadataException
getUnit()
, getGeodeticDatum()
and
getProjection()
. The coordinate system name (optional) will be fetch from
metadata COORDINATE_REFERENCE_SYSTEM
, if presents as a string.
MissingMetadataException
- if a required value is missing
(e.g. PROJECTION
, DATUM
, UNITS
, etc.).
MetadataException
- if the operation failed for some other reason.getUnit()
,
getGeodeticDatum()
,
getProjection()
public org.opengis.metadata.extent.GeographicBoundingBox getGeographicBoundingBox() throws MetadataException
MetadataException
- if the operation failed. This exception
may contains a TransformException
as its cause.getEnvelope()
,
getGridRange()
public org.opengis.spatialschema.geometry.Envelope getEnvelope() throws MetadataException
X_MINIMUM
and/or X_MAXIMUM
. If one of those
keys is missing, then X_RESOLUTION
is required.Y_MINIMUM
and/or Y_MAXIMUM
. If one of those
keys is missing, then Y_RESOLUTION
is required.
MissingMetadataException
- if a required value is missing.
MetadataException
- if the operation failed for some other reason.getGridRange()
,
getGeographicBoundingBox()
public org.opengis.coverage.grid.GridRange getGridRange() throws MetadataException
WIDTH
and HEIGHT
, and transform the resulting
strings into a GridRange
object.
MissingMetadataException
- if a required value is missing.
MetadataException
- if the operation failed for some other reason.getEnvelope()
,
getGeographicBoundingBox()
public org.opengis.coverage.SampleDimension[] getSampleDimensions() throws MetadataException
GridCoverage
to be read. If sample dimensions are not know, then this method returns
. The default implementation always returns .
MetadataException
- if the operation failed.public void listMetadata(java.io.Writer out) throws java.io.IOException
'='
is inserted between keys and values.
A question mark ('?'
) is put in front of any unknow name (i.e. any name
not specified with addAlias(org.geotools.coverage.io.MetadataBuilder.Key, java.lang.String)
).
out
- Stream to write metadata to.
IOException
- if an error occured while listing metadata.add(GridCoverage)
,
toString()
public java.lang.String toString()
getGeographicBoundingBox()
. Then, it append the list of all metadata as
formatted by listMetadata(java.io.Writer)
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |