sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 01/02: Formatting (no code change).
Date Thu, 17 Sep 2020 11:11:33 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 979f21accc82c7d541d8ef6085a19035ff34dd3c
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Thu Sep 17 13:04:29 2020 +0200

    Formatting (no code change).
---
 .../apache/sis/coverage/grid/GridDerivation.java   | 14 ++++++------
 .../org/apache/sis/coverage/grid/GridExtent.java   |  6 ++---
 .../internal/referencing/WraparoundAdjustment.java | 26 +++++++++++-----------
 3 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridDerivation.java
b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridDerivation.java
index 52a5856..b8eb2be 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridDerivation.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridDerivation.java
@@ -322,9 +322,9 @@ public class GridDerivation {
             }
         }
         /*
-         * Computes the affine transform to pre-concatenate with the 'gridToCRS' transform.
+         * Computes the affine transform to pre-concatenate with the `gridToCRS` transform.
          * This is the simplest calculation done in this class since we are already in grid
coordinates.
-         * The given 'scales' array will become identical to 'this.scales' after length adjustment.
+         * The given `scales` array will become identical to `this.scales` after length adjustment.
          */
         final int actual = scales.length;
         scales = Arrays.copyOf(scales, n);
@@ -346,7 +346,7 @@ public class GridDerivation {
             throw new IllegalArgumentException(e);
         }
         scaledExtent = extent;
-        // Note: current version does not update 'baseExtent'.
+        // Note: current version does not update `baseExtent`.
         return this;
     }
 
