sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1799452 [4/7] - in /sis/branches/JDK7: ./ core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/test/java/org/apache/sis/feature/ core/sis-feature/sr...
Date Wed, 21 Jun 2017 14:11:41 GMT
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -313,8 +313,10 @@ public class DefaultNameFactory extends
             }
         }
         if (names.size() == 1) {
-            // Preserves the InternationalString (current implementation of
-            // the parsing code above has lost the internationalization).
+            /*
+             * Preserves the InternationalString (current implementation of
+             * the parsing code above has lost the internationalization).
+             */
             return createLocalName(scope, name);
         }
         return createGenericName(scope, names.toArray(new String[names.size()]));

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -155,23 +155,34 @@ public class DefaultNameSpace implements
      *          the separator to insert between the {@linkplain AbstractName#getParsedNames()
      *          parsed names} of any name in that namespace.
      */
-    protected DefaultNameSpace(final DefaultNameSpace parent, CharSequence name,
+    protected DefaultNameSpace(final DefaultNameSpace parent, final CharSequence name,
                                final String headSeparator, final String separator)
     {
         this.parent = (parent != GlobalNameSpace.GLOBAL) ? parent : null;
         ensureNonNull("name",          name);
         ensureNonNull("headSeparator", headSeparator);
         ensureNonNull("separator",     separator);
-        if (!(name instanceof InternationalString)) {
-            name = name.toString();
-        }
-        this.name          = name;
+        this.name          = simplify(name);
         this.headSeparator = headSeparator;
         this.separator     = separator;
         init();
     }
 
     /**
+     * Converts the given name to its {@link String} representation if that name is not an {@link InternationalString}
+     * instance from which this {@code DefaultNameSpace} implementation can extract useful information. For example if
+     * the given name is a {@link SimpleInternationalString}, that international string does not give more information
+     * than the {@code String} that it wraps. Using the {@code String} as the canonical value increase the chances that
+     * {@link #equals(Object)} detect that two {@code GenericName} instances are equal.
+     */
+    private static CharSequence simplify(CharSequence name) {
+        if (!(name instanceof InternationalString) || name.getClass() == SimpleInternationalString.class) {
+            name = name.toString();
+        }
+        return name;
+    }
+
+    /**
      * Initializes the transient fields.
      */
     private void init() {
@@ -386,6 +397,8 @@ public class DefaultNameSpace implements
         ensureNonNull("key", key);
         if (name == null) {
             name = key;
+        } else {
+            name = simplify(name);
         }
         final WeakValueHashMap<String,Object> childs = this.childs;     // Paranoiac protection against accidental changes.
         DefaultNameSpace child;
@@ -433,7 +446,7 @@ public class DefaultNameSpace implements
             final Object existing = childs.get(key);
             if (existing instanceof DefaultLocalName) {
                 child = (DefaultLocalName) existing;
-                if (name.equals(child.name)) {
+                if (simplify(name).equals(child.name)) {
                     assert (child.scope != null ? child.scope : GlobalNameSpace.GLOBAL) == this;
                     return child;
                 }

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.internal.util;
 
+import java.util.Date;
 import java.text.ParseException;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
@@ -96,4 +97,21 @@ public final strictfp class StandardDate
         assertEquals(date("2005-09-22 00:00:00"), f.parse("2005-9-22"));
         assertEquals(date("1992-01-01 00:00:00"), f.parse("1992-1-1"));
     }
+
+    /**
+     * Tests formatting and parsing a negative year.
+     * This test uses the Julian epoch (January 1st, 4713 BC at 12:00 UTC in proleptic Julian calendar;
+     * equivalent to November 24, 4714 BC when expressed in the proleptic Gregorian calendar instead).
+     * We use astronomical year numbering: 4714 BC is numbered -4713.
+     *
+     * @throws ParseException if an error occurred while parsing the date.
+     */
+    @Test
+    public void testNegativeYear() throws ParseException {
+        final Date julian = new Date(-210866760000000L);            // Same epoch than CommonCRS.Temporal.JULIAN.
+        final String expected = "-4713-11-24T12:00:00.000Z";        // Proleptic Gregorian calendar, astronomical year.
+        final StandardDateFormat f = new StandardDateFormat();
+        assertEquals(expected, f.format(julian));
+        assertEquals(julian, f.parse(expected));
+    }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/VectorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/VectorTest.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/VectorTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/VectorTest.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -44,7 +44,7 @@ public final strictfp class VectorTest e
     @Test
     public void testSequenceOfBytes() {
         vector = Vector.createSequence(100, 2, 10);
-        assertEquals(Long.class, vector.getElementType());
+        assertEquals(Integer.class, vector.getElementType());
         assertEquals(10, vector.size());
         for (int i=0; i<vector.size(); i++) {
             assertEquals(100 + 2*i, vector.byteValue(i));

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitFormatTest.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitFormatTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitFormatTest.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -292,8 +292,12 @@ public final strictfp class UnitFormatTe
         assertSame(Units.DEGREE,        f.parse("degrees_east"));
         assertSame(Units.DEGREE,        f.parse("degree_east"));
         assertSame(Units.DEGREE,        f.parse("Degree West"));
+        assertSame(Units.DEGREE,        f.parse("degrees N"));
+        assertSame(Units.DEGREE,        f.parse("degE"));
+        assertSame(Units.DEGREE,        f.parse("Deg_E"));
         assertSame(Units.KELVIN,        f.parse("degree Kelvin"));
         assertSame(Units.CELSIUS,       f.parse("degree Celsius"));
+        assertSame(Units.CELSIUS,       f.parse("degrees C"));
         assertSame(Units.KELVIN,        f.parse("degK"));
         assertSame(Units.CELSIUS,       f.parse("degC"));
         assertSame(Units.CELSIUS,       f.parse("deg C"));
@@ -411,10 +415,26 @@ public final strictfp class UnitFormatTe
         assertSame(Units.KILOMETRE,  f.parse( "1000.0*m"));
         ConventionalUnitTest.verify(Units.METRE, f.parse("10*-6⋅m"),   "µm", 1E-6);
         ConventionalUnitTest.verify(Units.METRE, f.parse("10*-6.m"),   "µm", 1E-6);
+        ConventionalUnitTest.verify(Units.METRE, f.parse("10^-3.m"),   "mm", 1E-3);
         ConventionalUnitTest.verify(Units.METRE, f.parse( "100 feet"), null, 30.48);
     }
 
     /**
+     * Tests parsing of symbols containing an explicit exponentiation operation.
+     * Usually the exponentiation is implicit, as in {@code "m*s-1"}.
+     * However some formats write it explicitely, as in {@code "m*s^-1"}.
+     */
+    @Test
+    @DependsOnMethod("testParseMultiplier")
+    public void testParseExponentiation() {
+        final UnitFormat f = new UnitFormat(Locale.UK);
+        assertSame(Units.HERTZ,             f.parse("s^-1"));
+        assertSame(Units.HERTZ,             f.parse("s**-1"));
+        assertSame(Units.METRES_PER_SECOND, f.parse("m*s^-1"));
+        assertSame(Units.METRES_PER_SECOND, f.parse("m*s**-1"));
+    }
+
+    /**
      * Tests parsing expressions containing parenthesis.
      */
     @Test

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -93,7 +93,8 @@ import org.junit.BeforeClass;
     org.apache.sis.util.iso.SimpleInternationalStringTest.class,
     org.apache.sis.util.iso.DefaultInternationalStringTest.class,
     org.apache.sis.internal.util.LocalizedParseExceptionTest.class,
-    org.apache.sis.util.iso.AbstractNameTest.class,
+    org.apache.sis.util.iso.DefaultLocalNameTest.class,
+    org.apache.sis.util.iso.DefaultScopedNameTest.class,
     org.apache.sis.util.iso.DefaultNameFactoryTest.class,
     org.apache.sis.util.iso.NamesTest.class,
     org.apache.sis.util.iso.TypeNamesTest.class,

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultNameFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultNameFactoryTest.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultNameFactoryTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultNameFactoryTest.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -16,12 +16,16 @@
  */
 package org.apache.sis.util.iso;
 
-import org.junit.runner.RunWith;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
+import org.opengis.util.GenericName;
 import org.opengis.test.util.NameTest;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestRunner;
+import org.junit.runner.RunWith;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
 
 
 /**
@@ -29,12 +33,12 @@ import org.apache.sis.test.TestRunner;
  * a {@link DefaultNameFactory} instance shared for all tests in this class.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 0.8
  * @since   0.3
  * @module
  */
 @RunWith(TestRunner.class)
-@DependsOn(AbstractNameTest.class)
+@DependsOn({DefaultLocalNameTest.class, DefaultScopedNameTest.class})
 public final strictfp class DefaultNameFactoryTest extends NameTest {
     /**
      * The factory to test.
@@ -63,4 +67,33 @@ public final strictfp class DefaultNameF
     public static void disposeFactory() {
         factorySIS = null;
     }
+
+    /**
+     * Tests navigation in a name parsed from a string.
+     */
+    @Test
+    public void testNavigation() {
+        final GenericName name = factory.parseGenericName(null, "codespace:subspace:name");
+        assertEquals("codespace:subspace:name", name.toString());
+        assertEquals("codespace:subspace",      name.tip().scope().name().toString());
+        assertEquals("codespace",               name.tip().scope().name().tip().scope().name().toString());
+        assertSame(name, name.toFullyQualifiedName());
+        assertSame(name, name.tip().toFullyQualifiedName());
+    }
+
+    /**
+     * Tests the creation of scoped names where different parts of the name are {@link SimpleInternationalString}
+     * instances. The implementation should be able to detect that the names and their hash codes are equal.
+     *
+     * @see DefaultScopedNameTest#testSimpleInternationalString()
+     */
+    @Test
+    public void testSimpleInternationalString() {
+        GenericName n1 = factory.createGenericName(null, "ns1", "Route");
+        GenericName n2 = factory.createGenericName(null, new SimpleInternationalString("ns1"), "Route");
+        GenericName n3 = factory.createGenericName(null, "ns1", new SimpleInternationalString("Route"));
+        assertSame(n1, n2);
+        assertSame(n1, n3);
+        assertSame(n2, n3);
+    }
 }

Modified: sis/branches/JDK7/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/pom.xml?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/pom.xml (original)
+++ sis/branches/JDK7/pom.xml Wed Jun 21 14:11:39 2017
@@ -425,7 +425,7 @@ Apache SIS is a free software, Java lang
       <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-compress</artifactId>
-        <version>1.13</version>
+        <version>1.14</version>
       </dependency>
 
       <!-- Databases -->
@@ -787,6 +787,7 @@ Apache SIS is a free software, Java lang
       <!-- JavaDoc configuration. -->
       <plugin>
         <artifactId>maven-javadoc-plugin</artifactId>
+        <version>2.10.4</version>
         <configuration>
           <source>${maven.compile.source}</source>              <!-- Enables javadoc to handle language constructs present in target JDK. -->
           <encoding>${project.build.sourceEncoding}</encoding>  <!-- Encoding of Java source file. -->
@@ -803,6 +804,7 @@ Apache SIS is a free software, Java lang
           <links>
             <link>http://unitsofmeasurement.github.io/unit-api/site/apidocs</link>
             <link>http://www.geoapi.org/snapshot/pending</link>
+            <link>http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/javadoc</link>
           </links>
 
           <additionalparam>

Modified: sis/branches/JDK7/src/main/javadoc/stylesheet.css
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/src/main/javadoc/stylesheet.css?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/src/main/javadoc/stylesheet.css (original)
+++ sis/branches/JDK7/src/main/javadoc/stylesheet.css Wed Jun 21 14:11:39 2017
@@ -212,6 +212,15 @@ div.block center {
 }
 
 /*
+ * Text similar to <pre> but without monospace font.
+ */
+div.preformat {
+  margin: 15px 30px;
+  line-height: 100%;
+  white-space: pre-wrap;
+}
+
+/*
  * Output of {@preformat} inline tag.
  */
 pre.code-sample {

Modified: sis/branches/JDK7/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -27,12 +27,10 @@ import java.util.regex.Pattern;
 import java.io.LineNumberReader;
 
 import org.opengis.metadata.Metadata;
-import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.DateType;
 import org.opengis.metadata.spatial.DimensionNameType;
 import org.opengis.metadata.content.CoverageContentType;
 import org.opengis.metadata.content.TransferFunctionType;
-import org.opengis.metadata.identification.Identification;
 import org.opengis.metadata.maintenance.ScopeCode;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.referencing.crs.ProjectedCRS;
@@ -68,7 +66,6 @@ import org.apache.sis.internal.util.Stan
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.util.Utilities;
 
-import static java.util.Collections.singleton;
 import static org.apache.sis.internal.util.CollectionsExt.singletonOrNull;
 
 // Branch-dependent imports
@@ -459,7 +456,7 @@ final class LandsatReader {
              * Example: "0501403126384_00011"
              */
             case "REQUEST_ID": {
-                metadata.addAcquisitionRequirement(value);
+                metadata.addAcquisitionRequirement(null, value);
                 break;
             }
             /*
@@ -468,7 +465,7 @@ final class LandsatReader {
              * Example: "LC81230522014071LGN00".
              */
             case "LANDSAT_SCENE_ID": {
-                metadata.addIdentifier(value);
+                metadata.addIdentifier(null, value, MetadataBuilder.Scope.ALL);
                 break;
             }
             /*
@@ -478,7 +475,8 @@ final class LandsatReader {
              * Example: "2014-03-12T06:06:35Z".
              */
             case "FILE_DATE": {
-                metadata.add(StandardDateFormat.toDate(OffsetDateTime.parse(value)), DateType.CREATION);
+                metadata.addCitationDate(StandardDateFormat.toDate(OffsetDateTime.parse(value)),
+                                         DateType.CREATION, MetadataBuilder.Scope.ALL);
                 break;
             }
             /*
@@ -527,7 +525,7 @@ final class LandsatReader {
              * Example: "LANDSAT_8".
              */
             case "SPACECRAFT_ID": {
-                metadata.addPlatform(value);
+                metadata.addPlatform(null, value);
                 break;
             }
             /*
@@ -535,7 +533,7 @@ final class LandsatReader {
              * Example: "OLI", "TIRS" or "OLI_TIRS".
              */
             case "SENSOR_ID": {
-                metadata.addInstrument(value);
+                metadata.addInstrument(null, value);
                 break;
             }
             /*
@@ -845,7 +843,7 @@ final class LandsatReader {
             final Date t = StandardDateFormat.toDate(st);
             metadata.addAcquisitionTime(t);
             try {
-                metadata.addExtent(t, t);
+                metadata.addTemporalExtent(t, t);
             } catch (UnsupportedOperationException e) {
                 // May happen if the temporal module (which is optional) is not on the classpath.
                 warning(null, null, e);
@@ -890,8 +888,8 @@ final class LandsatReader {
      * @throws FactoryException if an error occurred while creating the Coordinate Reference System.
      */
     final Metadata getMetadata() throws FactoryException {
-        metadata.add(Locale.ENGLISH, MetadataBuilder.Scope.METADATA);
-        metadata.add(ScopeCode.COVERAGE);
+        metadata.addLanguage(Locale.ENGLISH, MetadataBuilder.Scope.METADATA);
+        metadata.addResourceScope(ScopeCode.COVERAGE, null);
         try {
             flushSceneTime();
         } catch (DateTimeException e) {
@@ -905,7 +903,7 @@ final class LandsatReader {
          */
         if (datum != null) {
             if (utmZone > 0) {
-                metadata.add(datum.universal(1, TransverseMercator.Zoner.UTM.centralMeridian(utmZone)));
+                metadata.addReferenceSystem(datum.universal(1, TransverseMercator.Zoner.UTM.centralMeridian(utmZone)));
             }
             if (projection != null) {
                 final double sp = projection.parameter(Constants.STANDARD_PARALLEL_1).doubleValue();
@@ -921,7 +919,7 @@ final class LandsatReader {
                             Collections.singletonMap(ProjectedCRS.NAME_KEY, "Polar stereographic"),
                             datum.geographic(), projection, crs.getCoordinateSystem());
                 }
-                metadata.add(crs);
+                metadata.addReferenceSystem(crs);
             }
         }
         /*
@@ -934,11 +932,11 @@ final class LandsatReader {
             final int width  = gridSizes[i  ];
             final int height = gridSizes[i+1];
             if (width != 0 || height != 0) {
-                metadata.newGridRepresentation();
-                metadata.setAxisName((short) 0, DimensionNameType.SAMPLE);
-                metadata.setAxisName((short) 1, DimensionNameType.LINE);
-                metadata.setAxisLength((short) 0, width);
-                metadata.setAxisLength((short) 1, height);
+                metadata.newGridRepresentation(MetadataBuilder.GridType.GEORECTIFIED);
+                metadata.setAxisName(0, DimensionNameType.SAMPLE);
+                metadata.setAxisName(1, DimensionNameType.LINE);
+                metadata.setAxisLength(0, width);
+                metadata.setAxisLength(1, height);
             }
         }
         /*
@@ -949,18 +947,6 @@ final class LandsatReader {
         final DefaultMetadata result = metadata.build(false);
         if (result != null) {
             /*
-             * If there is exactly one data identification (which is usually the case, unless the user has invoked the
-             * read(BufferedReader) method many times), use the same identifier and date for the metadata as a whole.
-             */
-            final Identification id = singletonOrNull(result.getIdentificationInfo());
-            if (id != null) {
-                final Citation citation = id.getCitation();
-                if (citation != null) {
-                    result.setMetadataIdentifier(singletonOrNull(citation.getIdentifiers()));
-                    result.setDateInfo(singleton(singletonOrNull(citation.getDates())));
-                }
-            }
-            /*
              * Set information about all non-null bands. The bands are categorized in three groups:
              * PANCHROMATIC, REFLECTIVE and THERMAL. The group in which each band belong is encoded
              * in the BAND_GROUPS bitmask.

Modified: sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -753,6 +753,7 @@ final class CRSBuilder {
      * @throws NumberFormatException if a numeric value was stored as a string and can not be parsed.
      */
     final void complete(final MetadataBuilder metadata) {
+        metadata.newGridRepresentation(MetadataBuilder.GridType.GEORECTIFIED);
         /*
          * ASCII reference to published documentation on the overall configuration of the GeoTIFF file.
          * Often the projected CRS name, despite GeoKeys.PCSCitation being already for that purpose.

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=1799452&r1=1799451&r2=1799452&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 Jun 21 14:11:39 2017
@@ -112,8 +112,8 @@ public class GeoTiffStore extends DataSt
             } catch (MetadataStoreException e) {
                 warning(null, e);
             }
-            builder.add(encoding, MetadataBuilder.Scope.METADATA);
-            builder.add(ScopeCode.COVERAGE);
+            builder.addEncoding(encoding, MetadataBuilder.Scope.METADATA);
+            builder.addResourceScope(ScopeCode.COVERAGE, null);
             final Locale locale = getLocale();
             int n = 0;
             try {

Modified: sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -695,7 +695,8 @@ final class ImageFileDirectory {
              */
             case Tags.DateTime: {
                 for (final String value : type.readString(input(), count, encoding())) {
-                    reader.metadata.add(reader.getDateFormat().parse(value), DateType.CREATION);
+                    reader.metadata.addCitationDate(reader.getDateFormat().parse(value),
+                            DateType.CREATION, MetadataBuilder.Scope.RESOURCE);
                 }
                 break;
             }
@@ -732,7 +733,7 @@ final class ImageFileDirectory {
              */
             case Tags.Model: {
                 for (final String value : type.readString(input(), count, encoding())) {
-                    reader.metadata.addInstrument(value);
+                    reader.metadata.addInstrument(null, value);
                 }
                 break;
             }
@@ -879,6 +880,9 @@ final class ImageFileDirectory {
      *   <li>Otherwise throws an exception.</li>
      * </ul>
      *
+     * This method opportunistically computes default value of optional fields
+     * when those values can be computed from other (usually mandatory) fields.
+     *
      * @throws DataStoreContentException if a mandatory tag is missing and can not be inferred.
      */
     final void validateMandatoryTags() throws DataStoreContentException {
@@ -917,6 +921,8 @@ final class ImageFileDirectory {
         if (colorMap != null) {
             ensureSameLength(Tags.ColorMap, Tags.BitsPerSample, colorMap.size(),  3 * (1 << bitsPerSample));
         }
+        if (Double.isNaN(minValue)) minValue = 0;
+        if (Double.isNaN(maxValue)) maxValue = (1 << bitsPerSample) - 1;
         /*
          * All of tile width, height and length information should be provided. But if only one of them is missing,
          * we can compute it provided that the file does not use any compression method. If there is a compression,
@@ -996,6 +1002,8 @@ final class ImageFileDirectory {
         if (compression != null) {
             metadata.addCompression(compression.name().toLowerCase(locale));
         }
+        // TODO: set band name and repeat for each band.
+        metadata.setBitPerSample(bitsPerSample);
         metadata.addMinimumSampleValue(minValue);
         metadata.addMaximumSampleValue(maxValue);
         /*
@@ -1038,7 +1046,7 @@ final class ImageFileDirectory {
         if (geoKeyDirectory != null) {
             final CRSBuilder helper = new CRSBuilder(reader);
             try {
-                metadata.add(helper.build(geoKeyDirectory, numericGeoParameters, asciiGeoParameters));
+                metadata.addReferenceSystem(helper.build(geoKeyDirectory, numericGeoParameters, asciiGeoParameters));
                 helper.complete(metadata);
             } catch (NoSuchIdentifierException | ParameterNotFoundException e) {
                 short key = Resources.Keys.UnsupportedProjectionMethod_1;

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=1799452&r1=1799451&r2=1799452&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 Jun 21 14:11:39 2017
@@ -16,8 +16,10 @@
  */
 package org.apache.sis.internal.netcdf;
 
+import java.io.IOException;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.storage.netcdf.AttributeNames;
+import org.apache.sis.storage.DataStoreException;
 
 
 /**
@@ -27,7 +29,7 @@ import org.apache.sis.storage.netcdf.Att
  * {@link ucar.nc2.dataset.CoordinateAxis1D} or {@link ucar.nc2.dataset.CoordinateAxis2D} respectively.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 0.8
  *
  * @see GridGeometry#getAxes()
  *
@@ -41,14 +43,13 @@ public final class Axis {
     public final AttributeNames.Dimension attributeNames;
 
     /**
-     * The indices of the grid dimension associated to this axis. Values in this array are sorted with more
-     * "significant" (defined below) dimensions first - this is not necessarily increasing order.
-     *
-     * <div class="section">Elements order</div>
-     * The length of this array is often 1. But if more than one grid dimension is associated to this axis
-     * (i.e. if the wrapped NetCDF axis is an instance of {@link ucar.nc2.dataset.CoordinateAxis2D}), then
-     * the first index is what seems the most significant grid dimension (i.e. the dimension which seems
-     * to be varying fastest along this axis).
+     * The indices of the grid dimension associated to this axis. The length of this array is often 1.
+     * But if more than one grid dimension is associated to this axis (i.e. if the wrapped NetCDF axis
+     * is an instance of {@link ucar.nc2.dataset.CoordinateAxis2D}),  then the first value is the grid
+     * dimension which seems most closely oriented toward this axis direction. We do that for allowing
+     * {@code MetadataReader.addSpatialRepresentationInfo(…)} method to get the most appropriate value
+     * for ISO 19115 {@code metadata/spatialRepresentationInfo/axisDimensionProperties/dimensionSize}
+     * metadata property.
      */
     public final int[] sourceDimensions;
 
@@ -61,16 +62,20 @@ public final class Axis {
 
     /**
      * Constructs a new axis associated to an arbitrary number of grid dimension.
-     * In the particular case where the number of dimensions is equals to 2, this
-     * constructor will detects by itself which grid dimension varies fastest.
+     * In the particular case where the number of dimensions is equals to 2, this constructor will detect
+     * by itself which grid dimension varies fastest and reorder in-place the elements in the given arrays
+     * (those array are modified, not cloned).
      *
-     * @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  axis              an implementation-dependent object representing the two-dimensional axis, or {@code null} if none.
+     * @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.
+     * @throws IOException if an I/O operation was necessary but failed.
+     * @throws DataStoreException if a logical error occurred.
      */
-    public Axis(final GridGeometry owner, final AttributeNames.Dimension attributeNames,
-            final int[] sourceDimensions, final int[] sourceSizes)
+    public Axis(final GridGeometry owner, final Object axis, final AttributeNames.Dimension attributeNames,
+            final int[] sourceDimensions, final int[] sourceSizes) throws IOException, DataStoreException
     {
         this.attributeNames   = attributeNames;
         this.sourceDimensions = sourceDimensions;
@@ -80,9 +85,11 @@ public final class Axis {
             final int up1  = sourceSizes[1];
             final int mid0 = up0 / 2;
             final int mid1 = up1 / 2;
-            final double d1 = (owner.coordinateForCurrentAxis(0, mid1) - owner.coordinateForCurrentAxis(up0-1, mid1)) / up0;
-            final double d2 = (owner.coordinateForCurrentAxis(mid0, 0) - owner.coordinateForCurrentAxis(mid0, up1-1)) / up1;
-            if (Math.abs(d2) > Math.abs(d1)) {
+            final double inc0 = (owner.coordinateForAxis(axis,     0, mid1) -
+                                 owner.coordinateForAxis(axis, up0-1, mid1)) / up0;
+            final double inc1 = (owner.coordinateForAxis(axis, mid0,     0) -
+                                 owner.coordinateForAxis(axis, mid0, up1-1)) / up1;
+            if (Math.abs(inc1) > Math.abs(inc0)) {
                 sourceSizes[0] = up1;
                 sourceSizes[1] = up0;
                 ArraysExt.swap(sourceDimensions, 0, 1);

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=1799452&r1=1799451&r2=1799452&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 Jun 21 14:11:39 2017
@@ -217,6 +217,7 @@ public abstract class Decoder implements
      *
      * @return all grid geometries, or an empty array if none.
      * @throws IOException if an I/O operation was necessary but failed.
+     * @throws DataStoreException if a logical error occurred.
      */
-    public abstract GridGeometry[] getGridGeometries() throws IOException;
+    public abstract GridGeometry[] getGridGeometries() throws IOException, DataStoreException;
 }

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=1799452&r1=1799451&r2=1799452&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 Jun 21 14:11:39 2017
@@ -16,12 +16,15 @@
  */
 package org.apache.sis.internal.netcdf;
 
+import java.io.IOException;
+import org.apache.sis.storage.DataStoreException;
+
 
 /**
  * Information about the grid geometry and the conversion from grid coordinates to geodetic coordinates.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 0.8
  * @since   0.3
  * @module
  */
@@ -33,38 +36,47 @@ 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.
+     * Returns the number of dimensions of source coordinates in the <cite>"grid to CRS"</cite> conversion.
+     * This is the number of dimensions of the <em>grid</em>.
      *
      * @return number of grid dimensions.
      */
     public abstract int getSourceDimensions();
 
     /**
-     * Returns the number of dimensions in the coordinate reference system.
-     * 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()}.
+     * Returns the number of dimensions of target coordinates in the <cite>"grid to CRS"</cite> conversion.
+     * This is the number of dimensions of the <em>coordinate reference system</em>.
+     * It should be equal to the size of the array returned by {@link #getAxes()},
+     * but caller should be robust to inconsistencies.
      *
      * @return number of CRS dimensions.
      */
     public abstract int getTargetDimensions();
 
     /**
-     * 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.
+     * Returns the axes of the coordinate reference system. The size of this array is expected equals to the
+     * value returned by {@link #getTargetDimensions()}, but the caller should be robust to inconsistencies.
+     *
+     * <p>This method is used mostly for producing ISO 19115 metadata. It is typically invoked only once.</p>
      *
      * @return the CRS axes, in NetCDF order (reverse of "natural" order).
+     * @throws IOException if an I/O operation was necessary but failed.
+     * @throws DataStoreException if a logical error occurred.
      */
-    public abstract Axis[] getAxes();
+    public abstract Axis[] getAxes() throws IOException, DataStoreException;
 
     /**
-     * Returns the coordinate for the given grid coordinate of an axis in the process of being constructed.
-     * 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)}.
+     * Returns a coordinate for the given two-dimensional grid coordinate axis. This is (indirectly) a callback
+     * method for {@link #getAxes()}. The (<var>i</var>, <var>j</var>) indices are grid indices <em>before</em>
+     * they get reordered by the {@link Axis} constructor. 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.
+     * @param  axis  an implementation-dependent object representing the two-dimensional axis, or {@code null} if none.
+     * @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.
+     * @throws IOException if an I/O operation was necessary but failed.
+     * @throws DataStoreException if a logical error occurred.
      */
-    protected abstract double coordinateForCurrentAxis(final int j, final int i);
+    protected abstract double coordinateForAxis(Object axis, int j, int i) throws IOException, DataStoreException;
 }

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=1799452&r1=1799451&r2=1799452&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 Jun 21 14:11:39 2017
@@ -166,6 +166,28 @@ public abstract class Variable extends N
 
     /**
      * Reads all the data for this variable and returns them as an array of a Java primitive type.
+     * Multi-dimensional variables are flattened as a one-dimensional array (wrapped in a vector).
+     * Example:
+     *
+     * {@preformat text
+     *   DIMENSIONS:
+     *     time: 3
+     *     lat : 2
+     *     lon : 4
+     *
+     *   VARIABLES:
+     *     temperature (time,lat,lon)
+     *
+     *   DATA INDICES:
+     *     (0,0,0) (0,0,1) (0,0,2) (0,0,3)
+     *     (0,1,0) (0,1,1) (0,1,2) (0,1,3)
+     *     (1,0,0) (1,0,1) (1,0,2) (1,0,3)
+     *     (1,1,0) (1,1,1) (1,1,2) (1,1,3)
+     *     (2,0,0) (2,0,1) (2,0,2) (2,0,3)
+     *     (2,1,0) (2,1,1) (2,1,2) (2,1,3)
+     * }
+     *
+     * This method may cache the returned vector, at implementation choice.
      *
      * @return the data as an array of a Java primitive type.
      * @throws IOException if an error occurred while reading the data.
@@ -183,6 +205,9 @@ public abstract class Variable extends N
      *       to {@code Integer.toUnsignedLong(getGridEnvelope()[i])} exclusive.</li>
      * </ul>
      *
+     * If the variable has more than one dimension, then the data are packed in a one-dimensional vector
+     * in the same way than {@link #read()}.
+     *
      * @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.

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=1799452&r1=1799451&r2=1799452&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 Jun 21 14:11:39 2017
@@ -774,7 +774,8 @@ public final class ChannelDecoder extend
             /*
              * First, find all variables which are used as coordinate system axis. The keys in the map are
              * the grid dimensions which are the domain of the variable (i.e. the sources of the conversion
-             * from grid coordinates to CRS coordinates).
+             * from grid coordinates to CRS coordinates). For each key there is usually only one value, but
+             * we try to make this code robust to unusual NetCDF files.
              */
             final Map<Dimension, List<VariableInfo>> dimToAxes = new IdentityHashMap<>();
             for (final VariableInfo variable : variables) {
@@ -805,7 +806,7 @@ nextVar:    for (final VariableInfo vari
                      * This is a "all or nothing" operation.
                      */
                     for (final Dimension dimension : variable.dimensions) {
-                        final List<VariableInfo> axis = dimToAxes.get(dimension);
+                        final List<VariableInfo> axis = dimToAxes.get(dimension);       // Should have only 1 element.
                         if (axis == null) {
                             axes.clear();
                             continue nextVar;

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -148,7 +148,7 @@ search: for (final VariableInfo counts :
                         }
                     }
                     /*
-                     * At this point, all information has been verified as valid.
+                     * At this point, all information have been verified as valid.
                      */
                     features.add(new FeaturesInfo(counts.read().compress(0), identifiers));
                 }

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=1799452&r1=1799451&r2=1799452&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 Jun 21 14:11:39 2017
@@ -16,10 +16,15 @@
  */
 package org.apache.sis.internal.netcdf.impl;
 
+import java.io.IOException;
+import java.util.TreeMap;
+import java.util.SortedMap;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.internal.netcdf.Axis;
 import org.apache.sis.internal.netcdf.GridGeometry;
 import org.apache.sis.storage.netcdf.AttributeNames;
+import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.util.resources.Errors;
 
 
 /**
@@ -29,7 +34,7 @@ import org.apache.sis.storage.netcdf.Att
  * (domain) and output (range) of the function that convert grid indices to geodetic coordinates.</p>
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 0.8
  * @since   0.3
  * @module
  */
@@ -82,6 +87,8 @@ final class GridGeometryInfo extends Gri
     /**
      * Returns the number of dimensions of target coordinates in the <cite>"grid to CRS"</cite> conversion.
      * This is the number of dimensions of the <em>coordinate reference system</em>.
+     * It should be equal to the size of the array returned by {@link #getAxes()},
+     * but caller should be robust to inconsistencies.
      */
     @Override
     public int getTargetDimensions() {
@@ -90,16 +97,46 @@ final class GridGeometryInfo extends Gri
 
     /**
      * Returns all axes of the NetCDF coordinate system, together with the grid dimension to which the axis
-     * is associated. See {@code org.apache.sis.internal.netcdf.ucar.GridGeometryWrapper.getAxes()} for more
-     * information on the algorithm applied here, and relationship with the UCAR library.
+     * is associated. See {@code org.apache.sis.internal.netcdf.ucar.GridGeometryWrapper.getAxes()} for a
+     * closer look on the relationship between this algorithm and the UCAR library.
+     *
+     * <p>In this method, the words "domain" and "range" are used in the NetCDF sense: they are the input
+     * (domain) and output (range) of the function that convert grid indices to geodetic coordinates.</p>
+     *
+     * <p>The domain of all axes is often the same than the domain of the variable, but not necessarily.
+     * In particular, the relationship is not straightforward when the coordinate system contains
+     * "two-dimensional axes" (in {@link ucar.nc2.dataset.CoordinateAxis2D} sense).</p>
+     *
+     * @return the CRS axes, in NetCDF order (reverse of "natural" order).
+     * @throws IOException if an I/O operation was necessary but failed.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Override
-    public Axis[] getAxes() {
-        int targetDim = range.length;
-        final Axis[] axes = new Axis[targetDim];
-        while (--targetDim >= 0) {
-            final VariableInfo axis = range[targetDim];
-            final Dimension[] axisDomain = axis.dimensions;
+    public Axis[] getAxes() throws IOException, DataStoreException {
+        /*
+         * Process the variables in the order the appear in the sequence of bytes that make the NetCDF files.
+         * This is often the same order than the indices, but not necessarily. The intend is to reduce the
+         * amount of disk seek operations.
+         */
+        final SortedMap<VariableInfo,Integer> variables = new TreeMap<>();
+        for (int i=0; i<range.length; i++) {
+            final VariableInfo v = range[i];
+            if (variables.put(v, i) != null) {
+                throw new DataStoreException(Errors.format(Errors.Keys.DuplicatedElement_1, v.getName()));
+            }
+        }
+        /*
+         * In this method, 'sourceDim' and 'targetDim' are relative to "grid to CRS" conversion.
+         * So 'sourceDim' is the grid (domain) dimension and 'targetDim' is the CRS (range) dimension.
+         */
+        final Axis[] axes = new Axis[range.length];
+        for (final SortedMap.Entry<VariableInfo,Integer> entry : variables.entrySet()) {
+            final int targetDim = entry.getValue();
+            final VariableInfo axis = entry.getKey();
+            /*
+             * The AttributeNames are for ISO 19115 metadata. They are not used for locating grid cells
+             * on Earth, but we nevertheless get them now for making MetadataReader work easier.
+             */
             AttributeNames.Dimension attributeNames = null;
             final String type = axis.getAxisType();
             if (type != null) {
@@ -110,11 +147,17 @@ final class GridGeometryInfo extends Gri
                     }
                 }
             }
+            /*
+             * Get the grid dimensions (part of the "domain" in UCAR terminology) used for computing
+             * the ordinate values along the current axis. There is exactly 1 such grid dimension in
+             * straightforward NetCDF files. However some more complex files may have 2 dimensions.
+             */
             int i = 0;
+            final Dimension[] axisDomain = axis.dimensions;
             final int[] indices = new int[axisDomain.length];
             final int[] sizes   = new int[axisDomain.length];
             for (final Dimension dimension : axisDomain) {
-                for (int sourceDim=domain.length; --sourceDim>=0;) {
+                for (int sourceDim = domain.length; --sourceDim >= 0;) {
                     if (domain[sourceDim] == dimension) {
                         indices[i] = sourceDim;
                         sizes[i++] = dimension.length;
@@ -122,15 +165,21 @@ final class GridGeometryInfo extends Gri
                     }
                 }
             }
-            axes[targetDim] = new Axis(this, attributeNames,
-                    ArraysExt.resize(indices, i),
-                    ArraysExt.resize(sizes, i));
+            axes[targetDim] = new Axis(this, axis, attributeNames,
+                                       ArraysExt.resize(indices, i),
+                                       ArraysExt.resize(sizes, i));
         }
         return axes;
     }
 
+    /**
+     * Returns a coordinate for the given two-dimensional grid coordinate axis.
+     * This is (indirectly) a callback method for {@link #getAxes()}.
+     */
     @Override
-    protected double coordinateForCurrentAxis(final int j, final int i) {
-        throw new UnsupportedOperationException();
+    protected double coordinateForAxis(final Object axis, final int j, final int i) throws IOException, DataStoreException {
+        final VariableInfo v = ((VariableInfo) axis);
+        final int n = v.getGridEnvelope()[0];
+        return v.read().doubleValue(j + n*i);
     }
 }

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=1799452&r1=1799451&r2=1799452&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 Jun 21 14:11:39 2017
@@ -37,6 +37,8 @@ import org.apache.sis.math.Vector;
 
 /**
  * Description of a variable found in a NetCDF file.
+ * The natural ordering of {@code VariableInfo} is the order in which the variables appear in the stream of bytes
+ * that make the NetCDF file. Reading variables in natural order reduces the amount of channel seek operations.
  *
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
@@ -44,7 +46,7 @@ import org.apache.sis.math.Vector;
  * @since   0.3
  * @module
  */
-final class VariableInfo extends Variable {
+final class VariableInfo extends Variable implements Comparable<VariableInfo> {
     /**
      * The array to be returned by {@link #numberValues(Object)} when the given value is null.
      */
@@ -119,6 +121,13 @@ final class VariableInfo extends Variabl
     private final boolean isCoordinateSystemAxis;
 
     /**
+     * The values of the whole variable, or {@code null} if not yet read. This vector should be assigned only
+     * for relatively small variables, or for variables that are critical to the use of other variables
+     * (for example the values in coordinate system axes).
+     */
+    private transient Vector values;
+
+    /**
      * Creates a new variable.
      *
      * @param  input       the channel together with a buffer for reading the variable data.
@@ -353,31 +362,39 @@ final class VariableInfo extends Variabl
 
     /**
      * Reads all the data for this variable and returns them as an array of a Java primitive type.
+     * Multi-dimensional variables are flattened as a one-dimensional array (wrapped in a vector).
+     * The vector is cached and returned as-is in all future invocation of this method.
      */
     @Override
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
     public Vector read() throws IOException, DataStoreException {
-        if (reader == null) {
-            throw new DataStoreContentException(unknownType());
-        }
-        long length = 1;
-        for (final Dimension dimension : dimensions) {
-            length *= dimension.length;
-        }
-        if (length > Integer.MAX_VALUE) {
-            throw new DataStoreContentException(Errors.format(Errors.Keys.ExcessiveListSize_2, name, length));
-        }
-        final int dimension = dimensions.length;
-        final long[] size  = new long[dimension];
-        final int [] sub   = new int [dimension];
-        for (int i=0; i<dimension; i++) {
-            sub [i] = 1;
-            size[i] = dimensions[(dimension - 1) - i].length();
+        if (values == null) {
+            if (reader == null) {
+                throw new DataStoreContentException(unknownType());
+            }
+            long length = 1;
+            for (final Dimension dimension : dimensions) {
+                length *= dimension.length();
+            }
+            if (length > Integer.MAX_VALUE) {
+                throw new DataStoreContentException(Errors.format(Errors.Keys.ExcessiveListSize_2, name, length));
+            }
+            final int dimension = dimensions.length;
+            final long[] size  = new long[dimension];
+            final int [] sub   = new int [dimension];
+            for (int i=0; i<dimension; i++) {
+                sub [i] = 1;
+                size[i] = dimensions[(dimension - 1) - i].length();
+            }
+            values = Vector.create(reader.read(new Region(size, new long[dimension], size, sub)), dataType.isUnsigned)
+                    .compress(0);
         }
-        return Vector.create(reader.read(new Region(size, new long[dimension], size, sub)), dataType.isUnsigned);
+        return values;
     }
 
     /**
      * Reads a sub-sampled sub-area of the variable.
+     * Multi-dimensional variables are flattened as a one-dimensional array (wrapped in a vector).
      *
      * @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.
@@ -429,4 +446,15 @@ final class VariableInfo extends Variabl
     private String unknownType() {
         return Errors.format(Errors.Keys.UnknownType_1, "NetCDF:" + dataType);
     }
+
+    /**
+     * Returns -1 if this variable is located before the other variable in the streal of bytes that make
+     * the NetCDF file, or +1 if it is located after.
+     */
+    @Override
+    public int compareTo(final VariableInfo other) {
+        int c = Long.compare(reader.origin, other.reader.origin);
+        if (c == 0) c = name.compareTo(other.name);                 // Should not happen, but we are paranoiac.
+        return c;
+    }
 }

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/GridGeometryWrapper.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/GridGeometryWrapper.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/GridGeometryWrapper.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/GridGeometryWrapper.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.internal.netcdf.ucar;
 
+import java.io.IOException;
 import java.util.List;
 import ucar.nc2.Dimension;
 import ucar.nc2.constants.AxisType;
@@ -25,6 +26,7 @@ import ucar.nc2.dataset.CoordinateSystem
 import org.apache.sis.internal.netcdf.Axis;
 import org.apache.sis.internal.netcdf.GridGeometry;
 import org.apache.sis.storage.netcdf.AttributeNames;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.util.ArraysExt;
 
 
@@ -35,7 +37,7 @@ import org.apache.sis.util.ArraysExt;
  * of the grid geometry information.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 0.8
  * @since   0.3
  * @module
  */
@@ -46,11 +48,6 @@ final class GridGeometryWrapper extends
     private final CoordinateSystem netcdfCS;
 
     /**
-     * A temporary variable for {@link #coordinateForCurrentAxis(int, int)}.
-     */
-    private transient CoordinateAxis2D axis2D;
-
-    /**
      * Creates a new grid geometry for the given NetCDF coordinate system.
      *
      * @param  cs  the NetCDF coordinate system, or {@code null} if none.
@@ -60,7 +57,8 @@ final class GridGeometryWrapper extends
     }
 
     /**
-     * Returns the number of dimensions in the grid.
+     * Returns the number of dimensions of source coordinates in the <cite>"grid to CRS"</cite> conversion.
+     * This is the number of dimensions of the <em>grid</em>.
      */
     @Override
     public int getSourceDimensions() {
@@ -68,7 +66,10 @@ final class GridGeometryWrapper extends
     }
 
     /**
-     * Returns the number of dimensions in the coordinate reference system.
+     * Returns the number of dimensions of target coordinates in the <cite>"grid to CRS"</cite> conversion.
+     * This is the number of dimensions of the <em>coordinate reference system</em>.
+     * It should be equal to the size of the array returned by {@link #getAxes()},
+     * but caller should be robust to inconsistencies.
      */
     @Override
     public int getTargetDimensions() {
@@ -86,20 +87,27 @@ final class GridGeometryWrapper extends
      * is often the same than the domain of the variable, but not necessarily.
      * In particular, the relationship is not straightforward when the coordinate system contains instances
      * of {@link CoordinateAxis2D}.</p>
+     *
+     * @return the CRS axes, in NetCDF order (reverse of "natural" order).
+     * @throws IOException if an I/O operation was necessary but failed.
+     * @throws DataStoreException if a logical error occurred.
      */
     @Override
-    public Axis[] getAxes() {
+    public Axis[] getAxes() throws IOException, DataStoreException {
         final List<Dimension> domain = netcdfCS.getDomain();
         final List<CoordinateAxis> range = netcdfCS.getCoordinateAxes();
-        int targetDim = range.size();
-        final Axis[] axes = new Axis[targetDim];
         /*
-         * NetCDF files declare axes in reverse order, so we iterate in the 'netcdfAxes'
-         * list in reverse order for adding to the 'axes' list in "natural" order.
+         * In this method, 'sourceDim' and 'targetDim' are relative to "grid to CRS" conversion.
+         * So 'sourceDim' is the grid (domain) dimension and 'targetDim' is the CRS (range) dimension.
          */
+        int targetDim = range.size();
+        final Axis[] axes = new Axis[targetDim];
         while (--targetDim >= 0) {
-            final CoordinateAxis  axis = range.get(targetDim);
-            final List<Dimension> axisDomain = axis.getDimensions();
+            final CoordinateAxis axis = range.get(targetDim);
+            /*
+             * The AttributeNames are for ISO 19115 metadata. They are not used for locating grid cells
+             * on Earth, but we nevertheless get them now for making MetadataReader work easier.
+             */
             AttributeNames.Dimension attributeNames = null;
             final AxisType type = axis.getAxisType();
             if (type != null) switch (type) {
@@ -116,6 +124,7 @@ final class GridGeometryWrapper extends
              * straightforward NetCDF files. However some more complex files may have 2 dimensions.
              */
             int i = 0;
+            final List<Dimension> axisDomain = axis.getDimensions();
             final int[] indices = new int[axisDomain.size()];
             final int[] sizes   = new int[indices.length];
             for (final Dimension dimension : axisDomain) {
@@ -127,24 +136,22 @@ final class GridGeometryWrapper extends
                 /*
                  * If the axis dimension has not been found in the coordinate system (sourceDim < 0),
                  * then there is maybe a problem with the NetCDF file. However for the purpose of this
-                 * package, we can proceed as if the dimension does not exist.
+                 * package, we can proceed as if the dimension does not exist ('i' not incremented).
                  */
             }
-            axis2D = (axis instanceof CoordinateAxis2D) ? (CoordinateAxis2D) axis : null;
-            axes[targetDim] = new Axis(this, attributeNames,
-                    ArraysExt.resize(indices, i),
-                    ArraysExt.resize(sizes, i));
+            axes[targetDim] = new Axis(this, axis, attributeNames,
+                                       ArraysExt.resize(indices, i),
+                                       ArraysExt.resize(sizes, i));
         }
-        axis2D = null;
         return axes;
     }
 
     /**
-     * Returns the coordinate for the given grid coordinate of an axis in the process of being constructed.
-     * This is a callback method for {@link #getAxes()}.
+     * Returns a coordinate for the given two-dimensional grid coordinate axis.
+     * This is (indirectly) a callback method for {@link #getAxes()}.
      */
     @Override
-    protected double coordinateForCurrentAxis(final int j, final int i) {
-        return (axis2D != null) ? axis2D.getCoordValue(j, i) : Double.NaN;
+    protected double coordinateForAxis(final Object axis, final int j, final int i) {
+        return (axis instanceof CoordinateAxis2D) ? ((CoordinateAxis2D) axis).getCoordValue(j, i) : Double.NaN;
     }
 }

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -165,10 +165,12 @@ final class VariableWrapper extends Vari
 
     /**
      * Reads all the data for this variable and returns them as an array of a Java primitive type.
+     * Multi-dimensional variables are flattened as a one-dimensional array (wrapped in a vector).
+     * This method may cache the returned vector, at UCAR library choice.
      */
     @Override
     public Vector read() throws IOException {
-        final Array array = variable.read();
+        final Array array = variable.read();                // May be cached by the UCAR library.
         return Vector.create(array.get1DJavaArray(array.getElementType()), variable.isUnsigned());
     }
 

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java?rev=1799452&r1=1799451&r2=1799452&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java [UTF-8] Wed Jun 21 14:11:39 2017
@@ -58,7 +58,7 @@ import org.opengis.metadata.extent.Geogr
  * <blockquote><table class="compact" summary="List of all NetCDF attributes.">
  * <tr valign="top"><td style="width: 25%">
  * {@value     #ACCESS_CONSTRAINT}<br>
- * {@value     #ACKNOWLEDGMENT}<br>
+ * {@value     #ACKNOWLEDGEMENT}<br>
  * {@value     #COMMENT}<br>
  * {@linkplain #CONTRIBUTOR "contributor_email"}<br>
  * {@linkplain #CONTRIBUTOR "contributor_name"}<br>
@@ -123,9 +123,9 @@ import org.opengis.metadata.extent.Geogr
  *
  * <p><b>References:</b></p>
  * <ul>
- *   <li><a href="https://geo-ide.noaa.gov/wiki/index.php?title=NetCDF_Attribute_Convention_for_Dataset_Discovery">NetCDF
+ *   <li><a href="http://wiki.esipfed.org/index.php/Category:Attribute_Conventions_Dataset_Discovery">NetCDF
  *       Attribute Convention for Dataset Discovery</a> wiki</li>
- *   <li><a href="http://ngdc.noaa.gov/metadata/published/xsl/nciso2.0/UnidataDD2MI.xsl">UnidataDD2MI.xsl</a> file</li>
+ *   <li><a href="https://github.com/Unidata/threddsIso/blob/master/src/main/resources/xsl/nciso/UnidataDD2MI.xsl">UnidataDD2MI.xsl</a> file</li>
  * </ul>
  *
  * @author  Martin Desruisseaux (Geomatys)
@@ -145,7 +145,7 @@ public class AttributeNames {
      * {@link Citation#getTitle() title}</li></ul>
      *
      * @see NetcdfFile#getTitle()
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#title_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#title">ESIP reference</a>
      */
     public static final String TITLE = ACDD.title;
 
@@ -157,7 +157,7 @@ public class AttributeNames {
      * {@link Metadata#getIdentificationInfo() identificationInfo} /
      * {@link DataIdentification#getAbstract() abstract}</li></ul>
      *
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#summary_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#summary">ESIP reference</a>
      */
     public static final String SUMMARY = ACDD.summary;
 
@@ -174,9 +174,8 @@ public class AttributeNames {
      * {@link Citation#getIdentifiers() identifier} /
      * {@link Identifier#getCode() code}</li></ul>
      *
-     * @see MetadataReader#getFileIdentifier()
      * @see NetcdfFile#getId()
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#id_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#id">ESIP reference</a>
      */
     public static final String IDENTIFIER = ACDD.id;
 
@@ -194,8 +193,7 @@ public class AttributeNames {
      * {@link Identifier#getAuthority() authority}</li></ul>
      *
      * @see #IDENTIFIER
-     * @see MetadataReader#getFileIdentifier()
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#id_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#naming_authority">ESIP reference</a>
      */
     public static final String NAMING_AUTHORITY = ACDD.naming_authority;
 
@@ -211,7 +209,7 @@ public class AttributeNames {
      *
      * @see #STANDARD_NAME_VOCABULARY
      * @see #KEYWORDS
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#standard_name_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#standard_name">ESIP reference</a>
      */
     public static final String STANDARD_NAME = CF.STANDARD_NAME;
 
@@ -227,7 +225,7 @@ public class AttributeNames {
      *
      * @see #STANDARD_NAME
      * @see #VOCABULARY
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#standard_name_vocabulary_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#standard_name_vocabulary">ESIP reference</a>
      */
     public static final String STANDARD_NAME_VOCABULARY = ACDD.standard_name_vocabulary;
 
@@ -242,7 +240,7 @@ public class AttributeNames {
      *
      * @see #VOCABULARY
      * @see #STANDARD_NAME
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#keywords_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#keywords">ESIP reference</a>
      */
     public static final String KEYWORDS = ACDD.keywords;
 
@@ -258,7 +256,7 @@ public class AttributeNames {
      *
      * @see #KEYWORDS
      * @see #STANDARD_NAME_VOCABULARY
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#keywords_vocabulary_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#keywords_vocabulary">ESIP reference</a>
      */
     public static final String VOCABULARY = ACDD.keywords_vocabulary;
 
@@ -291,7 +289,7 @@ public class AttributeNames {
      * {@link DataIdentification#getSpatialRepresentationTypes() spatialRepresentationType}</li></ul>
      *
      * @see SpatialRepresentationType
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#cdm_data_type_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#cdm_data_type">ESIP reference</a>
      */
     public static final String DATA_TYPE = ACDD.cdm_data_type;
 
@@ -304,7 +302,7 @@ public class AttributeNames {
      * {@link DataQuality#getLineage() lineage} /
      * {@link Lineage#getStatement() statement}</li></ul>
      *
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#history_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#history">ESIP reference</a>
      */
     public static final String HISTORY = ACDD.history;
 
@@ -316,7 +314,7 @@ public class AttributeNames {
      * {@link Metadata#getIdentificationInfo() identificationInfo} /
      * {@link DataIdentification#getSupplementalInformation() supplementalInformation}</li></ul>
      *
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#comment_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#comment">ESIP reference</a>
      */
     public static final String COMMENT = ACDD.comment;
 
@@ -340,7 +338,7 @@ public class AttributeNames {
      * {@link Citation#getDates() date} /
      * {@link CitationDate#getDate() date} with {@link DateType#CREATION}</li></ul>
      *
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#date_created_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#date_created">ESIP reference</a>
      */
     public static final String DATE_CREATED = ACDD.date_created;
 
@@ -354,7 +352,7 @@ public class AttributeNames {
      * {@link Citation#getDates() date} /
      * {@link CitationDate#getDate() date} with {@link DateType#REVISION}</li></ul>
      *
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#date_modified_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#date_modified">ESIP reference</a>
      */
     public static final String DATE_MODIFIED = ACDD.date_modified;
 
@@ -368,7 +366,7 @@ public class AttributeNames {
      * {@link Citation#getDates() date} /
      * {@link CitationDate#getDate() date} with {@link DateType#PUBLICATION}</li></ul>
      *
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#date_issued_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#date_issued">ESIP reference</a>
      */
     public static final String DATE_ISSUED = "date_issued";
 
@@ -524,7 +522,7 @@ public class AttributeNames {
      *
      * @see #CONTRIBUTOR
      * @see #PUBLISHER
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#creator_name_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#creator_name">ESIP reference</a>
      */
     public static final Responsible CREATOR = new Responsible(ACDD.creator_name,
             "institution", ACDD.creator_url, ACDD.creator_email, null, Role.ORIGINATOR);
@@ -538,7 +536,7 @@ public class AttributeNames {
      *
      * @see #CREATOR
      * @see #PUBLISHER
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#contributor_name_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#contributor_name">ESIP reference</a>
      */
     public static final Responsible CONTRIBUTOR = new Responsible("contributor_name",
             null, "contributor_url", "contributor_email", "contributor_role", null);
@@ -557,7 +555,7 @@ public class AttributeNames {
      *
      * @see #CREATOR
      * @see #CONTRIBUTOR
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#publisher_name_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#publisher_name">ESIP reference</a>
      */
     public static final Responsible PUBLISHER = new Responsible(ACDD.publisher_name,
             null, ACDD.publisher_url, ACDD.publisher_email, null, Role.PUBLISHER);
@@ -571,7 +569,7 @@ public class AttributeNames {
      * {@link DataIdentification#getDescriptiveKeywords() descriptiveKeywords} /
      * {@link Keywords#getKeywords() keyword} with the {@code "project"} {@link KeywordType}</li></ul>
      *
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#project_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#project">ESIP reference</a>
      */
     public static final String PROJECT = "project";
 
@@ -603,7 +601,7 @@ public class AttributeNames {
      * {@link Metadata#getContentInfo() contentInfo} /
      * {@link ImageDescription#getProcessingLevelCode() processingLevelCode}</li></ul>
      *
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#processing_level_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#processing_level">ESIP reference</a>
      */
     public static final String PROCESSING_LEVEL = ACDD.processing_level;
 
@@ -615,7 +613,14 @@ public class AttributeNames {
      * {@link Metadata#getIdentificationInfo() identificationInfo} /
      * {@link DataIdentification#getCredits() credit}</li></ul>
      *
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#acknowledgement_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#acknowledgement">ESIP reference</a>
+     *
+     * @since 0.8
+     */
+    public static final String ACKNOWLEDGEMENT = ACDD.acknowledgement;
+
+    /**
+     * @deprecated Renamed {@link #ACKNOWLEDGEMENT}.
      */
     public static final String ACKNOWLEDGMENT = "acknowledgment";
 
@@ -628,7 +633,7 @@ public class AttributeNames {
      * {@link DataIdentification#getResourceConstraints() resourceConstraints} /
      * {@link LegalConstraints#getUseLimitations() useLimitation}</li></ul>
      *
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#license_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#license">ESIP reference</a>
      */
     public static final String LICENSE = ACDD.license;
 
@@ -832,7 +837,7 @@ public class AttributeNames {
      * @see #LONGITUDE
      * @see #VERTICAL
      * @see #TIME
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#geospatial_lat_min_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#geospatial_lat_min">ESIP reference</a>
      */
     public static final Dimension LATITUDE = new Dimension(DimensionNameType.ROW,
             ACDD.LAT_MIN, ACDD.LAT_MAX, null, ACDD.LAT_RESOLUTION, ACDD.LAT_UNITS, null);
@@ -856,7 +861,7 @@ public class AttributeNames {
      * @see #LATITUDE
      * @see #VERTICAL
      * @see #TIME
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#geospatial_lon_min_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#geospatial_lon_min">ESIP reference</a>
      */
     public static final Dimension LONGITUDE = new Dimension(DimensionNameType.COLUMN,
             ACDD.LON_MIN, ACDD.LON_MAX, null, ACDD.LON_RESOLUTION, ACDD.LON_UNITS, null);
@@ -880,7 +885,7 @@ public class AttributeNames {
      * @see #LATITUDE
      * @see #LONGITUDE
      * @see #TIME
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#geospatial_vertical_min_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#geospatial_vertical_min">ESIP reference</a>
      */
     public static final Dimension VERTICAL = new Dimension(DimensionNameType.VERTICAL,
             ACDD.VERT_MIN, ACDD.VERT_MAX, null, ACDD.VERT_RESOLUTION, ACDD.VERT_UNITS, ACDD.VERT_IS_POSITIVE);
@@ -902,7 +907,7 @@ public class AttributeNames {
      * @see #LATITUDE
      * @see #LONGITUDE
      * @see #VERTICAL
-     * @see <a href="http://www.unidata.ucar.edu/software/netcdf-java/formats/DataDiscoveryAttConvention.html#time_coverage_start_Attribute">UCAR reference</a>
+     * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#time_coverage_start">ESIP reference</a>
      */
     public static final Dimension TIME = new Dimension(DimensionNameType.TIME,
             ACDD.TIME_START, ACDD.TIME_END, ACDD.TIME_DURATION, ACDD.TIME_RESOLUTION, "time_coverage_units", null);



Mime
View raw message