You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2021/05/16 21:40:41 UTC
[sis] branch geoapi-4.0 updated: Rename Interpolator as
GridEvaluator.
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
The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
new f2256f8 Rename Interpolator as GridEvaluator.
f2256f8 is described below
commit f2256f84f63df515a711b841b003f184d28baf2c
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Sun May 16 23:38:54 2021 +0200
Rename Interpolator as GridEvaluator.
---
.../main/java/org/apache/sis/gui/map/ValuesUnderCursor.java | 6 +++---
.../org/apache/sis/coverage/grid/BufferedGridCoverage.java | 8 ++++----
.../org/apache/sis/coverage/grid/ConvertedGridCoverage.java | 12 ++++++------
.../apache/sis/coverage/grid/FractionalGridCoordinates.java | 6 +++---
.../main/java/org/apache/sis/coverage/grid/GridCoverage.java | 8 ++++----
.../java/org/apache/sis/coverage/grid/GridCoverage2D.java | 8 ++++----
.../coverage/grid/{Interpolator.java => GridEvaluator.java} | 11 +++++------
.../org/apache/sis/coverage/grid/ResampledGridCoverage.java | 2 +-
.../org/apache/sis/coverage/grid/GridCoverage2DTest.java | 4 ++--
9 files changed, 32 insertions(+), 33 deletions(-)
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/ValuesUnderCursor.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/ValuesUnderCursor.java
index 4a9bc4c..f762b27 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/ValuesUnderCursor.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/ValuesUnderCursor.java
@@ -43,7 +43,7 @@ import org.opengis.metadata.content.TransferFunctionType;
import org.apache.sis.referencing.operation.transform.TransferFunction;
import org.apache.sis.gui.coverage.CoverageCanvas;
import org.apache.sis.coverage.grid.GridCoverage;
-import org.apache.sis.coverage.grid.Interpolator;
+import org.apache.sis.coverage.grid.GridEvaluator;
import org.apache.sis.coverage.SampleDimension;
import org.apache.sis.coverage.Category;
import org.apache.sis.internal.system.Modules;
@@ -224,7 +224,7 @@ public abstract class ValuesUnderCursor {
/**
* The object computing or interpolation sample values in the coverage.
*/
- private Interpolator evaluator;
+ private GridEvaluator evaluator;
/**
* The selection status of each band.
@@ -480,7 +480,7 @@ public abstract class ValuesUnderCursor {
* @param point the cursor location in arbitrary CRS, or {@code null} if outside canvas region.
* @return string representation of data under given position, or {@code null} if none.
*
- * @see Interpolator#apply(DirectPosition)
+ * @see GridEvaluator#apply(DirectPosition)
*/
@Override
public String evaluate(final DirectPosition point) {
diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/BufferedGridCoverage.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/BufferedGridCoverage.java
index 1f89cac..4aa3ae4 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/BufferedGridCoverage.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/BufferedGridCoverage.java
@@ -191,11 +191,11 @@ public class BufferedGridCoverage extends GridCoverage {
* Creates a new function for computing or interpolating sample values at given locations.
*
* <h4>Multi-threading</h4>
- * {@code Interpolator}s are not thread-safe. For computing sample values concurrently,
- * a new {@link Interpolator} instance should be created for each thread.
+ * {@code GridEvaluator}s are not thread-safe. For computing sample values concurrently,
+ * a new {@link GridEvaluator} instance should be created for each thread.
*/
@Override
- public Interpolator evaluator() {
+ public GridEvaluator evaluator() {
return new CellAccessor(this);
}
@@ -219,7 +219,7 @@ public class BufferedGridCoverage extends GridCoverage {
/**
* Implementation of evaluator returned by {@link #evaluator()}.
*/
- private static class CellAccessor extends Interpolator {
+ private static class CellAccessor extends GridEvaluator {
/**
* A copy of {@link BufferedGridCoverage#data} reference.
*/
diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/ConvertedGridCoverage.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/ConvertedGridCoverage.java
index 1cf0ea7..fc58d79 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/ConvertedGridCoverage.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/ConvertedGridCoverage.java
@@ -40,7 +40,7 @@ import org.apache.sis.image.DataType;
* <li>In calls to {@link #render(GridExtent)}, sample values are converted when first needed
* on a tile-by-tile basis then cached for future reuse. Note however that discarding the
* returned image may result in the lost of cached tiles.</li>
- * <li>In calls to {@link Interpolator#apply(DirectPosition)}, the conversion is applied
+ * <li>In calls to {@link GridEvaluator#apply(DirectPosition)}, the conversion is applied
* on-the-fly each time in order to avoid the potentially costly tile computations.</li>
* </ul>
*
@@ -199,24 +199,24 @@ final class ConvertedGridCoverage extends GridCoverage {
* Creates a new function for computing or interpolating sample values at given locations.
*
* <h4>Multi-threading</h4>
- * {@code Interpolator}s are not thread-safe. For computing sample values concurrently,
- * a new {@link Interpolator} instance should be created for each thread.
+ * {@code GridEvaluator}s are not thread-safe. For computing sample values concurrently,
+ * a new {@link GridEvaluator} instance should be created for each thread.
*
* @since 1.1
*/
@Override
- public Interpolator evaluator() {
+ public GridEvaluator evaluator() {
return new SampleConverter();
}
/**
* Implementation of evaluator returned by {@link #evaluator()}.
*/
- private final class SampleConverter extends Interpolator {
+ private final class SampleConverter extends GridEvaluator {
/**
* The evaluator provided by source coverage.
*/
- private final Interpolator evaluator;
+ private final GridEvaluator evaluator;
/**
* Creates a new evaluator for the enclosing coverage.
diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/FractionalGridCoordinates.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/FractionalGridCoordinates.java
index 268d65d..121b201 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/FractionalGridCoordinates.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/FractionalGridCoordinates.java
@@ -50,7 +50,7 @@ import org.apache.sis.util.resources.Errors;
* @author Martin Desruisseaux (Geomatys)
* @version 1.1
*
- * @see Interpolator#toGridCoordinates(DirectPosition)
+ * @see GridEvaluator#toGridCoordinates(DirectPosition)
*
* @since 1.1
* @module
@@ -71,7 +71,7 @@ public class FractionalGridCoordinates implements GridCoordinates, Serializable
*
* <div class="note"><b>Note:</b>
* {@code FractionalGridCoordinates} are usually not created directly, but are instead obtained
- * indirectly for example from the {@linkplain Interpolator#toGridCoordinates(DirectPosition)
+ * indirectly for example from the {@linkplain GridEvaluator#toGridCoordinates(DirectPosition)
* conversion of a geospatial position}.</div>
*
* @param dimension the number of dimensions.
@@ -332,7 +332,7 @@ public class FractionalGridCoordinates implements GridCoordinates, Serializable
* @return the grid coordinates converted using the given transform.
* @throws TransformException if the grid coordinates can not be converted by {@code gridToCRS}.
*
- * @see Interpolator#toGridCoordinates(DirectPosition)
+ * @see GridEvaluator#toGridCoordinates(DirectPosition)
*/
public DirectPosition toPosition(final MathTransform gridToCRS) throws TransformException {
return gridToCRS.transform(new Position(this), null);
diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverage.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverage.java
index 420e054..e0debbd 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverage.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverage.java
@@ -274,8 +274,8 @@ public abstract class GridCoverage extends BandedCoverage {
* conversions to grid indices are applied as needed.
*
* <h4>Multi-threading</h4>
- * {@code Interpolator}s are not thread-safe. For computing sample values concurrently,
- * a new {@link Interpolator} instance should be created for each thread by invoking this
+ * {@code GridEvaluator}s are not thread-safe. For computing sample values concurrently,
+ * a new {@link GridEvaluator} instance should be created for each thread by invoking this
* method multiply times.
*
* @return a new function for computing or interpolating sample values.
@@ -283,8 +283,8 @@ public abstract class GridCoverage extends BandedCoverage {
* @since 1.1
*/
@Override
- public Interpolator evaluator() {
- return new Interpolator(this);
+ public GridEvaluator evaluator() {
+ return new GridEvaluator(this);
}
/**
diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverage2D.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverage2D.java
index 12f54a5..e1bc00f 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverage2D.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverage2D.java
@@ -453,20 +453,20 @@ public class GridCoverage2D extends GridCoverage {
* Creates a new function for computing or interpolating sample values at given locations.
*
* <h4>Multi-threading</h4>
- * {@code Interpolator}s are not thread-safe. For computing sample values concurrently,
- * a new {@link Interpolator} instance should be created for each thread.
+ * {@code GridEvaluator}s are not thread-safe. For computing sample values concurrently,
+ * a new {@link GridEvaluator} instance should be created for each thread.
*
* @since 1.1
*/
@Override
- public Interpolator evaluator() {
+ public GridEvaluator evaluator() {
return new PixelAccessor();
}
/**
* Implementation of evaluator returned by {@link #evaluator()}.
*/
- private final class PixelAccessor extends Interpolator {
+ private final class PixelAccessor extends GridEvaluator {
/**
* Creates a new evaluator for the enclosing coverage.
*/
diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/Interpolator.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridEvaluator.java
similarity index 96%
rename from core/sis-feature/src/main/java/org/apache/sis/coverage/grid/Interpolator.java
rename to core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridEvaluator.java
index 3b59b77..a7a44fd 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/Interpolator.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridEvaluator.java
@@ -38,12 +38,11 @@ import org.apache.sis.util.ArgumentChecks;
* Values are computed by calls to {@link #apply(DirectPosition)} and are returned as {@code double[]}.
*
* <h2>Multi-threading</h2>
- * Evaluators are not thread-safe. An instance of {@code Interpolator} should be created
+ * Evaluators are not thread-safe. An instance of {@code GridEvaluator} should be created
* for each thread that need to compute sample values.
*
* <h2>Limitations</h2>
- * Despite the {@code Interpolator} class name, current implementation performs
- * nearest-neighbor sampling only. A future version will provide interpolations.
+ * Current implementation performs nearest-neighbor sampling only. A future version will provide interpolations.
*
* @author Johann Sorel (Geomatys)
* @author Martin Desruisseaux (Geomatys)
@@ -54,7 +53,7 @@ import org.apache.sis.util.ArgumentChecks;
* @since 1.1
* @module
*/
-public class Interpolator implements GridCoverage.Evaluator {
+public class GridEvaluator implements GridCoverage.Evaluator {
/**
* The coverage in which to evaluate sample values.
*/
@@ -96,14 +95,14 @@ public class Interpolator implements GridCoverage.Evaluator {
/**
* Creates a new evaluator for the given coverage. This constructor is protected for allowing
- * {@link GridCoverage} subclasses to provide their own {@code Interpolator} implementations.
+ * {@link GridCoverage} subclasses to provide their own {@code GridEvaluator} implementations.
* For using an evaluator, invoke {@link GridCoverage#evaluator()} instead.
*
* @param coverage the coverage for which to create an evaluator.
*
* @see GridCoverage#evaluator()
*/
- protected Interpolator(final GridCoverage coverage) {
+ protected GridEvaluator(final GridCoverage coverage) {
ArgumentChecks.ensureNonNull("coverage", coverage);
this.coverage = coverage;
}
diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/ResampledGridCoverage.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/ResampledGridCoverage.java
index e113088..7ae9e76 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/ResampledGridCoverage.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/ResampledGridCoverage.java
@@ -552,7 +552,7 @@ final class ResampledGridCoverage extends GridCoverage {
* Delegates to the source coverage, which should transform the point itself if needed.
*/
@Override
- public Interpolator evaluator() {
+ public GridEvaluator evaluator() {
return source.evaluator();
}
}
diff --git a/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridCoverage2DTest.java b/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridCoverage2DTest.java
index 05d9a35..f2bf359 100644
--- a/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridCoverage2DTest.java
+++ b/core/sis-feature/src/test/java/org/apache/sis/coverage/grid/GridCoverage2DTest.java
@@ -192,11 +192,11 @@ public strictfp class GridCoverage2DTest extends TestCase {
}
/**
- * Tests {@link Interpolator#apply(DirectPosition)}.
+ * Tests {@link GridEvaluator#apply(DirectPosition)}.
*/
@Test
public void testEvaluator() {
- final Interpolator evaluator = createTestCoverage().evaluator();
+ final GridEvaluator evaluator = createTestCoverage().evaluator();
/*
* Test evaluation at indeger indices. No interpolation should be applied.
*/