sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 02/02: Add a setPositionalAccuracyHints(Quantity...) convenience method.
Date Wed, 03 Jun 2020 21:36:27 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 d380dffa847770f0f0a048ea5b4d9421708c1b1d
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Wed Jun 3 19:41:13 2020 +0200

    Add a setPositionalAccuracyHints(Quantity...) convenience method.
---
 .../sis/coverage/grid/GridCoverageProcessor.java   | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageProcessor.java
b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageProcessor.java
index 8b9f477..fe52dff 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageProcessor.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageProcessor.java
@@ -17,6 +17,7 @@
 package org.apache.sis.coverage.grid;
 
 import java.util.Objects;
+import javax.measure.Quantity;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.operation.TransformException;
 import org.apache.sis.image.ImageProcessor;
@@ -81,8 +82,11 @@ public class GridCoverageProcessor implements Cloneable {
 
     /**
      * Returns the interpolation method to use for resampling operations.
+     * The default implementation delegates to the image processor.
      *
      * @return interpolation method to use in resampling operations.
+     *
+     * @see ImageProcessor#getInterpolation()
      */
     public Interpolation getInterpolation() {
         return imageProcessor.getInterpolation();
@@ -90,14 +94,42 @@ public class GridCoverageProcessor implements Cloneable {
 
     /**
      * Sets the interpolation method to use for resampling operations.
+     * The default implementation delegates to the image processor.
      *
      * @param  method  interpolation method to use in resampling operations.
+     *
+     * @see ImageProcessor#setInterpolation(Interpolation)
      */
     public void setInterpolation(final Interpolation method) {
         imageProcessor.setInterpolation(method);
     }
 
     /**
+     * Returns hints about the desired positional accuracy, in "real world" units or in pixel
units.
+     * The default implementation delegates to the image processor.
+     *
+     * @return desired accuracy in no particular order, or an empty array if none.
+     *
+     * @see ImageProcessor#getPositionalAccuracyHints()
+     */
+    public Quantity<?>[] getPositionalAccuracyHints() {
+        return imageProcessor.getPositionalAccuracyHints();
+    }
+
+    /**
+     * Sets hints about desired positional accuracy, in "real world" units or in pixel units.
+     * The default implementation delegates to the image processor.
+     *
+     * @param  hints  desired accuracy in no particular order, or a {@code null} array if
none.
+     *                Null elements in the array are ignored.
+     *
+     * @see ImageProcessor#setPositionalAccuracyHints(Quantity...)
+     */
+    public void setPositionalAccuracyHints(final Quantity<?>... hints) {
+        imageProcessor.setPositionalAccuracyHints(hints);
+    }
+
+    /**
      * Creates a new coverage with a different grid extent, resolution or coordinate reference
system.
      * The desired properties are specified by the {@link GridGeometry} argument, which may
be incomplete.
      * The missing grid geometry components are completed as below:


Mime
View raw message