sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1482262 - in /sis/branches/JDK7/storage/sis-netcdf/src: main/java/org/apache/sis/internal/ main/java/org/apache/sis/internal/netcdf/ main/java/org/apache/sis/internal/netcdf/ucar/ main/java/org/apache/sis/storage/netcdf/ test/java/org/apac...
Date Tue, 14 May 2013 09:24:29 GMT
Author: desruisseaux
Date: Tue May 14 09:24:29 2013
New Revision: 1482262

URL: http://svn.apache.org/r1482262
Log:
Refactored the internal API: moved abstract classes to "...internal.netcdf" package,
and the UCAR-based implementations to the "...internal.netcdf.ucar" package.

Added:
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java
      - copied, changed from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/Decoder.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Variable.java
      - copied, changed from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/Variable.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/WarningProducer.java
      - copied, changed from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/WarningProducer.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/package-info.java
  (with props)
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/CRSBuilder.java
      - copied, changed from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/CRSBuilderUCAR.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java
      - copied, changed from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/DecoderUCAR.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java
      - copied, changed from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/VariableUCAR.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/package-info.java
  (with props)
    sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/
    sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/
    sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/DecoderTest.java
      - copied, changed from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/DecoderTest.java
Removed:
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/CRSBuilderUCAR.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/Decoder.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/DecoderUCAR.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/Variable.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/VariableUCAR.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/WarningProducer.java
    sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/DecoderTest.java
Modified:
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
    sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/test/suite/NetcdfTestSuite.java

