org.opengis.coverage.grid
Interface GridCoverageWriter
-
public interface GridCoverageWriterSupport for writing grid coverages into a persistent store. Instance ofGridCoverageWriterare obtained through a call toGridCoverageExchange.getWriter(java.lang.Object, org.opengis.coverage.grid.Format). Grid coverages are usually added to the output stream in a sequential order.WARNING: THIS CLASS WILL CHANGE. Current API is derived from OGC Grid Coverages Implementation specification 1.0. We plan to replace it by new interfaces derived from ISO 19123 (Schema for coverage geometry and functions). Current interfaces should be considered as legacy and are included in this distribution only because they were part of GeoAPI 1.0 release. We will try to preserve as much compatibility as possible, but no migration plan has been determined yet.
- Since:
- GeoAPI 2.0
- See Also:
GridCoverageExchange.getWriter(java.lang.Object, org.opengis.coverage.grid.Format),ImageWriter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voiddispose()Allows any resources held by this object to be released.java.lang.ObjectgetDestination()Returns the output destination.FormatgetFormat()Returns the format handled by thisGridCoverageWriter.java.lang.String[]getMetadataNames()Returns the list of metadata keywords associated with the output destination as a whole (not associated with any particular grid coverage).voidsetCurrentSubname(java.lang.String name)Set the name for the next grid coverage to write within the output destination.voidsetMetadataValue(java.lang.String name, java.lang.String value)Sets the metadata value for a given metadata name.voidwrite(GridCoverage coverage, GeneralParameterValue[] parameters)Writes the specified grid coverage.
-
-
-
Method Detail
-
getFormat
Format getFormat()
Returns the format handled by thisGridCoverageWriter.
-
getDestination
java.lang.Object getDestination()
Returns the output destination. This is the object passed to theGridCoverageExchange.getWriter(java.lang.Object, org.opengis.coverage.grid.Format)method. It can be aString, anOutputStream, aFileChannel, etc.
-
getMetadataNames
java.lang.String[] getMetadataNames()
Returns the list of metadata keywords associated with the output destination as a whole (not associated with any particular grid coverage). If no metadata is allowed, the array will be empty.- Returns:
- The list of metadata keywords for the output destination.
- Throws:
java.io.IOException- if an error occurs during reading or writing.
-
setMetadataValue
void setMetadataValue(java.lang.String name, java.lang.String value) throws java.io.IOException, MetadataNameNotFoundExceptionSets the metadata value for a given metadata name.- Parameters:
name- Metadata keyword for which to set the metadata.value- The metadata value for the given metadata name.- Throws:
java.io.IOException- if an error occurs during writing.MetadataNameNotFoundException- if the specified metadata name is not handled for this format.
-
setCurrentSubname
void setCurrentSubname(java.lang.String name) throws java.io.IOExceptionSet the name for the next grid coverage to write within the output destination. The subname can been fetch later at reading time.- Throws:
java.io.IOException- if an error occurs during writing.
-
write
void write(GridCoverage coverage, GeneralParameterValue[] parameters) throws java.lang.IllegalArgumentException, java.io.IOException
Writes the specified grid coverage.- Parameters:
coverage- The grid coverage to write.parameters- An optional set of parameters. Should be any or all of the parameters returned byFormat.getWriteParameters().- Throws:
InvalidParameterNameException- if a parameter inparametersdoesn't have a recognized name.InvalidParameterValueException- if a parameter inparametersdoesn't have a valid value.ParameterNotFoundException- if a parameter was required for the operation but was not provided in theparameterslist.FileFormatNotCompatibleWithGridCoverageException- if the grid coverage can't be exported in the writer format.java.io.IOException- if the export failed for some other input/output reason, includingIIOExceptionif an error was thrown by the underlying image library.java.lang.IllegalArgumentException
-
dispose
void dispose() throws java.io.IOExceptionAllows any resources held by this object to be released. The result of calling any other method subsequent to a call to this method is undefined. It is important for applications to call this method when they know they will no longer be using thisGridCoverageWriter. Otherwise, the writer may continue to hold on to resources indefinitely.- Throws:
java.io.IOException- if an error occured while disposing resources (for example while flushing data and closing a file).
-
-
DataMelt 3.0 © DataMelt by jWork.ORG