sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 02/02: Verify that the requested extent intersects the data extent.
Date Thu, 28 May 2020 14:21:46 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 808655c3909d458455bc29be6565980e9127bc02
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Thu May 28 16:20:56 2020 +0200

    Verify that the requested extent intersects the data extent.
---
 .../main/java/org/apache/sis/coverage/grid/GridCoverage2D.java   | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

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 8462b97..47c71e7 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
@@ -555,11 +555,10 @@ public class GridCoverage2D extends GridCoverage {
             sliceExtent = extent;
         }
         if (extent != null) {
-            for (int i = min(sliceExtent.getDimension(), extent.getDimension()); --i >=
0;) {
-                if (i != xDimension && i != yDimension) {
-                    if (sliceExtent.getHigh(i) < extent.getLow(i) || sliceExtent.getLow(i)
> extent.getHigh(i)) {
-                        throw new DisjointExtentException(extent, sliceExtent, i);
-                    }
+            final int n = min(sliceExtent.getDimension(), extent.getDimension());
+            for (int i=0; i<n; i++) {
+                if (sliceExtent.getHigh(i) < extent.getLow(i) || sliceExtent.getLow(i)
> extent.getHigh(i)) {
+                    throw new DisjointExtentException(extent, sliceExtent, i);
                 }
             }
         }


Mime
View raw message