sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 06/07: Renamed "Positional errors" as "Positional consistency". The previous name was misleading because users believed that it was some kind of "absolute" error measurement, while actually we are just applying a forward projection followed by an inverse projection and comparing numbers.
Date Tue, 23 Jun 2020 17:57:44 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 1ef036d05d5df26a4d839456d689fe23916501bc
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Tue Jun 23 19:36:31 2020 +0200

    Renamed "Positional errors" as "Positional consistency".
    The previous name was misleading because users believed that it was some kind of "absolute"
error measurement,
    while actually we are just applying a forward projection followed by an inverse projection
and comparing numbers.
---
 .../java/org/apache/sis/image/PlanarImage.java     |  4 +--
 ...rImage.java => PositionalConsistencyImage.java} |  6 ++--
 .../java/org/apache/sis/image/ResampledImage.java  | 34 +++++++++++-----------
 3 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/image/PlanarImage.java b/core/sis-feature/src/main/java/org/apache/sis/image/PlanarImage.java
index 32547ba..6b41d96 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/image/PlanarImage.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/image/PlanarImage.java
@@ -194,8 +194,8 @@ public abstract class PlanarImage implements RenderedImage {
      *     <td>{@value #STATISTICS_KEY}</td>
      *     <td>Minimum, maximum and mean values for each band.</td>
      *   </tr><tr>
-     *     <td>{@value ResampledImage#POSITIONAL_ERRORS_KEY}</td>
-     *     <td>Estimation of positional error for each pixel.</td>
+     *     <td>{@value ResampledImage#POSITIONAL_CONSISTENCY_KEY}</td>
+     *     <td>Estimation of positional error for each pixel as a consistency check.</td>
      *   </tr><tr>
      *     <td>{@value ComputedImage#SOURCE_PADDING_KEY}</td>
      *     <td>Amount of additional source pixels needed on each side of a destination
pixel for computing its value.</td>
diff --git a/core/sis-feature/src/main/java/org/apache/sis/image/PositionalErrorImage.java
b/core/sis-feature/src/main/java/org/apache/sis/image/PositionalConsistencyImage.java
similarity index 96%
rename from core/sis-feature/src/main/java/org/apache/sis/image/PositionalErrorImage.java
rename to core/sis-feature/src/main/java/org/apache/sis/image/PositionalConsistencyImage.java
index e993250..d45d7bc 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/image/PositionalErrorImage.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/image/PositionalConsistencyImage.java
@@ -30,14 +30,14 @@ import org.apache.sis.util.Workaround;
 
 /**
  * Estimation of positional error for each pixel in an image computed by {@link ResampledImage}.
- * This is the implementation of {@link ResampledImage#POSITIONAL_ERRORS_KEY} property value.
+ * This is the implementation of {@link ResampledImage#POSITIONAL_CONSISTENCY_KEY} property
value.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 1.1
  * @since   1.1
  * @module
  */
-final class PositionalErrorImage extends ComputedImage {
+final class PositionalConsistencyImage extends ComputedImage {
     /**
      * The color model for this image.
      * Arbitrarily configured for an error range from 0 to 1.
@@ -66,7 +66,7 @@ final class PositionalErrorImage extends ComputedImage {
     /**
      * Creates a new instance for the given image.
      */
-    PositionalErrorImage(final ResampledImage image, final MathTransform toSource) throws
TransformException {
+    PositionalConsistencyImage(final ResampledImage image, final MathTransform toSource)
throws TransformException {
         super(createSampleModel(image.getSampleModel()), image);
         this.toSource = toSource;
         this.toTarget = image.toSource.inverse();
diff --git a/core/sis-feature/src/main/java/org/apache/sis/image/ResampledImage.java b/core/sis-feature/src/main/java/org/apache/sis/image/ResampledImage.java
index fc0c301..b6a60c4 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/image/ResampledImage.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/image/ResampledImage.java
@@ -86,7 +86,7 @@ public class ResampledImage extends ComputedImage {
 
     /**
      * Key of a property providing an estimation of positional error for each pixel.
-     * Values should be instances of {@link RenderedImage} with same size and origin than
this image.
+     * Values shall be instances of {@link RenderedImage} with same size and origin than
this image.
      * The image should contain a single band where all sample values are error estimations
in pixel units
      * (relative to pixels of this image). The value should be small, for example between
0 and 0.2.
      *
@@ -94,7 +94,7 @@ public class ResampledImage extends ComputedImage {
      * then convert them back to pixel coordinates in this image. The result is compared
with expected
      * coordinates and the distance is stored in the image.</p>
      */
-    public static final String POSITIONAL_ERRORS_KEY = "org.apache.sis.PositionalErrors";
+    public static final String POSITIONAL_CONSISTENCY_KEY = "org.apache.sis.PositionalConsistency";
 
     /**
      * The {@value} value for identifying code expecting exactly 2 dimensions.
@@ -142,12 +142,12 @@ public class ResampledImage extends ComputedImage {
     private final Object fillValues;
 
     /**
-     * {@link #POSITIONAL_ERRORS_KEY} value, computed when first requested.
+     * {@link #POSITIONAL_CONSISTENCY_KEY} value, computed when first requested.
      *
-     * @see #getPositionalErrors()
+     * @see #getPositionalConsistency()
      * @see #getProperty(String)
      */
-    private Reference<ComputedImage> positionalErrors;
+    private Reference<ComputedImage> positionalConsistency;
 
     /**
      * Creates a new image which will resample the given image. The resampling operation
is defined
@@ -287,21 +287,21 @@ public class ResampledImage extends ComputedImage {
     }
 
     /**
-     * Computes the {@value #POSITIONAL_ERRORS_KEY} value. This method is invoked by {@link
#getProperty(String)}
-     * when the {@link #POSITIONAL_ERRORS_KEY} property value is requested. The result is
saved by weak reference
+     * Computes the {@value #POSITIONAL_CONSISTENCY_KEY} value. This method is invoked by
{@link #getProperty(String)}
+     * when the {@link #POSITIONAL_CONSISTENCY_KEY} property value is requested. The result
is saved by weak reference
      * since recomputing this image is rarely requested, and if needed can be recomputed
easily.
      */
-    private synchronized RenderedImage getPositionalErrors() throws TransformException {
-        ComputedImage image = (positionalErrors != null) ? positionalErrors.get() : null;
+    private synchronized RenderedImage getPositionalConsistency() throws TransformException
{
+        ComputedImage image = (positionalConsistency != null) ? positionalConsistency.get()
: null;
         if (image == null) {
-            positionalErrors = null;
+            positionalConsistency = null;
             final Dimension s = interpolation.getSupportSize();
             final double[] offset = new double[toSource.getSourceDimensions()];
             offset[0] = -interpolationSupportOffset(s.width);
             offset[1] = -interpolationSupportOffset(s.height);
             final MathTransform tr = MathTransforms.concatenate(toSource, MathTransforms.translation(offset));
-            image = new PositionalErrorImage(this, tr);
-            positionalErrors = image.reference();
+            image = new PositionalConsistencyImage(this, tr);
+            positionalConsistency = image.reference();
         }
         return image;
     }
@@ -364,7 +364,7 @@ public class ResampledImage extends ComputedImage {
      * (more properties may be added to this list in future Apache SIS versions):
      *
      * <ul>
-     *   <li>{@value #POSITIONAL_ERRORS_KEY}</li>
+     *   <li>{@value #POSITIONAL_CONSISTENCY_KEY}</li>
      *   <li>{@value #SAMPLE_RESOLUTIONS_KEY} (forwarded to the source image)</li>
      * </ul>
      *
@@ -378,8 +378,8 @@ public class ResampledImage extends ComputedImage {
     public Object getProperty(final String key) {
         if (FILTERED_PROPERTIES.contains(key)) {
             return getSource().getProperty(key);
-        } else if (POSITIONAL_ERRORS_KEY.equals(key)) try {
-            return getPositionalErrors();
+        } else if (POSITIONAL_CONSISTENCY_KEY.equals(key)) try {
+            return getPositionalConsistency();
         } catch (TransformException | IllegalArgumentException e) {
             throw (ImagingOpException) new ImagingOpException(e.getMessage()).initCause(e);
         }
@@ -405,10 +405,10 @@ public class ResampledImage extends ComputedImage {
             }
         }
         if (n < names.length) {
-            names[n++] = POSITIONAL_ERRORS_KEY;
+            names[n++] = POSITIONAL_CONSISTENCY_KEY;
             return ArraysExt.resize(names, n);
         } else {
-            return ArraysExt.append(names, POSITIONAL_ERRORS_KEY);
+            return ArraysExt.append(names, POSITIONAL_CONSISTENCY_KEY);
         }
     }
 


Mime
View raw message