You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by js...@apache.org on 2019/01/24 14:49:09 UTC

[sis] branch geoapi-4.0 updated: GridGeometry: add test case for GridGeometry subgrid with envelope crossing the antimeridian

This is an automated email from the ASF dual-hosted git repository.

jsorel 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 46d9491  GridGeometry: add test case for GridGeometry subgrid with envelope crossing the antimeridian
46d9491 is described below

commit 46d9491b4ce2bb1a58ec88bea451211d50be7e0d
Author: jsorel <jo...@geomatys.com>
AuthorDate: Thu Jan 24 16:48:48 2019 +0100

    GridGeometry: add test case for GridGeometry subgrid with envelope crossing the antimeridian
---
 .../apache/sis/coverage/grid/GridGeometryTest.java | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/core/sis-raster/src/test/java/org/apache/sis/coverage/grid/GridGeometryTest.java b/core/sis-raster/src/test/java/org/apache/sis/coverage/grid/GridGeometryTest.java
index 7907a22..cb9bdf2 100644
--- a/core/sis-raster/src/test/java/org/apache/sis/coverage/grid/GridGeometryTest.java
+++ b/core/sis-raster/src/test/java/org/apache/sis/coverage/grid/GridGeometryTest.java
@@ -26,11 +26,15 @@ import org.apache.sis.referencing.operation.matrix.Matrices;
 import org.apache.sis.referencing.operation.transform.MathTransforms;
 import org.apache.sis.referencing.crs.HardCodedCRS;
 import org.apache.sis.geometry.GeneralEnvelope;
+import org.apache.sis.internal.referencing.j2d.AffineTransform2D;
+import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.apache.sis.test.ReferencingAssert.*;
+import org.junit.Ignore;
+import org.opengis.geometry.Envelope;
 
 
 /**
@@ -233,4 +237,24 @@ public final strictfp class GridGeometryTest extends TestCase {
                 0.5, 0,  -179.75,
                 0,   0,     1), MathTransforms.getMatrix(grid.getGridToCRS(PixelInCell.CELL_CENTER)), STRICT);
     }
+
+    /**
+     * Test derivate grid geometry with an envelope crossing the antimeridian.
+     */
+    @Test
+    @Ignore
+    public void testSubGridCrossingAntiMeridian() {
+
+        final GridExtent extent = new GridExtent(200, 180);
+        final AffineTransform2D gridToCrs = new AffineTransform2D(1, 0, 0, -1, 80, 90);
+        final GridGeometry grid = new GridGeometry(extent, PixelInCell.CELL_CORNER, gridToCrs, CommonCRS.WGS84.normalizedGeographic());
+
+        final GeneralEnvelope aoi = new GeneralEnvelope(CommonCRS.WGS84.normalizedGeographic());
+        aoi.setRange(0, 140, -179);
+        aoi.setRange(1, -90, 90);
+
+        final GridGeometry subgrid = grid.derive().subgrid(aoi).build();
+        Envelope subEnv = subgrid.getEnvelope();
+        assertEquals(aoi, subEnv);
+    }
 }