sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1760780 [9/11] - in /sis/branches/JDK7: ./ application/sis-webapp/src/test/ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-metadata/src/main/java/org/apache/sis/metadata/ core/sis-metadata/src/main/java/org/apache/sis/meta...
Date Wed, 14 Sep 2016 21:29:51 GMT
Modified: sis/branches/JDK7/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -17,10 +17,12 @@
 package org.apache.sis.storage.earthobservation;
 
 import java.util.Locale;
+import java.util.regex.Matcher;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import org.opengis.metadata.Metadata;
+import org.opengis.util.FactoryException;
 import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.util.logging.EmptyWarningListeners;
@@ -28,8 +30,9 @@ import org.apache.sis.internal.system.Mo
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static org.apache.sis.test.Assert.assertMultilinesEquals;
+import static org.apache.sis.test.Assert.*;
 import static org.apache.sis.test.TestUtilities.formatNameAndValue;
+import static org.apache.sis.storage.earthobservation.LandsatReader.DIM;
 
 
 /**
@@ -42,6 +45,32 @@ import static org.apache.sis.test.TestUt
  */
 public class LandsatReaderTest extends TestCase {
     /**
+     * Tests the regular expression used for detecting the
+     * “Image courtesy of the U.S. Geological Survey” credit.
+     */
+    @Test
+    public void testCreditPattern() {
+        final Matcher m = LandsatReader.CREDIT.matcher("Image courtesy of the U.S. Geological Survey");
+        assertTrue("matches", m.find());
+        assertEquals("end", 22, m.end());
+    }
+
+    /**
+     * Verifies the value of the {@link LandsatReader#BAND_GROUPS} mask.
+     */
+    @Test
+    public void verifyBandGroupsMask() {
+        final int[] PANCHROMATIC = {8};
+        final int[] REFLECTIVE   = {1, 2, 3, 4, 5, 6, 7, 9};
+        final int[] THERMAL      = {10, 11};
+        long mask = 0;
+        for (int i=0; i < PANCHROMATIC.length; i++) mask |= (LandsatReader.PANCHROMATIC/DIM << 2*(PANCHROMATIC[i] - 1));
+        for (int i=0; i <   REFLECTIVE.length; i++) mask |= (LandsatReader.REFLECTIVE/DIM   <<   2*(REFLECTIVE[i] - 1));
+        for (int i=0; i <      THERMAL.length; i++) mask |= (LandsatReader.THERMAL/DIM      <<      2*(THERMAL[i] - 1));
+        assertEquals("BAND_GROUPS", mask, LandsatReader.BAND_GROUPS);
+    }
+
+    /**
      * Tests {@link LandsatReader#read()}.
      *
      * <p><b>NOTE FOR MAINTAINER:</b> if the result of this test changes, consider updating
@@ -49,131 +78,251 @@ public class LandsatReaderTest extends T
      *
      * @throws IOException if an error occurred while reading the test file.
      * @throws DataStoreException if a property value can not be parsed as a number or a date.
+     * @throws FactoryException if an error occurred while creating the Coordinate Reference System.
      */
     @Test
-    public void testRead() throws IOException, DataStoreException {
+    public void testRead() throws IOException, DataStoreException, FactoryException {
         final Metadata actual;
         try (BufferedReader in = new BufferedReader(new InputStreamReader(
                 LandsatReaderTest.class.getResourceAsStream("LandsatTest.txt"), "UTF-8")))
         {
-            actual = new LandsatReader(in, new EmptyWarningListeners<>(Locale.US, Modules.EARTH_OBSERVATION)).read();
+            final LandsatReader reader = new LandsatReader("LandsatTest.txt", Locale.ENGLISH,
+                    new EmptyWarningListeners<>(Locale.ENGLISH, Modules.EARTH_OBSERVATION));
+            reader.read(in);
+            actual = reader.getMetadata();
         }
         final String text = formatNameAndValue(DefaultMetadata.castOrCopy(actual).asTreeTable());
         assertMultilinesEquals(
                 "Metadata\n"
-                + "  ├─Language…………………………………………………………………………… en\n"
+                + "  ├─Language…………………………………………………………………………………………… en\n"
+                + "  ├─Spatial representation info (1 of 3)\n"
+                + "  │   ├─Number of dimensions………………………………………………… 2\n"
+                + "  │   ├─Axis dimension properties (1 of 2)\n"
+                + "  │   │   ├─Dimension name……………………………………………………… Sample\n"
+                + "  │   │   └─Dimension size……………………………………………………… 15000\n"
+                + "  │   ├─Axis dimension properties (2 of 2)\n"
+                + "  │   │   ├─Dimension name……………………………………………………… Line\n"
+                + "  │   │   └─Dimension size……………………………………………………… 15500\n"
+                + "  │   └─Transformation parameter availability…… false\n"
+                + "  ├─Spatial representation info (2 of 3)\n"
+                + "  │   ├─Number of dimensions………………………………………………… 2\n"
+                + "  │   ├─Axis dimension properties (1 of 2)\n"
+                + "  │   │   ├─Dimension name……………………………………………………… Sample\n"
+                + "  │   │   └─Dimension size……………………………………………………… 7600\n"
+                + "  │   ├─Axis dimension properties (2 of 2)\n"
+                + "  │   │   ├─Dimension name……………………………………………………… Line\n"
+                + "  │   │   └─Dimension size……………………………………………………… 7800\n"
+                + "  │   └─Transformation parameter availability…… false\n"
+                + "  ├─Spatial representation info (3 of 3)\n"
+                + "  │   ├─Number of dimensions………………………………………………… 2\n"
+                + "  │   ├─Axis dimension properties (1 of 2)\n"
+                + "  │   │   ├─Dimension name……………………………………………………… Sample\n"
+                + "  │   │   └─Dimension size……………………………………………………… 7600\n"
+                + "  │   ├─Axis dimension properties (2 of 2)\n"
+                + "  │   │   ├─Dimension name……………………………………………………… Line\n"
+                + "  │   │   └─Dimension size……………………………………………………… 7800\n"
+                + "  │   └─Transformation parameter availability…… false\n"
+                + "  ├─Reference system info………………………………………………………… EPSG:WGS 84 / UTM zone 49N\n"
                 + "  ├─Identification info\n"
                 + "  │   ├─Citation\n"
                 + "  │   │   ├─Date\n"
-                + "  │   │   │   ├─Date……………………………………………………… 2016-06-27 16:48:12\n"
-                + "  │   │   │   └─Date type………………………………………… Creation\n"
+                + "  │   │   │   ├─Date……………………………………………………………………… 2016-06-27 16:48:12\n"
+                + "  │   │   │   └─Date type………………………………………………………… Creation\n"
                 + "  │   │   └─Identifier\n"
-                + "  │   │       └─Code……………………………………………………… LandsatTest\n"
-                + "  │   ├─Credit……………………………………………………………………… Derived from U.S. Geological Survey data\n"
+                + "  │   │       └─Code……………………………………………………………………… LandsatTest\n"
+                + "  │   ├─Credit……………………………………………………………………………………… Derived from U.S. Geological Survey data\n"
                 + "  │   ├─Resource format\n"
                 + "  │   │   └─Format specification citation\n"
-                + "  │   │       ├─Title…………………………………………………… GeoTIFF Coverage Encoding Profile\n"
-                + "  │   │       └─Alternate title………………………… GEOTIFF\n"
+                + "  │   │       ├─Title…………………………………………………………………… GeoTIFF Coverage Encoding Profile\n"
+                + "  │   │       └─Alternate title………………………………………… GEOTIFF\n"
+                + "  │   ├─Spatial resolution (1 of 2)\n"
+                + "  │   │   └─Distance……………………………………………………………………… 15.0\n"
+                + "  │   ├─Spatial resolution (2 of 2)\n"
+                + "  │   │   └─Distance……………………………………………………………………… 30.0\n"
                 + "  │   └─Extent\n"
                 + "  │       └─Geographic element\n"
-                + "  │           ├─West bound longitude…………… 108°20′24″E\n"
-                + "  │           ├─East bound longitude…………… 110°26′24″E\n"
-                + "  │           ├─South bound latitude…………… 10°30′N\n"
-                + "  │           ├─North bound latitude…………… 12°37′12″N\n"
-                + "  │           └─Extent type code……………………… true\n"
+                + "  │           ├─West bound longitude…………………………… 108°20′24″E\n"
+                + "  │           ├─East bound longitude…………………………… 110°26′24″E\n"
+                + "  │           ├─South bound latitude…………………………… 10°30′N\n"
+                + "  │           ├─North bound latitude…………………………… 12°37′12″N\n"
+                + "  │           └─Extent type code……………………………………… true\n"
                 + "  ├─Content info\n"
-                + "  │   ├─Illumination elevation angle…………… 58.8\n"
-                + "  │   ├─Illumination azimuth angle………………… 116.9\n"
-                + "  │   ├─Cloud cover percentage…………………………… 8.3\n"
-                + "  │   └─Attribute group\n"
-                + "  │       ├─Content type…………………………………………… Physical measurement\n"
-                + "  │       ├─Attribute (1 of 11)\n"
-                + "  │       │   ├─Peak response……………………………… 433.0\n"
-                + "  │       │   ├─Bound units…………………………………… nm\n"
-                + "  │       │   └─Description…………………………………… Coastal Aerosol\n"
-                + "  │       ├─Attribute (2 of 11)\n"
-                + "  │       │   ├─Peak response……………………………… 482.0\n"
-                + "  │       │   ├─Bound units…………………………………… nm\n"
-                + "  │       │   └─Description…………………………………… Blue\n"
-                + "  │       ├─Attribute (3 of 11)\n"
-                + "  │       │   ├─Peak response……………………………… 562.0\n"
-                + "  │       │   ├─Bound units…………………………………… nm\n"
-                + "  │       │   └─Description…………………………………… Green\n"
-                + "  │       ├─Attribute (4 of 11)\n"
-                + "  │       │   ├─Peak response……………………………… 655.0\n"
-                + "  │       │   ├─Bound units…………………………………… nm\n"
-                + "  │       │   └─Description…………………………………… Red\n"
-                + "  │       ├─Attribute (5 of 11)\n"
-                + "  │       │   ├─Peak response……………………………… 865.0\n"
-                + "  │       │   ├─Bound units…………………………………… nm\n"
-                + "  │       │   └─Description…………………………………… Near-Infrared\n"
-                + "  │       ├─Attribute (6 of 11)\n"
-                + "  │       │   ├─Peak response……………………………… 1610.0\n"
-                + "  │       │   ├─Bound units…………………………………… nm\n"
-                + "  │       │   └─Description…………………………………… Short Wavelength Infrared (SWIR) 1\n"
-                + "  │       ├─Attribute (7 of 11)\n"
-                + "  │       │   ├─Peak response……………………………… 2200.0\n"
-                + "  │       │   ├─Bound units…………………………………… nm\n"
-                + "  │       │   └─Description…………………………………… Short Wavelength Infrared (SWIR) 2\n"
-                + "  │       ├─Attribute (8 of 11)\n"
-                + "  │       │   ├─Peak response……………………………… 590.0\n"
-                + "  │       │   ├─Bound units…………………………………… nm\n"
-                + "  │       │   └─Description…………………………………… Panchromatic\n"
-                + "  │       ├─Attribute (9 of 11)\n"
-                + "  │       │   ├─Peak response……………………………… 1375.0\n"
-                + "  │       │   ├─Bound units…………………………………… nm\n"
-                + "  │       │   └─Description…………………………………… Cirrus\n"
-                + "  │       ├─Attribute (10 of 11)\n"
-                + "  │       │   ├─Peak response……………………………… 10800.0\n"
-                + "  │       │   ├─Bound units…………………………………… nm\n"
-                + "  │       │   └─Description…………………………………… Thermal Infrared Sensor (TIRS) 1\n"
-                + "  │       └─Attribute (11 of 11)\n"
-                + "  │           ├─Peak response……………………………… 12000.0\n"
-                + "  │           ├─Bound units…………………………………… nm\n"
-                + "  │           └─Description…………………………………… Thermal Infrared Sensor (TIRS) 2\n"
+                + "  │   ├─Illumination elevation angle…………………………… 58.8\n"
+                + "  │   ├─Illumination azimuth angle………………………………… 116.9\n"
+                + "  │   ├─Cloud cover percentage…………………………………………… 8.3\n"
+                + "  │   ├─Attribute group (1 of 3)\n"
+                + "  │   │   ├─Content type…………………………………………………………… Physical measurement\n"
+                + "  │   │   ├─Attribute (1 of 8)\n"
+                + "  │   │   │   ├─Max value………………………………………………………… 65535.0\n"
+                + "  │   │   │   ├─Min value………………………………………………………… 1.0\n"
+                + "  │   │   │   ├─Peak response……………………………………………… 433.0\n"
+                + "  │   │   │   ├─Scale factor………………………………………………… 0.0127\n"
+                + "  │   │   │   ├─Offset………………………………………………………………… -63.6\n"
+                + "  │   │   │   ├─Transfer function type……………………… Linear\n"
+                + "  │   │   │   ├─Bound units…………………………………………………… nm\n"
+                + "  │   │   │   ├─Description…………………………………………………… Coastal Aerosol\n"
+                + "  │   │   │   └─Name\n"
+                + "  │   │   │       └─Code…………………………………………………………… TestImage_B1.TIF\n"
+                + "  │   │   ├─Attribute (2 of 8)\n"
+                + "  │   │   │   ├─Max value………………………………………………………… 65535.0\n"
+                + "  │   │   │   ├─Min value………………………………………………………… 1.0\n"
+                + "  │   │   │   ├─Peak response……………………………………………… 482.0\n"
+                + "  │   │   │   ├─Scale factor………………………………………………… 0.013\n"
+                + "  │   │   │   ├─Offset………………………………………………………………… -65.1\n"
+                + "  │   │   │   ├─Transfer function type……………………… Linear\n"
+                + "  │   │   │   ├─Bound units…………………………………………………… nm\n"
+                + "  │   │   │   ├─Description…………………………………………………… Blue\n"
+                + "  │   │   │   └─Name\n"
+                + "  │   │   │       └─Code…………………………………………………………… TestImage_B2.TIF\n"
+                + "  │   │   ├─Attribute (3 of 8)\n"
+                + "  │   │   │   ├─Max value………………………………………………………… 65535.0\n"
+                + "  │   │   │   ├─Min value………………………………………………………… 1.0\n"
+                + "  │   │   │   ├─Peak response……………………………………………… 562.0\n"
+                + "  │   │   │   ├─Scale factor………………………………………………… 0.012\n"
+                + "  │   │   │   ├─Offset………………………………………………………………… -60.0\n"
+                + "  │   │   │   ├─Transfer function type……………………… Linear\n"
+                + "  │   │   │   ├─Bound units…………………………………………………… nm\n"
+                + "  │   │   │   ├─Description…………………………………………………… Green\n"
+                + "  │   │   │   └─Name\n"
+                + "  │   │   │       └─Code…………………………………………………………… TestImage_B3.TIF\n"
+                + "  │   │   ├─Attribute (4 of 8)\n"
+                + "  │   │   │   ├─Max value………………………………………………………… 65535.0\n"
+                + "  │   │   │   ├─Min value………………………………………………………… 1.0\n"
+                + "  │   │   │   ├─Peak response……………………………………………… 655.0\n"
+                + "  │   │   │   ├─Scale factor………………………………………………… 0.0101\n"
+                + "  │   │   │   ├─Offset………………………………………………………………… -50.6\n"
+                + "  │   │   │   ├─Transfer function type……………………… Linear\n"
+                + "  │   │   │   ├─Bound units…………………………………………………… nm\n"
+                + "  │   │   │   ├─Description…………………………………………………… Red\n"
+                + "  │   │   │   └─Name\n"
+                + "  │   │   │       └─Code…………………………………………………………… TestImage_B4.TIF\n"
+                + "  │   │   ├─Attribute (5 of 8)\n"
+                + "  │   │   │   ├─Max value………………………………………………………… 65535.0\n"
+                + "  │   │   │   ├─Min value………………………………………………………… 1.0\n"
+                + "  │   │   │   ├─Peak response……………………………………………… 865.0\n"
+                + "  │   │   │   ├─Scale factor………………………………………………… 0.00619\n"
+                + "  │   │   │   ├─Offset………………………………………………………………… -31.0\n"
+                + "  │   │   │   ├─Transfer function type……………………… Linear\n"
+                + "  │   │   │   ├─Bound units…………………………………………………… nm\n"
+                + "  │   │   │   ├─Description…………………………………………………… Near-Infrared\n"
+                + "  │   │   │   └─Name\n"
+                + "  │   │   │       └─Code…………………………………………………………… TestImage_B5.TIF\n"
+                + "  │   │   ├─Attribute (6 of 8)\n"
+                + "  │   │   │   ├─Max value………………………………………………………… 65535.0\n"
+                + "  │   │   │   ├─Min value………………………………………………………… 1.0\n"
+                + "  │   │   │   ├─Peak response……………………………………………… 1610.0\n"
+                + "  │   │   │   ├─Scale factor………………………………………………… 0.00154\n"
+                + "  │   │   │   ├─Offset………………………………………………………………… -7.7\n"
+                + "  │   │   │   ├─Transfer function type……………………… Linear\n"
+                + "  │   │   │   ├─Bound units…………………………………………………… nm\n"
+                + "  │   │   │   ├─Description…………………………………………………… Short Wavelength Infrared (SWIR) 1\n"
+                + "  │   │   │   └─Name\n"
+                + "  │   │   │       └─Code…………………………………………………………… TestImage_B6.TIF\n"
+                + "  │   │   ├─Attribute (7 of 8)\n"
+                + "  │   │   │   ├─Max value………………………………………………………… 65535.0\n"
+                + "  │   │   │   ├─Min value………………………………………………………… 1.0\n"
+                + "  │   │   │   ├─Peak response……………………………………………… 2200.0\n"
+                + "  │   │   │   ├─Scale factor………………………………………………… 5.19E-4\n"
+                + "  │   │   │   ├─Offset………………………………………………………………… -2.6\n"
+                + "  │   │   │   ├─Transfer function type……………………… Linear\n"
+                + "  │   │   │   ├─Bound units…………………………………………………… nm\n"
+                + "  │   │   │   ├─Description…………………………………………………… Short Wavelength Infrared (SWIR) 2\n"
+                + "  │   │   │   └─Name\n"
+                + "  │   │   │       └─Code…………………………………………………………… TestImage_B7.TIF\n"
+                + "  │   │   └─Attribute (8 of 8)\n"
+                + "  │   │       ├─Max value………………………………………………………… 65535.0\n"
+                + "  │   │       ├─Min value………………………………………………………… 1.0\n"
+                + "  │   │       ├─Peak response……………………………………………… 1375.0\n"
+                + "  │   │       ├─Scale factor………………………………………………… 0.00242\n"
+                + "  │   │       ├─Offset………………………………………………………………… -12.1\n"
+                + "  │   │       ├─Transfer function type……………………… Linear\n"
+                + "  │   │       ├─Bound units…………………………………………………… nm\n"
+                + "  │   │       ├─Description…………………………………………………… Cirrus\n"
+                + "  │   │       └─Name\n"
+                + "  │   │           └─Code…………………………………………………………… TestImage_B9.TIF\n"
+                + "  │   ├─Attribute group (2 of 3)\n"
+                + "  │   │   ├─Content type…………………………………………………………… Physical measurement\n"
+                + "  │   │   └─Attribute\n"
+                + "  │   │       ├─Max value………………………………………………………… 65535.0\n"
+                + "  │   │       ├─Min value………………………………………………………… 1.0\n"
+                + "  │   │       ├─Peak response……………………………………………… 590.0\n"
+                + "  │   │       ├─Scale factor………………………………………………… 0.0115\n"
+                + "  │   │       ├─Offset………………………………………………………………… -57.3\n"
+                + "  │   │       ├─Transfer function type……………………… Linear\n"
+                + "  │   │       ├─Bound units…………………………………………………… nm\n"
+                + "  │   │       ├─Description…………………………………………………… Panchromatic\n"
+                + "  │   │       └─Name\n"
+                + "  │   │           └─Code…………………………………………………………… TestImage_B8.TIF\n"
+                + "  │   └─Attribute group (3 of 3)\n"
+                + "  │       ├─Content type…………………………………………………………… Physical measurement\n"
+                + "  │       ├─Attribute (1 of 2)\n"
+                + "  │       │   ├─Max value………………………………………………………… 65535.0\n"
+                + "  │       │   ├─Min value………………………………………………………… 1.0\n"
+                + "  │       │   ├─Peak response……………………………………………… 10800.0\n"
+                + "  │       │   ├─Scale factor………………………………………………… 3.34E-4\n"
+                + "  │       │   ├─Offset………………………………………………………………… 0.1\n"
+                + "  │       │   ├─Transfer function type……………………… Linear\n"
+                + "  │       │   ├─Bound units…………………………………………………… nm\n"
+                + "  │       │   ├─Description…………………………………………………… Thermal Infrared Sensor (TIRS) 1\n"
+                + "  │       │   └─Name\n"
+                + "  │       │       └─Code…………………………………………………………… TestImage_B10.TIF\n"
+                + "  │       └─Attribute (2 of 2)\n"
+                + "  │           ├─Max value………………………………………………………… 65535.0\n"
+                + "  │           ├─Min value………………………………………………………… 1.0\n"
+                + "  │           ├─Peak response……………………………………………… 12000.0\n"
+                + "  │           ├─Scale factor………………………………………………… 3.34E-4\n"
+                + "  │           ├─Offset………………………………………………………………… 0.1\n"
+                + "  │           ├─Transfer function type……………………… Linear\n"
+                + "  │           ├─Bound units…………………………………………………… nm\n"
+                + "  │           ├─Description…………………………………………………… Thermal Infrared Sensor (TIRS) 2\n"
+                + "  │           └─Name\n"
+                + "  │               └─Code…………………………………………………………… TestImage_B11.TIF\n"
                 + "  ├─Acquisition information\n"
+                + "  │   ├─Acquisition requirement\n"
+                + "  │   │   └─Identifier\n"
+                + "  │   │       └─Code……………………………………………………………………… Software unit tests\n"
                 + "  │   ├─Operation\n"
-                + "  │   │   ├─Status…………………………………………………………… Completed\n"
-                + "  │   │   ├─Type………………………………………………………………… Real\n"
+                + "  │   │   ├─Status…………………………………………………………………………… Completed\n"
+                + "  │   │   ├─Type………………………………………………………………………………… Real\n"
                 + "  │   │   └─Significant event\n"
-                + "  │   │       ├─Context……………………………………………… Acquisition\n"
-                + "  │   │       └─Time……………………………………………………… 2016-06-26 03:02:01\n"
+                + "  │   │       ├─Context……………………………………………………………… Acquisition\n"
+                + "  │   │       └─Time……………………………………………………………………… 2016-06-26 03:02:01\n"
                 + "  │   └─Platform\n"
                 + "  │       ├─Identifier\n"
-                + "  │       │   └─Code……………………………………………………… Pseudo LANDSAT\n"
+                + "  │       │   └─Code……………………………………………………………………… Pseudo LANDSAT\n"
                 + "  │       └─Instrument\n"
                 + "  │           └─Identifier\n"
-                + "  │               └─Code…………………………………………… Pseudo TIRS\n"
+                + "  │               └─Code…………………………………………………………… Pseudo TIRS\n"
                 + "  ├─Date info\n"
-                + "  │   ├─Date…………………………………………………………………………… 2016-06-27 16:48:12\n"
-                + "  │   └─Date type……………………………………………………………… Creation\n"
+                + "  │   ├─Date…………………………………………………………………………………………… 2016-06-27 16:48:12\n"
+                + "  │   └─Date type……………………………………………………………………………… Creation\n"
                 + "  ├─Metadata scope\n"
-                + "  │   └─Resource scope………………………………………………… Dataset\n"
+                + "  │   └─Resource scope………………………………………………………………… Dataset\n"
                 + "  ├─Metadata identifier\n"
-                + "  │   └─Code…………………………………………………………………………… LandsatTest\n"
+                + "  │   └─Code…………………………………………………………………………………………… LandsatTest\n"
                 + "  ├─Metadata standard (1 of 2)\n"
-                + "  │   ├─Title………………………………………………………………………… Geographic Information — Metadata Part 1: Fundamentals\n"
+                + "  │   ├─Title………………………………………………………………………………………… Geographic Information — Metadata Part 1: Fundamentals\n"
                 + "  │   ├─Cited responsible party\n"
                 + "  │   │   ├─Party\n"
-                + "  │   │   │   └─Name……………………………………………………… International Organization for Standardization\n"
-                + "  │   │   └─Role………………………………………………………………… Principal investigator\n"
-                + "  │   ├─Edition…………………………………………………………………… ISO 19115-1:2014(E)\n"
+                + "  │   │   │   └─Name……………………………………………………………………… International Organization for Standardization\n"
+                + "  │   │   └─Role………………………………………………………………………………… Principal investigator\n"
+                + "  │   ├─Edition…………………………………………………………………………………… ISO 19115-1:2014(E)\n"
                 + "  │   ├─Identifier\n"
-                + "  │   │   ├─Code………………………………………………………………… 19115-1\n"
-                + "  │   │   ├─Code space………………………………………………… ISO\n"
-                + "  │   │   └─Version………………………………………………………… 2014(E)\n"
-                + "  │   └─Presentation form………………………………………… Document digital\n"
+                + "  │   │   ├─Code………………………………………………………………………………… 19115-1\n"
+                + "  │   │   ├─Code space………………………………………………………………… ISO\n"
+                + "  │   │   └─Version………………………………………………………………………… 2014(E)\n"
+                + "  │   └─Presentation form………………………………………………………… Document digital\n"
                 + "  └─Metadata standard (2 of 2)\n"
-                + "      ├─Title………………………………………………………………………… Geographic Information — Metadata Part 2: Extensions for imagery and gridded data\n"
+                + "      ├─Title………………………………………………………………………………………… Geographic Information — Metadata Part 2: Extensions for imagery and gridded data\n"
                 + "      ├─Cited responsible party\n"
                 + "      │   ├─Party\n"
-                + "      │   │   └─Name……………………………………………………… International Organization for Standardization\n"
-                + "      │   └─Role………………………………………………………………… Principal investigator\n"
-                + "      ├─Edition…………………………………………………………………… ISO 19115-2:2009(E)\n"
+                + "      │   │   └─Name……………………………………………………………………… International Organization for Standardization\n"
+                + "      │   └─Role………………………………………………………………………………… Principal investigator\n"
+                + "      ├─Edition…………………………………………………………………………………… ISO 19115-2:2009(E)\n"
                 + "      ├─Identifier\n"
-                + "      │   ├─Code………………………………………………………………… 19115-2\n"
-                + "      │   ├─Code space………………………………………………… ISO\n"
-                + "      │   └─Version………………………………………………………… 2009(E)\n"
-                + "      └─Presentation form………………………………………… Document digital\n", text);
+                + "      │   ├─Code………………………………………………………………………………… 19115-2\n"
+                + "      │   ├─Code space………………………………………………………………… ISO\n"
+                + "      │   └─Version………………………………………………………………………… 2009(E)\n"
+                + "      └─Presentation form………………………………………………………… Document digital\n", text);
     }
 }