Copied: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java
(from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/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?p2=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java&p1=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/Decoder.java&r1=1481937&r2=1482262&rev=1482262&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/Decoder.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.storage.netcdf;
+package org.apache.sis.internal.netcdf;
 
 import java.util.Date;
 import java.util.List;
@@ -25,29 +25,20 @@ import org.apache.sis.metadata.iso.Defau
 
 
 /**
- * The API used internally by Apache SIS for fetching all data from NetCDF files.
- * We use this API for isolating Apache SIS from the library used for reading the
- * NetCDF file: it can be either the UCAR library, or our own internal library.
- *
- * <p>We do not use systematically the UCAR library because it is quite large (especially
when including
- * all dependencies) while SIS uses only a fraction of it. This is because the UCAR library
provides some
- * features like referencing services which overlap with SIS services. In addition, SIS often
needs "raw"
- * data instead of "high level" data. For example we need the minimal and maximal values
of a variable in
- * its raw format, while the UCAR high level API provides the values converted by the offset
and scale
- * factors.</p>
+ * The API used internally by Apache SIS for fetching variables and attribute values from
a NetCDF file.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
  * @version 0.3
  * @module
  */
-abstract class Decoder extends WarningProducer {
+public abstract class Decoder extends WarningProducer {
     /**
      * Creates a new decoder.
      *
      * @param parent Where to send the warnings, or {@code null} if none.
      */
-    Decoder(final WarningProducer parent) {
+    protected Decoder(final WarningProducer parent) {
         super(parent);
     }
 
@@ -65,6 +56,7 @@ abstract class Decoder extends WarningPr
      * 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.
      */
     public abstract String[] getSearchPath() throws IOException;
@@ -123,6 +115,7 @@ abstract class Decoder extends WarningPr
      * 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.
@@ -134,6 +127,7 @@ abstract class Decoder extends WarningPr
      * {@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.
      */
     public String getId() throws IOException {
@@ -145,6 +139,7 @@ abstract class Decoder extends WarningPr
      * {@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.
      */
     public String getTitle() throws IOException {

Copied: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Variable.java
(from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/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?p2=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Variable.java&p1=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/Variable.java&r1=1481937&r2=1482262&rev=1482262&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/Variable.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Variable.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.storage.netcdf;
+package org.apache.sis.internal.netcdf;
 
 import java.util.List;
 
@@ -27,7 +27,7 @@ import java.util.List;
  * @version 0.3
  * @module
  */
-abstract class Variable {
+public abstract class Variable {
     /**
      * Minimal number of dimension for accepting a variable as a coverage variable.
      */
@@ -36,7 +36,7 @@ abstract class Variable {
     /**
      * Creates a new variable.
      */
-    Variable() {
+    protected Variable() {
     }
 
     /**
@@ -95,8 +95,9 @@ abstract class Variable {
      * The elements will be of class {@link String} if {@code numeric} is {@code false},
      * or {@link Number} if {@code numeric} is {@code true}.
      *
-     * @param attributeName The name of the attribute for which to get the values.
-     * @param numeric {@code true} if the values are expected to be numeric, or {@code false}
for strings.
+     * @param  attributeName The name of the attribute for which to get the values.
+     * @param  numeric {@code true} if the values are expected to be numeric, or {@code false}
for strings.
+     * @return The sequence of {@link String} or {@link Number} values for the named attribute.
      */
     public abstract Object[] getAttributeValues(String attributeName, boolean numeric);
 }

Copied: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/WarningProducer.java
(from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/WarningProducer.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/WarningProducer.java?p2=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/WarningProducer.java&p1=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/WarningProducer.java&r1=1481937&r2=1482262&rev=1482262&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/WarningProducer.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/WarningProducer.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.storage.netcdf;
+package org.apache.sis.internal.netcdf;
 
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -31,7 +31,7 @@ import org.apache.sis.util.logging.Loggi
  * @version 0.3
  * @module
  */
-class WarningProducer {
+public class WarningProducer {
     /**
      * Where to send the warnings, or {@code null} if none.
      */
@@ -42,7 +42,7 @@ class WarningProducer {
      *
      * @param parent Where to send the warnings, or {@code null} if none.
      */
-    WarningProducer(final WarningProducer parent) {
+    protected WarningProducer(final WarningProducer parent) {
         this.parent = parent;
     }
 
@@ -68,7 +68,7 @@ class WarningProducer {
      * @param methodName The name of the method in which the warning occurred.
      * @param exception  The exception to log.
      */
-    final void warning(final String methodName, final Exception exception) {
+    protected final void warning(final String methodName, final Exception exception) {
         final LogRecord record = new LogRecord(Level.WARNING, Exceptions.formatChainedMessages(null,
null, exception));
         record.setSourceClassName(getClass().getCanonicalName());
         record.setSourceMethodName(methodName);

Added: 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=1482262&view=auto
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/package-info.java
(added)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/package-info.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * The API used internally by Apache SIS for fetching all data from NetCDF files.
+ * We use this API for isolating Apache SIS from the library used for reading the
+ * NetCDF file: it can be either the UCAR library, or our own internal library.
+ *
+ * <p>We do not use systematically the UCAR library because it is quite large (especially
when including
+ * all dependencies) while SIS uses only a fraction of it. This is because the UCAR library
provides some
+ * features like referencing services which overlap with SIS services. In addition, SIS often
needs "raw"
+ * data instead of "high level" data. For example we need the minimal and maximal values
of a variable in
+ * its raw format, while the UCAR high level API provides the values converted by the offset
and scale
+ * factors.</p>
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @since   0.3
+ * @version 0.3
+ * @module
+ */
+package org.apache.sis.internal.netcdf;

Propchange: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Copied: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/CRSBuilder.java
(from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/CRSBuilderUCAR.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/CRSBuilder.java?p2=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/CRSBuilder.java&p1=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/CRSBuilderUCAR.java&r1=1481937&r2=1482262&rev=1482262&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/CRSBuilderUCAR.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/CRSBuilder.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.storage.netcdf;
+package org.apache.sis.internal.netcdf.ucar;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -32,6 +32,7 @@ import ucar.nc2.dataset.CoordinateAxis2D
 import ucar.nc2.dataset.CoordinateSystem;
 
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.internal.netcdf.WarningProducer;
 
 import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
 import static org.apache.sis.util.collection.Containers.hashMapCapacity;
@@ -45,7 +46,7 @@ import static org.apache.sis.util.collec
  * @version 0.3
  * @module
  */
-final class CRSBuilderUCAR extends WarningProducer {
+final class CRSBuilder extends WarningProducer {
     /**
      * The NetCDF coordinate system to wrap.
      */
@@ -63,7 +64,7 @@ final class CRSBuilderUCAR extends Warni
      * @param parent Where to send the warnings, or {@code null} if none.
      * @param cs The NetCDF coordinate system, or {@code null} if none.
      */
-    CRSBuilderUCAR(final WarningProducer parent, final CoordinateSystem cs) {
+    CRSBuilder(final WarningProducer parent, final CoordinateSystem cs) {
         super(parent);
         netcdfCS = cs;
     }

Copied: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java
(from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/DecoderUCAR.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java?p2=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java&p1=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/DecoderUCAR.java&r1=1481937&r2=1482262&rev=1482262&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/DecoderUCAR.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.storage.netcdf;
+package org.apache.sis.internal.netcdf.ucar;
 
 import java.util.Date;
 import java.util.List;
@@ -37,10 +37,14 @@ import ucar.nc2.time.CalendarDateFormatt
 
 import org.opengis.metadata.spatial.CellGeometry;
 import org.opengis.metadata.spatial.GridSpatialRepresentation;
+
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.metadata.iso.spatial.DefaultDimension;
 import org.apache.sis.metadata.iso.spatial.DefaultGridSpatialRepresentation;
+import org.apache.sis.internal.netcdf.Decoder;
+import org.apache.sis.internal.netcdf.Variable;
+import org.apache.sis.internal.netcdf.WarningProducer;
 
 import static org.apache.sis.storage.netcdf.AttributeNames.*;
 
@@ -53,12 +57,12 @@ import static org.apache.sis.storage.net
  * @version 0.3
  * @module
  */
-final class DecoderUCAR extends Decoder {
+public final class DecoderWrapper extends Decoder {
     /**
      * The NetCDF file to read.
      * This file is set at construction time.
      *
-     * <p>This {@code DecoderUCAR} class does <strong>not</strong> close
this file.
+     * <p>This {@code DecoderWrapper} class does <strong>not</strong> close
this file.
      * Closing this file after usage is the user responsibility.</p>
      */
     private final NetcdfFile file;
@@ -81,7 +85,7 @@ final class DecoderUCAR extends Decoder 
      * @param parent Where to send the warnings, or {@code null} if none.
      * @param file The NetCDF file from which to parse metadata.
      */
-    DecoderUCAR(final WarningProducer parent, final NetcdfFile file) {
+    public DecoderWrapper(final WarningProducer parent, final NetcdfFile file) {
         super(parent);
         this.file = file;
     }
@@ -282,7 +286,7 @@ final class DecoderUCAR extends Decoder 
         final List<? extends VariableIF> all = file.getVariables();
         final List<Variable> variables = new ArrayList<>(all.size());
         for (final VariableIF variable : all) {
-            variables.add(new VariableUCAR(variable, all));
+            variables.add(new VariableWrapper(variable, all));
         }
         return variables;
     }
@@ -317,7 +321,7 @@ final class DecoderUCAR extends Decoder 
     private GridSpatialRepresentation createSpatialRepresentationInfo(final CoordinateSystem
cs) throws IOException {
         final DefaultGridSpatialRepresentation grid = new DefaultGridSpatialRepresentation();
         grid.setNumberOfDimensions(cs.getRankDomain());
-        final CRSBuilderUCAR builder = new CRSBuilderUCAR(this, cs);
+        final CRSBuilder builder = new CRSBuilder(this, cs);
         for (final Map.Entry<ucar.nc2.Dimension, CoordinateAxis> entry : builder.getAxesDomain().entrySet())
{
             final CoordinateAxis axis = entry.getValue();
             final int i = axis.getDimensions().indexOf(entry.getKey());
@@ -346,7 +350,7 @@ final class DecoderUCAR extends Decoder 
             }
             final DefaultDimension dimension = new DefaultDimension();
             if (rsat != null) {
-                dimension.setDimensionName(rsat.TYPE);
+                dimension.setDimensionName(rsat.DEFAULT_NAME_TYPE);
                 dimension.setResolution(resolution);
             }
             dimension.setDimensionSize(axis.getShape(i));

Copied: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java
(from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/VariableUCAR.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java?p2=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java&p1=sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/VariableUCAR.java&r1=1481937&r2=1482262&rev=1482262&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/VariableUCAR.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -14,8 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.storage.netcdf;
+package org.apache.sis.internal.netcdf.ucar;
 
+import org.apache.sis.internal.netcdf.Variable;
 import java.util.List;
 import java.util.ArrayList;
 import java.awt.image.DataBuffer;
@@ -34,7 +35,7 @@ import org.apache.sis.util.CharSequences
  * @version 0.3
  * @module
  */
-final class VariableUCAR extends Variable {
+final class VariableWrapper extends Variable {
     /**
      * The NetCDF variable.
      */
@@ -49,7 +50,7 @@ final class VariableUCAR extends Variabl
     /**
      * Creates a new variable wrapping the given NetCDF interface.
      */
-    VariableUCAR(final VariableIF variable, List<? extends VariableIF> all) {
+    VariableWrapper(final VariableIF variable, List<? extends VariableIF> all) {
         this.variable = variable;
         this.all = all;
     }

Added: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/package-info.java?rev=1482262&view=auto
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/package-info.java
(added)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/package-info.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Implementation of the {@link org.apache.sis.internal.netcdf} API
+ * as wrappers around the UCAR NetCDF library.
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @since   0.3
+ * @version 0.3
+ * @module
+ */
+package org.apache.sis.internal.netcdf.ucar;

Propchange: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

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=1482262&r1=1482261&r2=1482262&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] Tue May 14 09:24:29 2013
@@ -456,8 +456,7 @@ public final class AttributeNames {
         public final Role DEFAULT_ROLE;
 
         /**
-         * Creates a new set of attribute names. Any argument can be {@code null}
-         * if not applicable.
+         * Creates a new set of attribute names. Any argument can be {@code null} if not
applicable.
          *
          * @param name        The attribute name for the responsible's name.
          * @param institution The attribute name for the responsible's institution.
@@ -668,6 +667,12 @@ public final class AttributeNames {
      *   <td></td>
      *   <td>{@code "geospatial_vertical_positive"}</td>
      *   <td></td>
+     * </tr><tr>
+     *   <td>{@link #DEFAULT_NAME_TYPE}</td>
+     *   <td>{@link DimensionNameType#ROW}</td>
+     *   <td>{@link DimensionNameType#COLUMN}</td>
+     *   <td>{@link DimensionNameType#VERTICAL}</td>
+     *   <td>{@link DimensionNameType#TIME}</td>
      * </tr></table>
      *
      * {@note The member names in this class are upper-cases because they should be considered
@@ -684,16 +689,6 @@ public final class AttributeNames {
      */
     public static class Dimension {
         /**
-         * The ISO-19115 dimension type, or {@code null} if none.
-         * Current implementation assigns {@link DimensionNameType#COLUMN} to longitudes
and
-         * {@link DimensionNameType#ROW} to latitude, which is not strictly correct since
the
-         * columns and rows can be anything. The problem is that we relate this type to the
-         * coordinate system, while it should be related to the grid geometry. We may need
to
-         * remove this field in a future version.
-         */
-        final DimensionNameType TYPE;
-
-        /**
          * The attribute name for the minimal value of the bounding box (<em>Recommended</em>).
          * Possible values are {@code "geospatial_lat_min"}, {@code "geospatial_lon_min"},
          * {@code "geospatial_vertical_min"} and {@code "time_coverage_start"}.
@@ -735,8 +730,21 @@ public final class AttributeNames {
         public final String POSITIVE;
 
         /**
+         * The default ISO-19115 dimension name type, or {@code null} if none.
+         * By default, {@link DimensionNameType#COLUMN} is associated to longitudes and {@link
DimensionNameType#ROW}
+         * to latitudes since geographic maps in NetCDF files are typically shown horizontally.
+         *
+         * <p>The default associations may not be always correct since the columns
and rows can be anything.
+         * Strictly speaking, the dimension name types shall be associated to the <em>grid
axes</em> rather
+         * than the <em>coordinate system axes</em>. However the default association
is correct in the common case
+         * (for NetCDF files) where there is no axis swapping in the <cite>grid to
CRS</cite> conversion.</p>
+         */
+        public final DimensionNameType DEFAULT_NAME_TYPE;
+
+        /**
          * Creates a new set of attribute names.
          *
+         * @param type       The default ISO-19115 dimension name type, or {@code null} if
none.
          * @param min        The attribute name for the minimal value of the bounding box.
          * @param max        The attribute name for the maximal value of the bounding box.
          * @param span       The attribute name for the difference between the minimal and
maximal values.
@@ -744,32 +752,16 @@ public final class AttributeNames {
          * @param units      The attribute name for the bounding box units of measurement.
          * @param positive   The attribute name for indicating which direction is positive.
          */
-        public Dimension(final String min, final String max, final String span,
-                final String resolution,final String units, final String positive)
-        {
-            TYPE       = null;
-            MINIMUM    = min;
-            MAXIMUM    = max;
-            SPAN       = span;
-            RESOLUTION = resolution;
-            UNITS      = units;
-            POSITIVE   = positive;
-        }
-
-        /**
-         * Same constructor than above, but allows to specify the type. See {@link #TYPE}
-         * for an explanation about why this field is not public.
-         */
-        Dimension(final DimensionNameType type, final String min, final String max, final
String span,
+        public Dimension(final DimensionNameType type, final String min, final String max,
final String span,
                 final String resolution,final String units, final String positive)
         {
-            TYPE       = type;
-            MINIMUM    = min;
-            MAXIMUM    = max;
-            SPAN       = span;
-            RESOLUTION = resolution;
-            UNITS      = units;
-            POSITIVE   = positive;
+            DEFAULT_NAME_TYPE = type;
+            MINIMUM           = min;
+            MAXIMUM           = max;
+            SPAN              = span;
+            RESOLUTION        = resolution;
+            UNITS             = units;
+            POSITIVE          = positive;
         }
     }
 

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java?rev=1482262&r1=1482261&r2=1482262&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -60,6 +60,9 @@ import org.apache.sis.metadata.iso.ident
 import org.apache.sis.metadata.iso.lineage.DefaultLineage;
 import org.apache.sis.metadata.iso.quality.DefaultDataQuality;
 import org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints;
+import org.apache.sis.internal.netcdf.Decoder;
+import org.apache.sis.internal.netcdf.Variable;
+import org.apache.sis.internal.netcdf.WarningProducer;
 
 // The following dependency is used only for static final String constants.
 // Consequently the compiled class files should not have this dependency.

Copied: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/DecoderTest.java
(from r1481937, sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/DecoderTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/DecoderTest.java?p2=sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/DecoderTest.java&p1=sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/DecoderTest.java&r1=1481937&r2=1482262&rev=1482262&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/DecoderTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/DecoderTest.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -14,11 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.storage.netcdf;
+package org.apache.sis.internal.netcdf;
 
 import java.io.IOException;
 import ucar.nc2.NetcdfFile;
 import org.opengis.wrapper.netcdf.IOTestCase;
+import org.apache.sis.storage.netcdf.AttributeNames;
+import org.apache.sis.internal.netcdf.ucar.DecoderWrapper;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
@@ -39,7 +41,7 @@ public final strictfp class DecoderTest 
     private Decoder decoder;
 
     /**
-     * Tests the {@link DecoderUCAR} implementation.
+     * Tests the {@link DecoderWrapper} implementation.
      *
      * @throws IOException If an error occurred while reading the NetCDF file.
      */
@@ -47,7 +49,7 @@ public final strictfp class DecoderTest 
     public void testUCAR() throws IOException {
         final NetcdfFile file = open(IOTestCase.NCEP);
         try {
-            decoder = new DecoderUCAR(null, file);
+            decoder = new DecoderWrapper(null, file);
             runAllTests();
         } finally {
             file.close();

Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/test/suite/NetcdfTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/test/suite/NetcdfTestSuite.java?rev=1482262&r1=1482261&r2=1482262&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/test/suite/NetcdfTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/test/suite/NetcdfTestSuite.java
[UTF-8] Tue May 14 09:24:29 2013
@@ -31,7 +31,7 @@ import org.junit.BeforeClass;
  * @module
  */
 @Suite.SuiteClasses({
-    org.apache.sis.storage.netcdf.DecoderTest.class
+    org.apache.sis.internal.netcdf.DecoderTest.class
 })
 public final strictfp class NetcdfTestSuite extends TestSuite {
     /**



Mime
View raw message