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 a8a4a6f  Bug fix: default accuracy needs to be divided by grid cell 
size.
a8a4a6f is described below

commit a8a4a6f350f916c9fcf7ad258afdf7e6df9adf34
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Mon Oct 15 09:20:22 2018 +0200

    Bug fix: default accuracy needs to be divided by grid cell size.
---
 .../main/java/org/apache/sis/internal/referencing/provider/NTv2.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NTv2.java
 
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NTv2.java
index d4a6767..0003409 100644
--- 
a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NTv2.java
+++ 
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/NTv2.java
@@ -348,11 +348,12 @@ public final class NTv2 extends AbstractProvider {
              * during inverse transformations. If we did not found that 
information in the file, compute
              * an arbitrary default accuracy.
              */
+            final double size = Math.max(dx, dy);
             if (Double.isNaN(grid.accuracy)) {
-                grid.accuracy = 
Units.DEGREE.getConverterTo(unit).convert(Formulas.ANGULAR_TOLERANCE);
+                grid.accuracy = 
Units.DEGREE.getConverterTo(unit).convert(Formulas.ANGULAR_TOLERANCE) / size;
             }
             header.keySet().retainAll(Arrays.asList(overviewKeys));   // Keep 
only overview records.
-            return DatumShiftGridCompressed.compress(grid, null, precision / 
Math.max(dx, dy));
+            return DatumShiftGridCompressed.compress(grid, null, precision / 
size);
         }
 
         /**

Reply via email to