Modified: sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -100,7 +100,7 @@ public class GeoTiffStore extends DataSt
             while ((dir = reader.getImageFileDirectory(n++)) != null) {
                 dir.completeMetadata(reader.metadata, locale);
             }
-            metadata = reader.metadata.result();
+            metadata = reader.metadata.build(true);
         } catch (IOException e) {
             throw new DataStoreException(reader.errors().getString(Errors.Keys.CanNotRead_1, reader.input.filename), e);
         } catch (ArithmeticException e) {

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Axis.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Axis.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Axis.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Axis.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -63,10 +63,10 @@ public final class Axis {
      * In the particular case where the number of dimensions is equals to 2, this
      * constructor will detects by itself which grid dimension varies fastest.
      *
-     * @param owner            Provides callback for the conversion from grid coordinates to geodetic coordinates.
-     * @param attributeNames   The attributes to use for fetching dimension information, or {@code null} if unknown.
-     * @param sourceDimensions The index of the grid dimension associated to this axis.
-     * @param sourceSizes      The number of cell elements along that axis.
+     * @param owner             provides callback for the conversion from grid coordinates to geodetic coordinates.
+     * @param attributeNames    the attributes to use for fetching dimension information, or {@code null} if unknown.
+     * @param sourceDimensions  the index of the grid dimension associated to this axis.
+     * @param sourceSizes       the number of cell elements along that axis.
      */
     public Axis(final GridGeometry owner, final AttributeNames.Dimension attributeNames,
             final int[] sourceDimensions, final int[] sourceSizes)

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -50,7 +50,7 @@ public abstract class Decoder implements
     /**
      * Creates a new decoder.
      *
-     * @param listeners Where to send the warnings.
+     * @param  listeners  where to send the warnings.
      */
     protected Decoder(final WarningListeners<?> listeners) {
         Objects.requireNonNull(listeners);
@@ -61,8 +61,8 @@ public abstract class Decoder implements
      * Defines the groups where to search for named attributes, in preference order.
      * The {@code null} group name stands for the global attributes.
      *
-     * @param  groupNames The name of the group where to search, in preference order.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @param  groupNames  the name of the group where to search, in preference order.
+     * @throws IOException if an I/O operation was necessary but failed.
      */
     public abstract void setSearchPath(final String... groupNames) throws IOException;
 
@@ -71,8 +71,8 @@ public abstract class Decoder implements
      * a subset of the array given to {@link #setSearchPath(String[])} since only the name of
      * groups which have been found in the NetCDF file are returned by this method.
      *
-     * @return The current search path.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @return the current search path.
+     * @throws IOException if an I/O operation was necessary but failed.
      */
     public abstract String[] getSearchPath() throws IOException;
 
@@ -81,26 +81,26 @@ public abstract class Decoder implements
      * This method searches in the groups specified by the last call to {@link #setSearchPath(String[])}.
      * Null values and empty strings are ignored.
      *
-     * @param  name The name of the attribute to search, or {@code null}.
-     * @return The attribute value, or {@code null} if none or empty or if the given name was null.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @param  name  the name of the attribute to search, or {@code null}.
+     * @return the attribute value, or {@code null} if none or empty or if the given name was null.
+     * @throws IOException if an I/O operation was necessary but failed.
      */
     public abstract String stringValue(final String name) throws IOException;
 
     /**
      * Returns the value of the attribute of the given name as a number, or {@code null} if none.
      *
-     * @param  name The name of the attribute to search, or {@code null}.
-     * @return The attribute value, or {@code null} if none or unparsable or if the given name was null.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @param  name  the name of the attribute to search, or {@code null}.
+     * @return the attribute value, or {@code null} if none or unparsable or if the given name was null.
+     * @throws IOException if an I/O operation was necessary but failed.
      */
     public abstract Number numericValue(final String name) throws IOException;
 
     /**
      * Convenience method for {@link #numericValue(String)} implementation.
      *
-     * @param  value The attribute value to parse.
-     * @return The parsed attribute value, or {@code null} if the given value can not be parsed.
+     * @param  value  the attribute value to parse.
+     * @return the parsed attribute value, or {@code null} if the given value can not be parsed.
      */
     protected final Number parseNumber(String value) {
         final int s = value.indexOf(' ');
@@ -120,18 +120,18 @@ public abstract class Decoder implements
     /**
      * Returns the value of the attribute of the given name as a date, or {@code null} if none.
      *
-     * @param  name The name of the attribute to search, or {@code null}.
-     * @return The attribute value, or {@code null} if none or unparsable or if the given name was null.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @param  name  the name of the attribute to search, or {@code null}.
+     * @return the attribute value, or {@code null} if none or unparsable or if the given name was null.
+     * @throws IOException if an I/O operation was necessary but failed.
      */
     public abstract Date dateValue(final String name) throws IOException;
 
     /**
      * Returns the value of the attribute of the given name as a unit of measurement, or {@code null} if none.
      *
-     * @param  name The name of the attribute to search, or {@code null}.
-     * @return The attribute value, or {@code null} if none or unparsable or if the given name was null.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @param  name  the name of the attribute to search, or {@code null}.
+     * @return the attribute value, or {@code null} if none or unparsable or if the given name was null.
+     * @throws IOException if an I/O operation was necessary but failed.
      *
      * @todo Current Units.valueOf(String) implementation ignore direction in "degrees_east" or "degrees_west".
      *       We may need to take that in account (with "degrees_west" to "degrees_east" converter that reverse
@@ -151,10 +151,10 @@ public abstract class Decoder implements
      * Converts the given numerical values to date, using the information provided in the given unit symbol.
      * The unit symbol is typically a string like <cite>"days since 1970-01-01T00:00:00Z"</cite>.
      *
-     * @param  symbol The temporal unit name or symbol, followed by the epoch.
-     * @param  values The values to convert. May contains {@code null} elements.
-     * @return The converted values. May contains {@code null} elements.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @param  symbol  the temporal unit name or symbol, followed by the epoch.
+     * @param  values  the values to convert. May contains {@code null} elements.
+     * @return the converted values. May contains {@code null} elements.
+     * @throws IOException if an I/O operation was necessary but failed.
      */
     public abstract Date[] numberToDate(final String symbol, final Number... values) throws IOException;
 
@@ -163,8 +163,8 @@ public abstract class Decoder implements
      * {@link ucar.nc2.NetcdfFile#getId()} method for that purpose, which we will use when
      * possible in case that {@code getId()} method is defined in an other way.
      *
-     * @return The global dataset identifier, or {@code null} if none.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @return the global dataset identifier, or {@code null} if none.
+     * @throws IOException if an I/O operation was necessary but failed.
      */
     public String getId() throws IOException {
         return stringValue("_Id");
@@ -175,8 +175,8 @@ public abstract class Decoder implements
      * {@link ucar.nc2.NetcdfFile#getTitle()} method for that purpose, which we will use when
      * possible in case that {@code getTitle()} method is defined in an other way.
      *
-     * @return The dataset title, or {@code null} if none.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @return the dataset title, or {@code null} if none.
+     * @throws IOException if an I/O operation was necessary but failed.
      */
     public String getTitle() throws IOException {
         return stringValue("_Title");
@@ -186,8 +186,8 @@ public abstract class Decoder implements
      * Returns all variables found in the NetCDF file.
      * This method may return a direct reference to an internal array - do not modify.
      *
-     * @return All variables, or an empty array if none.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @return all variables, or an empty array if none.
+     * @throws IOException if an I/O operation was necessary but failed.
      */
     public abstract Variable[] getVariables() throws IOException;
 
@@ -195,8 +195,8 @@ public abstract class Decoder implements
      * Returns all grid geometries (related to coordinate systems) found in the NetCDF file.
      * This method may return a direct reference to an internal array - do not modify.
      *
-     * @return All grid geometries, or an empty array if none.
-     * @throws IOException If an I/O operation was necessary but failed.
+     * @return all grid geometries, or an empty array if none.
+     * @throws IOException if an I/O operation was necessary but failed.
      */
     public abstract GridGeometry[] getGridGeometries() throws IOException;
 }

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/GridGeometry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/GridGeometry.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/GridGeometry.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/GridGeometry.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -36,7 +36,7 @@ public abstract class GridGeometry {
      * Returns the number of dimensions in the grid.
      * This is the number of dimensions of source coordinates in the <cite>"grid to CRS"</cite> transform.
      *
-     * @return Number of grid dimensions.
+     * @return number of grid dimensions.
      */
     public abstract int getSourceDimensions();
 
@@ -45,7 +45,7 @@ public abstract class GridGeometry {
      * This is the number of dimensions of target coordinates in the <cite>"grid to CRS"</cite> transform.
      * It should also be equal to the size of the list returned by {@link #getAxes()}.
      *
-     * @return Number of CRS dimensions.
+     * @return number of CRS dimensions.
      */
     public abstract int getTargetDimensions();
 
@@ -53,7 +53,7 @@ public abstract class GridGeometry {
      * Returns the axes of the coordinate reference system. The size of this list is expected equals to the
      * value returned by {@link #getTargetDimensions()}, however the caller should be robust to inconsistencies.
      *
-     * @return The CRS axes, in NetCDF order (reverse of "natural" order).
+     * @return the CRS axes, in NetCDF order (reverse of "natural" order).
      */
     public abstract Axis[] getAxes();
 
@@ -62,9 +62,9 @@ public abstract class GridGeometry {
      * This is a callback method for {@link #getAxes()}. In the NetCDF UCAR API, this method maps directly
      * to {@link ucar.nc2.dataset.CoordinateAxis2D#getCoordValue(int, int)}.
      *
-     * @param  j The fastest varying (right-most) index.
-     * @param  i The slowest varying (left-most) index.
-     * @return The coordinate at the given index, or {@link Double#NaN} if it can not be computed.
+     * @param  j  the fastest varying (right-most) index.
+     * @param  i  the slowest varying (left-most) index.
+     * @return the coordinate at the given index, or {@link Double#NaN} if it can not be computed.
      */
     protected abstract double coordinateForCurrentAxis(final int j, final int i);
 }

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Variable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Variable.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Variable.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Variable.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -57,28 +57,28 @@ public abstract class Variable {
     /**
      * Returns the name of this variable, or {@code null} if none.
      *
-     * @return The name of this variable, or {@code null}.
+     * @return the name of this variable, or {@code null}.
      */
     public abstract String getName();
 
     /**
      * Returns the description of this variable, or {@code null} if none.
      *
-     * @return The description of this variable, or {@code null}.
+     * @return the description of this variable, or {@code null}.
      */
     public abstract String getDescription();
 
     /**
      * Returns the unit of measurement as a string, or {@code null} if none.
      *
-     * @return The unit of measurement, or {@code null}.
+     * @return the unit of measurement, or {@code null}.
      */
     public abstract String getUnitsString();
 
     /**
      * Returns the variable data type, as a primitive type if possible.
      *
-     * @return The variable data type, or {@code null} if unknown.
+     * @return the variable data type, or {@code null} if unknown.
      */
     public abstract Class<?> getDataType();
 
@@ -87,7 +87,7 @@ public abstract class Variable {
      * followed by the span of each dimension (in unit of grid cells) between brackets.
      * Example: {@code "short[180][360]"}.
      *
-     * @return The name of the variable data type.
+     * @return the name of the variable data type.
      */
     public final String getDataTypeName() {
         final StringBuilder buffer = new StringBuilder(20);
@@ -107,7 +107,7 @@ public abstract class Variable {
      * This is the value to be returned by {@link java.awt.image.SampleModel#getDataType()} for the Java2D rasters
      * created from this variable data.
      *
-     * @return The Java2D data type, or {@link DataBuffer#TYPE_UNDEFINED} if this variable data type
+     * @return the Java2D data type, or {@link DataBuffer#TYPE_UNDEFINED} if this variable data type
      *         can not be mapped to a Java2D data type.
      */
     public final int getRasterDataType() {
@@ -148,7 +148,7 @@ public abstract class Variable {
      *       with images.</li>
      * </ul>
      *
-     * @param  minSpan Minimal span (in unit of grid cells) along the dimensions.
+     * @param  minSpan minimal span (in unit of grid cells) along the dimensions.
      * @return {@code true} if the variable can be considered a coverage.
      */
     public final boolean isCoverage(final int minSpan) {
@@ -176,7 +176,7 @@ public abstract class Variable {
      * Returns the names of the dimensions of this variable, in the order they are declared in the NetCDF file.
      * The dimensions are those of the grid, not the dimensions of the coordinate system.
      *
-     * @return The names of all dimension of the grid, in NetCDF order (reverse of "natural" order).
+     * @return the names of all dimension of the grid, in NetCDF order (reverse of "natural" order).
      */
     public abstract String[] getGridDimensionNames();
 
@@ -187,7 +187,7 @@ public abstract class Variable {
      * <p>In ISO 19123 terminology, this method returns the upper corner of the grid envelope plus one.
      * The lower corner is always (0,0,…,0).</p>
      *
-     * @return The number of grid cells for each dimension, in NetCDF order (reverse of "natural" order).
+     * @return the number of grid cells for each dimension, in NetCDF order (reverse of "natural" order).
      */
     public abstract int[] getGridEnvelope();
 
@@ -205,7 +205,7 @@ public abstract class Variable {
     /**
      * Reads all the data for this variable and returns them as an array of a Java primitive type.
      *
-     * @return The data as an array of a Java primitive type.
+     * @return the data as an array of a Java primitive type.
      * @throws IOException if an error occurred while reading the data.
      * @throws DataStoreException if a logical error occurred.
      */
@@ -221,10 +221,10 @@ public abstract class Variable {
      *       to {@code Integer.toUnsignedLong(getGridEnvelope()[i])} exclusive.</li>
      * </ul>
      *
-     * @param  areaLower   Index of the first value to read along each dimension.
-     * @param  areaUpper   Index after the last value to read along each dimension.
-     * @param  subsampling Sub-sampling along each dimension. 1 means no sub-sampling.
-     * @return The data as an array of a Java primitive type.
+     * @param  areaLower    index of the first value to read along each dimension.
+     * @param  areaUpper    index after the last value to read along each dimension.
+     * @param  subsampling  sub-sampling along each dimension. 1 means no sub-sampling.
+     * @return the data as an array of a Java primitive type.
      * @throws IOException if an error occurred while reading the data.
      * @throws DataStoreException if a logical error occurred.
      */
@@ -233,7 +233,7 @@ public abstract class Variable {
     /**
      * Returns a string representation of this variable for debugging purpose.
      *
-     * @return A string representation of this variable.
+     * @return a string representation of this variable.
      */
     @Debug
     @Override

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Attribute.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Attribute.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Attribute.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Attribute.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -19,7 +19,6 @@ package org.apache.sis.internal.netcdf.i
 import java.lang.reflect.Array;
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.Utilities;
-import org.apache.sis.util.CharSequences;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.Function;
@@ -31,7 +30,7 @@ import org.apache.sis.internal.jdk8.Func
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.8
  * @module
  */
 final class Attribute {
@@ -61,8 +60,8 @@ final class Attribute {
     /**
      * Creates a new attribute of the given name and value.
      *
-     * @param name  The attribute name (can not be null).
-     * @param value The value (trimmed if a {@code String}).
+     * @param  name   the attribute name (can not be null).
+     * @param  value  the value (trimmed if a {@code String}).
      */
     Attribute(final String name, final Object value) {
         this.name  = name;
@@ -108,99 +107,6 @@ final class Attribute {
     }
 
     /**
-     * Modifies, if needed, the given date in order to make it compliant with the ISO 8601 format.
-     * For example missing minutes or seconds fields are automatically added. The intend is to turn
-     * a NetCDF date into something parseable by {@code java.util.time} or {@code javax.xml.bind}.
-     *
-     * @param  date The date to parse, or {@code null}.
-     * @return The date modified if needed or {@code null} if the given string was {@code null}.
-     *
-     * @since 0.5 (derived from 0.3)
-     */
-    static String dateToISO(String date) {
-        date = CharSequences.trimWhitespaces(date);
-        if (date != null && !date.isEmpty()) {
-            /*
-             * Check for missing time fields and time zone. For example if the given date is
-             * "2005-09-22T00:00", then this block will complete it as "2005-09-22T00:00:00".
-             * In addition, a 'Z' suffix will be appended if 'defaultToUTC' is true.
-             */
-            int timeFieldStart  = date.lastIndexOf('T') + 1; // 0 if there is no time field.
-            int timeFieldEnd    = date.length();             // To be updated if there is a time field.
-            int missingFields   = 2;                         // Number of missing time fields.
-            boolean hasTimeZone = date.charAt(timeFieldEnd - 1) == 'Z';
-            if (timeFieldStart != 0) {
-                if (hasTimeZone) {
-                    timeFieldEnd--;
-                } else {
-                    final int s = Math.max(date.indexOf('+', timeFieldStart),
-                                           date.indexOf('-', timeFieldStart));
-                    if (hasTimeZone = (s >= 0)) {
-                        timeFieldEnd = s;
-                    }
-                }
-                for (int i=timeFieldStart; i<timeFieldEnd; i++) {
-                    if (date.charAt(i) == ':') {
-                        if (--missingFields == 0) break;
-                    }
-                }
-            }
-            /*
-             * If we have determined that there is some missing time fields,
-             * append default values for them.
-             */
-            CharSequence modified = date;
-            if (missingFields != 0 || !hasTimeZone) {
-                final StringBuilder buffer = new StringBuilder(date);
-                buffer.setLength(timeFieldEnd);
-                if (timeFieldStart == 0) {
-                    buffer.append("T00");
-                }
-                while (--missingFields >= 0) {
-                    buffer.append(":00");
-                }
-                if (hasTimeZone) {
-                    buffer.append(date, timeFieldEnd, date.length());
-                } else {
-                    buffer.append('Z');
-                }
-                modified = buffer;
-            }
-            /*
-             * Now ensure that all numbers have at least two digits.
-             */
-            int indexOfLastDigit = 0;
-            for (int i=modified.length(); --i >= 0;) {
-                char c = modified.charAt(i);
-                final boolean isDigit = (c >= '0' && c <= '9'); // Do not use Character.isDigit(char).
-                if (indexOfLastDigit == 0) {
-                    // We were not scaning a number. Check if we are now starting doing so.
-                    if (isDigit) {
-                        indexOfLastDigit = i;
-                    }
-                } else {
-                    // We were scaning a number. Check if we found the begining.
-                    if (!isDigit) {
-                        if (indexOfLastDigit - i == 1) {
-                            // Reuse the buffer if it exists, or create a new one otherwise.
-                            final StringBuilder buffer;
-                            if (modified == date) {
-                                modified = buffer = new StringBuilder(date);
-                            } else {
-                                buffer = (StringBuilder) modified;
-                            }
-                            buffer.insert(i+1, '0');
-                        }
-                        indexOfLastDigit = 0;
-                    }
-                }
-            }
-            date = modified.toString();
-        }
-        return date;
-    }
-
-    /**
      * A string representation of this dimension for debugging purpose only.
      */
     @Debug

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -38,6 +38,7 @@ import org.apache.sis.internal.netcdf.Va
 import org.apache.sis.internal.netcdf.GridGeometry;
 import org.apache.sis.internal.storage.ChannelDataInput;
 import org.apache.sis.internal.util.CollectionsExt;
+import org.apache.sis.internal.util.StandardDateFormat;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.util.iso.DefaultNameSpace;
@@ -51,6 +52,7 @@ import org.apache.sis.measure.Units;
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.JDK8;
 import org.apache.sis.internal.jdk8.Function;
+import org.apache.sis.internal.jdk8.DateTimeException;
 
 
 /**
@@ -106,7 +108,7 @@ public final class ChannelDecoder extend
      *
      * @see #numberToDate(String, Number[])
      */
-    private static final Pattern TIME_UNIT_PATTERN = Pattern.compile("(?i)\\bsince\\b");
+    private static final Pattern TIME_UNIT_PATTERN = Pattern.compile("\\s+since\\s+", Pattern.CASE_INSENSITIVE);
 
     /*
      * NOTE: the names of the static constants below this point match the names used in the Backus-Naur Form (BNF)
@@ -187,10 +189,10 @@ public final class ChannelDecoder extend
      * Creates a new decoder for the given file.
      * This constructor parses immediately the header.
      *
-     * @param  listeners Where to send the warnings.
-     * @param  input     The channel and the buffer from where data are read.
-     * @throws IOException If an error occurred while reading the channel.
-     * @throws DataStoreException If the content of the given channel is not a NetCDF file.
+     * @param  listeners  where to send the warnings.
+     * @param  input      the channel and the buffer from where data are read.
+     * @throws IOException if an error occurred while reading the channel.
+     * @throws DataStoreException if the content of the given channel is not a NetCDF file.
      */
     public ChannelDecoder(final WarningListeners<?> listeners, final ChannelDataInput input)
             throws IOException, DataStoreException
@@ -244,9 +246,9 @@ public final class ChannelDecoder extend
     /**
      * Return the localized name of the given tag.
      *
-     * @param  tag One of {@link #DIMENSION}, {@link #VARIABLE} or {@link #ATTRIBUTE} constants.
-     * @return The localized name of the given tag, or its hexadecimal number if the given value is not
-     *         one of the expected constants.
+     * @param  tag  one of {@link #DIMENSION}, {@link #VARIABLE} or {@link #ATTRIBUTE} constants.
+     * @return the localized name of the given tag, or its hexadecimal number if the given value
+     *         is not one of the expected constants.
      */
     private static String tagName(final int tag) {
         final short key;
@@ -262,7 +264,7 @@ public final class ChannelDecoder extend
     /**
      * Returns the localized error resource bundle for the locale given by {@link #getLocale()}.
      *
-     * @return The localized error resource bundle.
+     * @return the localized error resource bundle.
      */
     private Errors errors() {
         return Errors.getResources(listeners.getLocale());
@@ -295,10 +297,10 @@ public final class ChannelDecoder extend
      * <p>The NetCDF format add padding after bytes, characters and short integers in order to align
      * the data on multiple of 4 bytes. This method adds such padding to the number of bytes to read.</p>
      *
-     * @param  n        The number of elements to read.
-     * @param  dataSize The size of each element, in bytes.
-     * @param  name     The name of the element to read, used only in case of error for formatting the message.
-     * @return The number of bytes to read, rounded to the next multiple of 4.
+     * @param  n         the number of elements to read.
+     * @param  dataSize  the size of each element, in bytes.
+     * @param  name      the name of the element to read, used only in case of error for formatting the message.
+     * @return the number of bytes to read, rounded to the next multiple of 4.
      */
     private int ensureBufferContains(final int n, final int dataSize, String name) throws IOException, DataStoreException {
         // (n+3) & ~3  is a trick for rounding 'n' to the next multiple of 4.
@@ -344,7 +346,7 @@ public final class ChannelDecoder extend
      * <p>If the value is a {@code String}, then leading and trailing spaces and control characters have been trimmed
      * by {@link String#trim()}.</p>
      *
-     * @return The value, or {@code null} if it was an empty string or an empty array.
+     * @return the value, or {@code null} if it was an empty string or an empty array.
      */
     private Object readValues(final String name, final int type, final int length) throws IOException, DataStoreException {
         if (length == 0) {
@@ -406,8 +408,8 @@ public final class ChannelDecoder extend
      *   <li>The dimension length   (use {@link #readInt()})</li>
      * </ul>
      *
-     * @param nelems The number of dimensions to read.
-     * @return The dimensions in the order they are declared in the NetCDF file.
+     * @param  nelems  the number of dimensions to read.
+     * @return the dimensions in the order they are declared in the NetCDF file.
      */
     private Dimension[] readDimensions(final int nelems) throws IOException, DataStoreException {
         final Dimension[] dimensions = new Dimension[nelems];
@@ -439,7 +441,7 @@ public final class ChannelDecoder extend
      * If the value is a {@code String}, then leading and trailing spaces and control characters
      * have been trimmed by {@link String#trim()}.
      *
-     * @param nelems The number of attributes to read.
+     * @param  nelems  the number of attributes to read.
      */
     private Attribute[] readAttributes(final int nelems) throws IOException, DataStoreException {
         final Attribute[] attributes = new Attribute[nelems];
@@ -471,8 +473,8 @@ public final class ChannelDecoder extend
      *   <li>Offset where data begins   (use {@link #readOffset()})</li>
      * </ul>
      *
-     * @param nelems     The number of variables to read.
-     * @param dimensions The dimensions previously read by {@link #readDimensions(int)}.
+     * @param  nelems      the number of variables to read.
+     * @param  dimensions  the dimensions previously read by {@link #readDimensions(int)}.
      */
     private VariableInfo[] readVariables(final int nelems, final Dimension[] dimensions)
             throws IOException, DataStoreException
@@ -524,11 +526,11 @@ public final class ChannelDecoder extend
      * <p>Code searching in the returned map shall ask for the original (non lower-case) name
      * <strong>before</strong> to ask for the lower-cases version of that name.</p>
      *
-     * @param  <E>          The type of elements.
-     * @param  elements     The elements to store in the map, or {@code null} if none.
-     * @param  nameFunction The function for computing a name from an element.
-     * @return A (<cite>name</cite>, <cite>element</cite>) mapping with lower cases entries where possible.
-     * @throws DataStoreException If the same name is used for more than one element.
+     * @param  <E>           the type of elements.
+     * @param  elements      the elements to store in the map, or {@code null} if none.
+     * @param  nameFunction  the function for computing a name from an element.
+     * @return a (<cite>name</cite>, <cite>element</cite>) mapping with lower cases entries where possible.
+     * @throws DataStoreException if the same name is used for more than one element.
      *
      * @see #findAttribute(String)
      */
@@ -578,8 +580,8 @@ public final class ChannelDecoder extend
      * The {@code name} argument is typically (but is not restricted too) one of
      * the constants defined in the {@link AttributeNames} class.
      *
-     * @param  name The name of the attribute to search, or {@code null}.
-     * @return The attribute, or {@code null} if none.
+     * @param  name  the name of the attribute to search, or {@code null}.
+     * @return the attribute, or {@code null} if none.
      */
     private Attribute findAttribute(final String name) {
         Attribute attribute = attributeMap.get(name);
@@ -595,8 +597,8 @@ public final class ChannelDecoder extend
     /**
      * Returns the value for the attribute of the given name, or {@code null} if none.
      *
-     * @param  name The name of the attribute to search, or {@code null}.
-     * @return The attribute value, or {@code null} if none or empty or if the given name was null.
+     * @param  name  the name of the attribute to search, or {@code null}.
+     * @return the attribute value, or {@code null} if none or empty or if the given name was null.
      * @throws IOException {@inheritDoc}
      */
     @Override
@@ -638,8 +640,8 @@ public final class ChannelDecoder extend
     public Date dateValue(final String name) throws IOException {
         final Attribute attribute = findAttribute(name);
         if (attribute != null) {
-            if (attribute.value instanceof String) try {
-                return JDK8.parseDateTime(Attribute.dateToISO((String) attribute.value));
+            if (attribute.value instanceof CharSequence) try {
+                return JDK8.parseDateTime(StandardDateFormat.dateToISO((CharSequence) attribute.value, 0, false));
             } catch (IllegalArgumentException e) {
                 listeners.warning(null, e);
             }
@@ -651,8 +653,8 @@ public final class ChannelDecoder extend
      * Converts the given numerical values to date, using the information provided in the given unit symbol.
      * The unit symbol is typically a string like <cite>"days since 1970-01-01T00:00:00Z"</cite>.
      *
-     * @param  values The values to convert. May contains {@code null} elements.
-     * @return The converted values. May contains {@code null} elements.
+     * @param  values  the values to convert. May contain {@code null} elements.
+     * @return the converted values. May contain {@code null} elements.
      * @throws IOException {@inheritDoc}
      */
     @Override
@@ -661,14 +663,14 @@ public final class ChannelDecoder extend
         final String[] parts = TIME_UNIT_PATTERN.split(symbol);
         if (parts.length == 2) try {
             final UnitConverter converter = Units.valueOf(parts[0]).getConverterToAny(Units.MILLISECOND);
-            final long epoch = JDK8.parseDateTime(Attribute.dateToISO(parts[1])).getTime();
+            final long epoch = JDK8.parseDateTime(StandardDateFormat.dateToISO(parts[1], 0, false)).getTime();
             for (int i=0; i<values.length; i++) {
                 final Number value = values[i];
                 if (value != null) {
                     dates[i] = new Date(epoch + Math.round(converter.convert(value.doubleValue())));
                 }
             }
-        } catch (ConversionException | IllegalArgumentException e) {
+        } catch (ConversionException | DateTimeException | ArithmeticException e) {
             listeners.warning(null, e);
         }
         return dates;
@@ -753,7 +755,7 @@ nextVar:    for (final VariableInfo vari
     /**
      * Closes the channel.
      *
-     * @throws IOException If an error occurred while closing the channel.
+     * @throws IOException if an error occurred while closing the channel.
      */
     @Override
     public void close() throws IOException {

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Dimension.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Dimension.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Dimension.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Dimension.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -44,8 +44,8 @@ final class Dimension {
     /**
      * Creates a new dimension of the given name and length.
      *
-     * @param name   The dimension name.
-     * @param length The number of grid cell value along this dimension, as an unsigned number.
+     * @param name    the dimension name.
+     * @param length  the number of grid cell value along this dimension, as an unsigned number.
      */
     Dimension(final String name, final int length) {
         this.name   = name;

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfo.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfo.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfo.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfo.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -62,8 +62,8 @@ final class GridGeometryInfo extends Gri
     /**
      * Constructs a new grid geometry information.
      *
-     * @param domain Describes the input values of the "grid to CRS" conversion.
-     * @param range  The output values of the "grid to CRS" conversion.
+     * @param  domain  describes the input values of the "grid to CRS" conversion.
+     * @param  range   the output values of the "grid to CRS" conversion.
      */
     GridGeometryInfo(final Dimension[] domain, final VariableInfo[] range) {
         this.domain = domain;

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -138,14 +138,14 @@ final class VariableInfo extends Variabl
     /**
      * Creates a new variable.
      *
-     * @param input         The channel together with a buffer for reading the variable data.
-     * @param name          The variable name.
-     * @param dimensions    The dimensions of this variable.
-     * @param allDimensions All dimensions in the NetCDF files.
-     * @param attributes    The attributes associates to the variable, or an empty map if none.
-     * @param dataType      The type of data, as one of the {@code BYTE} and similar constants defined in this class.
-     * @param size          The variable size, used for verification purpose only.
-     * @param offset        The offset where the variable data begins in the NetCDF file.
+     * @param  input          the channel together with a buffer for reading the variable data.
+     * @param  name           the variable name.
+     * @param  dimensions     the dimensions of this variable.
+     * @param  allDimensions  all dimensions in the NetCDF files.
+     * @param  attributes     the attributes associates to the variable, or an empty map if none.
+     * @param  dataType       the type of data, as one of the {@code BYTE} and similar constants defined in this class.
+     * @param  size           the variable size, used for verification purpose only.
+     * @param  offset         the offset where the variable data begins in the NetCDF file.
      */
     VariableInfo(final ChannelDataInput input, final String name,
             final Dimension[] dimensions, final Dimension[] allDimensions,
@@ -279,7 +279,7 @@ final class VariableInfo extends Variabl
      * Returns the length (number of cells) of each grid dimension. In ISO 19123 terminology, this method
      * returns the upper corner of the grid envelope plus one. The lower corner is always (0,0,…,0).
      *
-     * @return The number of grid cells for each dimension, as unsigned integers.
+     * @return the number of grid cells for each dimension, as unsigned integers.
      */
     @Override
     public int[] getGridEnvelope() {
@@ -332,10 +332,10 @@ final class VariableInfo extends Variabl
     /**
      * Reads a sub-sampled sub-area of the variable.
      *
-     * @param  areaLower   Index of the first value to read along each dimension, as unsigned integers.
-     * @param  areaUpper   Index after the last value to read along each dimension, as unsigned integers.
-     * @param  subsampling Sub-sampling along each dimension. 1 means no sub-sampling.
-     * @return The data as an array of a Java primitive type.
+     * @param  areaLower    index of the first value to read along each dimension, as unsigned integers.
+     * @param  areaUpper    index after the last value to read along each dimension, as unsigned integers.
+     * @param  subsampling  sub-sampling along each dimension. 1 means no sub-sampling.
+     * @return the data as an array of a Java primitive type.
      */
     @Override
     public Object read(int[] areaLower, int[] areaUpper, int[] subsampling) throws IOException, DataStoreException {

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/package-info.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/package-info.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -30,7 +30,7 @@
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 package org.apache.sis.internal.netcdf.impl;

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/package-info.java?rev=1760780&r1=1760779&r2=1760780&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/package-info.java [UTF-8] Wed Sep 14 21:29:50 2016
@@ -35,11 +35,11 @@
  * ISO 19123 <cite>"grid envelope"</cite> and the ISO 19123 <cite>"range"</cite> is rather related
  * to the NetCDF variable minimum and maximum values. Trying to use OGC/ISO and NetCDF objects in
  * the same code appears to be <strong>very</strong> confusing. This isolation layer allows our code
- * use a more consistent vocabulary (compared to the rest of Apache SIS).</p>
+ * to use a more consistent vocabulary (compared to the rest of Apache SIS).</p>
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 package org.apache.sis.internal.netcdf;




Mime
View raw message