@@ -546,7 +546,7 @@ public class GridDerivation {
              * If no area of interest has been specified, or if the result is identical to
the original extent,
              * then we will keep the reference to the original GridExtent (i.e. we share
existing instances).
              */
-            dimension = baseExtent.getDimension();      // Non-null since 'base.requireGridToCRS()'
succeed.
+            dimension = baseExtent.getDimension();      // Non-null since `base.requireGridToCRS()`
succeed.
             GeneralEnvelope indices = null;
             if (areaOfInterest != null) {
                 indices = new WraparoundAdjustment(base.envelope, baseToAOI, cornerToCRS.inverse()).shift(areaOfInterest);
@@ -824,7 +824,7 @@ public class GridDerivation {
             if (toBase != null) {
                 gridPoint = toBase.transform(gridPoint, gridPoint);
             }
-            baseExtent = baseExtent.slice(gridPoint, modifiedDimensions);       // Non-null
check by 'base.requireGridToCRS()'.
+            baseExtent = baseExtent.slice(gridPoint, modifiedDimensions);       // Non-null
check by `base.requireGridToCRS()`.
         } catch (FactoryException e) {
             throw new IllegalGridGeometryException(Resources.format(Resources.Keys.CanNotMapToGridDimensions),
e);
         } catch (TransformException e) {
@@ -871,9 +871,9 @@ public class GridDerivation {
 
     /*
      * RATIONAL FOR NOT PROVIDING reduce(int... dimensions) METHOD HERE: that method would
need to be the last method invoked,
-     * otherwise it makes more complicated to implement other methods in this class.  Forcing
users to invoke 'build()' before
+     * otherwise it makes more complicated to implement other methods in this class.  Forcing
users to invoke `build()` before
      * (s)he can invoke GridGeometry.reduce(…) makes that clear and avoid the need for
more flags in this GridDerivation class.
-     * Furthermore declaring the 'reduce(…)' method in GridGeometry is more consistent
with 'GridExtent.reduce(…)'.
+     * Furthermore declaring the `reduce(…)` method in GridGeometry is more consistent
with `GridExtent.reduce(…)`.
      */
 
     /**
diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridExtent.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridExtent.java
index 04ac1ea..513244d 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridExtent.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridExtent.java
@@ -918,7 +918,7 @@ public class GridExtent implements GridEnvelope, LenientComparable, Serializable
             /*
              * If the envelope contains some NaN values, try to replace them by constant
values inferred from the math transform.
              * We must use the MathTransform specified by the user (gridToCRS), not necessarily
the cornerToCRS transform, because
-             * inferring a 'cornerToCRS' by translating a 'centerToCRS' by 0.5 cell increase
the amount of NaN values in the matrix.
+             * inferring a `cornerToCRS` by translating a `centerToCRS` by 0.5 cell increase
the amount of NaN values in the matrix.
              * For giving a chance to TransformSeparator to perform its work, we need the
minimal amount of NaN values.
              */
             final boolean isCenter = (gridToCRS != cornerToCRS);
@@ -927,7 +927,7 @@ public class GridExtent implements GridEnvelope, LenientComparable, Serializable
                 if (coordinates[srcDim + dimension] == 0 && coordinates[srcDim] ==
0) {
                     /*
                      * At this point we found a grid dimension with [0 … 0] range. Only
this specific range is processed because
-                     * it is assumed associated to NaN scale factors in the 'gridToCRS' matrix,
since the resolution is computed
+                     * it is assumed associated to NaN scale factors in the `gridToCRS` matrix,
since the resolution is computed
                      * by 0/0.  We require the range to be [0 … 0] instead of [n … n]
because if grid indices are not zero, then
                      * we would need to know the scale factors for computing the offset.
                      */
@@ -981,7 +981,7 @@ public class GridExtent implements GridEnvelope, LenientComparable, Serializable
                     double upper = envelope.getUpper(tgtDim);
                     if (Double.isNaN(lower)) {lower = fallback.getMinimum(tgtDim); modified
= true;}
                     if (Double.isNaN(upper)) {upper = fallback.getMaximum(tgtDim); modified
= true;}
-                    if (modified && !(lower > upper)) {                // Use
'!' for accepting NaN.
+                    if (modified && !(lower > upper)) {                // Use
`!` for accepting NaN.
                         envelope.setRange(tgtDim, lower, upper);
                     }
                 }
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WraparoundAdjustment.java
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WraparoundAdjustment.java
index 3f94331..016fb34 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WraparoundAdjustment.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WraparoundAdjustment.java
@@ -241,7 +241,7 @@ public final class WraparoundAdjustment {
              */
             final DirectPosition lowerCorner;
             final DirectPosition upperCorner;
-            GeneralEnvelope shifted;            // To be initialized to a copy of 'areaOfInterest'
when first needed.
+            GeneralEnvelope shifted;            // To be initialized to a copy of `areaOfInterest`
when first needed.
             if (replaceCRS()) {
                 shifted     = Envelopes.transform(geographicToAOI.inverse(), areaOfInterest);
                 lowerCorner = shifted.getLowerCorner();
@@ -252,7 +252,7 @@ public final class WraparoundAdjustment {
                 upperCorner = areaOfInterest.getUpperCorner();
             }
             /*
-             * We will not read 'areaOfInterest' anymore after we got its two corner points
(except for creating
+             * We will not read `areaOfInterest` anymore after we got its two corner points
(except for creating
              * a copy if `shifted` is still null). The following loop searches for "wraparound"
axes.
              */
             final CoordinateSystem cs = crs.getCoordinateSystem();
@@ -267,7 +267,7 @@ public final class WraparoundAdjustment {
                     transformDomainToAOI();
                     /*
                      * "Unroll" the range. For example if we have [+160 … -170]° of longitude,
we can replace by [160 … 190]°.
-                     * We do not change the 'lower' or 'upper' value now in order to avoid
rounding error. Instead we compute
+                     * We do not change the `lower` or `upper` value now in order to avoid
rounding error. Instead we compute
                      * how many periods we need to add to those values. We adjust the side
which results in the value closest
                      * to zero, in order to reduce rounding error if no more adjustment is
done in the next block.
                      */
@@ -276,13 +276,13 @@ public final class WraparoundAdjustment {
                     double lowerCycles = 0;                             // In number of periods.
                     double upperCycles = 0;
                     double delta = upper - lower;
-                    if (MathFunctions.isNegative(delta)) {              // Use 'isNegative'
for catching [+0 … -0] range.
+                    if (MathFunctions.isNegative(delta)) {              // Use `isNegative`
for catching [+0 … -0] range.
                         final double cycles = (delta == 0) ? -1 : Math.floor(delta / period);
        // Always negative.
                         delta = cycles * period;
                         if (Math.abs(lower + delta) < Math.abs(upper - delta)) {
-                            lowerCycles = cycles;                                    // Will
subtract periods to 'lower'.
+                            lowerCycles = cycles;                                    // Will
subtract periods to `lower`.
                         } else {
-                            upperCycles = -cycles;                                   // Will
add periods to 'upper'.
+                            upperCycles = -cycles;                                   // Will
add periods to `upper`.
                         }
                     }
                     /*
@@ -299,7 +299,7 @@ public final class WraparoundAdjustment {
                      *   │    false    │    true    │ AOI on right of valid area │
Add negative amount of period │
                      *   └─────────────┴────────────┴────────────────────────────┴───────────────────────────────┘
                      *
-                     * We try to compute multiples of 'periods' instead than just adding
or subtracting 'periods' once in
+                     * We try to compute multiples of `periods` instead than just adding
or subtracting `periods` once in
                      * order to support images that cover more than one period, for example
images over 720° of longitude.
                      * It may happen for example if an image shows data under the trajectory
of a satellite.
                      */
@@ -316,7 +316,7 @@ public final class WraparoundAdjustment {
                             /*
                              * Notation: ⎣x⎦=floor(x) and ⎡x⎤=ceil(x).
                              *
-                             * We need to add an integer amount of 'period' to both sides
in order to move the range
+                             * We need to add an integer amount of `period` to both sides
in order to move the range
                              * inside the valid area. We need  ⎣lowerToValidStart⎦  for
reaching the point where:
                              *
                              *     (validStart - period) < (new lower) ≦ validStart
@@ -361,7 +361,7 @@ public final class WraparoundAdjustment {
                         } else {
                             /*
                              * Same reasoning than above with sign reverted and lower/upper
variables interchanged.
-                             * In this block, 'upperToValidEnd' and 'lowerToValidEnd' are
negative, contrarily to
+                             * In this block, `upperToValidEnd` and `lowerToValidEnd` are
negative, contrarily to
                              * above block where they were positive.
                              */
                             final double cycles = Math.max(Math.ceil (upperToValidStart),
@@ -377,7 +377,7 @@ public final class WraparoundAdjustment {
                     }
                     /*
                      * If there is change to apply, copy the envelope when first needed and
set the fields.
-                     * If we never enter in this block, then 'areaOfInterest' will stay the
envelope given
+                     * If we never enter in this block, then `areaOfInterest` will stay the
envelope given
                      * at construction time.
                      */
                     if (lowerCycles != 0 || upperCycles != 0) {
@@ -385,7 +385,7 @@ public final class WraparoundAdjustment {
                         if (shifted == null) {
                             shifted = new GeneralEnvelope(areaOfInterest);
                         }
-                        areaOfInterest = shifted;                           // 'shifted'
may have been set before the loop.
+                        areaOfInterest = shifted;                           // `shifted`
may have been set before the loop.
                         shifted.setRange(i, lower + lowerCycles * period,   // TODO: use
Math.fma in JDK9.
                                             upper + upperCycles * period);
                     }
@@ -417,7 +417,7 @@ public final class WraparoundAdjustment {
             if (replaceCRS()) {
                 shifted = geographicToAOI.inverse().transform(pointOfInterest, null);
             } else {
-                shifted = pointOfInterest;              // To be replaced by a copy of 'pointOfInterest'
when first needed.
+                shifted = pointOfInterest;              // To be replaced by a copy of `pointOfInterest`
when first needed.
             }
             final CoordinateSystem cs = crs.getCoordinateSystem();
             for (int i=cs.getDimension(); --i >= 0;) {
@@ -441,7 +441,7 @@ public final class WraparoundAdjustment {
                         if (shifted == pointOfInterest) {
                             shifted = new GeneralDirectPosition(pointOfInterest);
                         }
-                        pointOfInterest = shifted;                         // 'shifted' may
have been set before the loop.
+                        pointOfInterest = shifted;                         // `shifted` may
have been set before the loop.
                         shifted.setOrdinate(i, x + delta * period);        // TODO: use Math.fma
in JDK9.
                     }
                 }


Mime
View raw message