sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 05/05: Clarification in javadoc: the size of the list returned by getSampleDimensions() should be equal to the number of bands in the image.
Date Fri, 15 Feb 2019 19:23:49 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit ebfc3caef04afafc56698c34d2418ac166b93092
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Fri Feb 15 20:19:24 2019 +0100

    Clarification in javadoc: the size of the list returned by getSampleDimensions() should
be equal to the number of bands in the image.
---
 .../main/java/org/apache/sis/coverage/grid/GridCoverage.java   | 10 ++++++++++
 .../main/java/org/apache/sis/storage/GridCoverageResource.java | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/core/sis-raster/src/main/java/org/apache/sis/coverage/grid/GridCoverage.java
b/core/sis-raster/src/main/java/org/apache/sis/coverage/grid/GridCoverage.java
index 7d19398..cd6998c 100644
--- a/core/sis-raster/src/main/java/org/apache/sis/coverage/grid/GridCoverage.java
+++ b/core/sis-raster/src/main/java/org/apache/sis/coverage/grid/GridCoverage.java
@@ -52,6 +52,8 @@ import org.opengis.coverage.PointOutsideCoverageException;
 public abstract class GridCoverage {
     /**
      * The grid extent, coordinate reference system (CRS) and conversion from cell indices
to CRS.
+     *
+     * @see #getGridGeometry()
      */
     private final GridGeometry gridGeometry;
 
@@ -59,6 +61,8 @@ public abstract class GridCoverage {
      * List of sample dimension (band) information for the grid coverage. Information include
such things
      * as description, the no data values, minimum and maximum values, <i>etc</i>.
A coverage must have
      * at least one sample dimension. The content of this array shall never be modified.
+     *
+     * @see #getSampleDimensions()
      */
     private final SampleDimension[] sampleDimensions;
 
@@ -100,6 +104,8 @@ public abstract class GridCoverage {
      * {@code GridGeometry} can also provide derived information like bounding box and resolution.
      *
      * @return grid extent, CRS and conversion from cell indices to CRS.
+     *
+     * @see org.apache.sis.storage.GridCoverageResource#getGridGeometry()
      */
     public GridGeometry getGridGeometry() {
         return gridGeometry;
@@ -108,8 +114,12 @@ public abstract class GridCoverage {
     /**
      * Returns information about the <cite>range</cite> of this grid coverage.
      * Information include names, sample value ranges, fill values and transfer functions
for all bands in this grid coverage.
+     * The length of the returned list should be equal to the {@linkplain java.awt.image.SampleModel#getNumBands()
number of
+     * bands} in the rendered image.
      *
      * @return names, value ranges, fill values and transfer functions for all bands in this
grid coverage.
+     *
+     * @see org.apache.sis.storage.GridCoverageResource#getSampleDimensions()
      */
     public List<SampleDimension> getSampleDimensions() {
         return UnmodifiableArrayList.wrap(sampleDimensions);
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/GridCoverageResource.java
b/storage/sis-storage/src/main/java/org/apache/sis/storage/GridCoverageResource.java
index 6f76c27..46fe057 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/GridCoverageResource.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/GridCoverageResource.java
@@ -52,6 +52,8 @@ public interface GridCoverageResource extends DataSet {
      *
      * @return extent of grid coordinates together with their mapping to "real world" coordinates.
      * @throws DataStoreException if an error occurred while reading definitions from the
underlying data store.
+     *
+     * @see GridCoverage#getGridGeometry()
      */
     GridGeometry getGridGeometry() throws DataStoreException;
 
@@ -68,8 +70,16 @@ public interface GridCoverageResource extends DataSet {
      *   <li>The sample values reserved for missing values.</li>
      * </ul>
      *
+     * The returned list should never be empty. If the coverage is an image to be used only
for visualization purposes
+     * (i.e. the image does not contain any classification data or any measurement of physical
phenomenon), then list
+     * size should be equal to the {@linkplain java.awt.image.SampleModel#getNumBands() number
of bands} in the image
+     * and sample dimension names may be "Red", "Green" and "Blue" for instance. Those sample
dimensions do not need
+     * to contain any {@linkplain SampleDimension#getCategories() category}.
+     *
      * @return ranges of sample values together with their mapping to "real values".
      * @throws DataStoreException if an error occurred while reading definitions from the
underlying data store.
+     *
+     * @see GridCoverage#getSampleDimensions()
      */
     List<SampleDimension> getSampleDimensions() throws DataStoreException;
 


Mime
View raw message