org.geotoolkit.coverage.sql
Class NewGridCoverageReference

Object
  extended by NewGridCoverageReference

public final class NewGridCoverageReference
extends Object

A structure which contain the information to be added in the Coverage Database for a new coverage reference. The information provided in this class match closely the layout of the coverage database.

Instances of this class are created by Layer.addCoverageReferences(Collection, CoverageDatabaseController) and dispatched to CoverageDatabaseListeners. The listeners can modify the field values before the insertion in the database occurs.

Since:
3.12 (derived from Seagis)
Version:
3.21
Author:
Martin Desruisseaux (IRD, Geomatys)
See Also:
CoverageDatabaseListener
Module:
coverage/geotk-coverage-sql (download)    View source code for this class

Field Summary
 DateRange[] dateRanges
          The date range, or null if none.
 String extension
          The filename extension (not including the leading dot), or null if none.
 String filename
          The filename, not including the path and extension.
 String format
          The name of the coverage format.
 AffineTransform gridToCRS
          The grid to CRS transform, which maps always the pixel upper left corner.
 int horizontalSRID
          The horizontal CRS identifier.
 Rectangle imageBounds
          The image bounds.
 int imageIndex
          The zero-based index of the image to be inserted in the database.
 File path
          The path to the coverage file (not including the filename), or null if the filename has no parent directory.
 List<GridSampleDimension> sampleDimensions
          The sample dimensions for coverages associated with the format, or an empty list if undefined.
 int verticalSRID
          The vertical CRS identifier, ignored if verticalValues is null.
 double[] verticalValues
          The vertical coordinate values, or null if none.
 
Method Summary
 String[] getAlternativeFormats()
          Returns a list of formats which may be used as an alternative to format.
 File getFile()
          Returns the path to the coverage file as "path/filename.
 boolean isFormatDefined()
          Returns true if the format is already defined in the database, or false if this is a new format.
 void refresh()
          Recomputes some attributes in this NewGridCoverageReference.
 String toString()
          Returns a string representation for debugging purpose.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

path

public final File path
The path to the coverage file (not including the filename), or null if the filename has no parent directory. The full path to the input file is "path/filename.extension".

See Also:
filename, extension, getFile()

filename

public final String filename
The filename, not including the path and extension.

See Also:
path, extension, getFile()

extension

public final String extension
The filename extension (not including the leading dot), or null if none.

See Also:
path, filename, getFile()

imageIndex

public int imageIndex
The zero-based index of the image to be inserted in the database. If there is many images to insert for many different date ranges, then this is the index of the first image, i.e.:

Since:
3.16

format

public String format
The name of the coverage format. It shall be one of the primary key values in the "Formats" table. Note that this is not necessarily the same name than the image format name.

This field is initialized to the format which seems the best fit. A list of alternative formats can be obtained by getAlternativeFormats().

See Also:
isFormatDefined(), getAlternativeFormats(), refresh()

sampleDimensions

public final List<GridSampleDimension> sampleDimensions
The sample dimensions for coverages associated with the format, or an empty list if undefined. If non-empty, then the list size is equals to the number of bands.

Each GridSampleDimension specifies how to convert pixel values to geophysics values, or conversely. Their type (geophysics or not) is format dependent. For example coverages read from PNG files will typically store their data as integer values (non-geophysics), while coverages read from ASCII files will often store their pixel values as real numbers (geophysics values).

The content of this list can be modified in-place.

Since:
3.13
See Also:
refresh()

imageBounds

public final Rectangle imageBounds
The image bounds. The rectangle width and height must be set to the image size. The (x,y) origin is usually (0,0), but different value are allowed. For example the origin can be set to the location of a tile in tiled images.

If the (x,y) origin is different than (0,0), then it will be interpreted as the translation to apply on the grid before to apply the gridToCRS transform at reading time.

This field is never null. However users can modify it before the new entry is inserted in the database.


gridToCRS

public final AffineTransform gridToCRS
The grid to CRS transform, which maps always the pixel upper left corner. This transform does not include the (x,y) translation of the imageBounds.

This field is never null. However users can modify it before the new entry is inserted in the database.


horizontalSRID

public int horizontalSRID
The horizontal CRS identifier. This shall be the value of a primary key in the "spatial_ref_sys" PostGIS table. The value may be 0 if this class found no information about the horizontal SRID.


verticalSRID

public int verticalSRID
The vertical CRS identifier, ignored if verticalValues is null. When not ignored, this shall be the value of a primary key in the "spatial_ref_sys" PostGIS table. The value may be 0 if this class found no information about the vertical SRID.


verticalValues

public double[] verticalValues
The vertical coordinate values, or null if none.


dateRanges

public DateRange[] dateRanges
The date range, or null if none. This array usually contains only one element, but more than one time range is allowed if the image file contains data at many times. In the later case, the sequence of date ranges is associated to the sequence of image indices, i.e.:

Method Detail

getFile

public File getFile()
Returns the path to the coverage file as "path/filename.extension".

Returns:
The path to the image file, or null if filename is null.
See Also:
path, filename, extension

getAlternativeFormats

public String[] getAlternativeFormats()
                               throws CoverageStoreException
Returns a list of formats which may be used as an alternative to format. This method can be invoked from Graphical User Interface wanting to provide a choice to user.

Returns:
A list of formats which may be used as an alternative to format.
Throws:
CoverageStoreException - If an error occurred while fetching the list of alternative formats from the database.
Since:
3.13

isFormatDefined

public boolean isFormatDefined()
                        throws CoverageStoreException
Returns true if the format is already defined in the database, or false if this is a new format.

Returns:
true if the current format is defined in the database.
Throws:
CoverageStoreException - If an error occurred while reading from the database.
Since:
3.13
See Also:
format

refresh

public void refresh()
             throws CoverageStoreException
Recomputes some attributes in this NewGridCoverageReference. This method can be invoked after one of the following attributes changed:

The current implementation recomputes the following attributes. Note that this list may be expanded in a future version.

Throws:
CoverageStoreException - If an error occurred while reading from the database.
Since:
3.13

toString

public String toString()
Returns a string representation for debugging purpose.

Overrides:
toString in class Object


Copyright © 2009-2013 Geotoolkit.org. All Rights Reserved.