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 95e0ce2  Compute the `gridToCRS` transform is a `GridGeometry` is 
given with only an envelope.
95e0ce2 is described below

commit 95e0ce24f45cf5460a15bf17979c55c3e9c3cb62
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Wed Mar 18 15:06:37 2020 +0100

    Compute the `gridToCRS` transform is a `GridGeometry` is given with only an 
envelope.
---
 .../src/main/java/org/apache/sis/coverage/grid/GridCoverage2D.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 405386a..c367672 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
@@ -254,10 +254,12 @@ public class GridCoverage2D extends GridCoverage {
                     crs = domain.getCoordinateReferenceSystem();
                 }
                 final GridExtent extent = createExtent(dimension, data, crs);
-                try {
+                if (domain.isDefined(GridGeometry.GRID_TO_CRS)) try {
                     domain = new GridGeometry(domain, extent, null);
                 } catch (TransformException e) {
                     throw new IllegalGridGeometryException(e);                 
 // Should never happen.
+                } else {
+                    domain = new GridGeometry(extent, domain.envelope);
                 }
             }
         }

Reply via email to