sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1507231 - in /sis/branches/JDK7: core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/ storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/
Date Fri, 26 Jul 2013 09:10:11 GMT
Author: desruisseaux
Date: Fri Jul 26 09:10:10 2013
New Revision: 1507231

URL: http://svn.apache.org/r1507231
Log:
Moved the WORLD constant from DefaultExtent to the Extents static utility class.

Modified:
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
    sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java?rev=1507231&r1=1507230&r2=1507231&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
[UTF-8] Fri Jul 26 09:10:10 2013
@@ -29,7 +29,6 @@ import org.opengis.metadata.extent.Geogr
 import org.opengis.referencing.operation.TransformException;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.iso.Types;
-import org.apache.sis.util.resources.Vocabulary;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.internal.metadata.ReferencingServices;
 
@@ -72,19 +71,6 @@ public class DefaultExtent extends ISOMe
     private static final long serialVersionUID = 2979058128422252800L;
 
     /**
-     * A geographic extent ranging from 180°W to 180°E and 90°S to 90°N.
-     * This extent has no vertical and no temporal components.
-     */
-    public static final Extent WORLD;
-    static {
-        final DefaultExtent world = new DefaultExtent(
-                Vocabulary.formatInternational(Vocabulary.Keys.World),
-                DefaultGeographicBoundingBox.WORLD, null, null);
-        world.freeze();
-        WORLD = world;
-    }
-
-    /**
      * The spatial and temporal extent for the referring object.
      */
     private InternationalString description;
@@ -133,36 +119,6 @@ public class DefaultExtent extends ISOMe
     }
 
     /**
-     * Constructs an extent initialized to the given geographic bounding box.
-     *
-     * <p><strong>Caution:</strong> Arguments are expected in the same
order than they appear
-     * in the ISO 19115 specification. This is different than the order commonly found in
the
-     * Java2D world, which is rather (<var>x</var><sub>min</sub>,
<var>y</var><sub>min</sub>,
-     * <var>x</var><sub>max</sub>, <var>y</var><sub>max</sub>).</p>
-     *
-     * @param westBoundLongitude The minimal λ value.
-     * @param eastBoundLongitude The maximal λ value.
-     * @param southBoundLatitude The minimal φ value.
-     * @param northBoundLatitude The maximal φ value.
-     *
-     * @throws IllegalArgumentException If (<var>west bound</var> &gt; <var>east
bound</var>)
-     *         or (<var>south bound</var> &gt; <var>north bound</var>).
-     *         Note that {@linkplain Double#NaN NaN} values are allowed.
-     *
-     * @see DefaultGeographicBoundingBox#DefaultGeographicBoundingBox(double, double, double,
double)
-     */
-    public DefaultExtent(final double westBoundLongitude,
-                         final double eastBoundLongitude,
-                         final double southBoundLatitude,
-                         final double northBoundLatitude)
-             throws IllegalArgumentException
-    {
-        geographicElements = singleton(new DefaultGeographicBoundingBox(
-                westBoundLongitude, eastBoundLongitude,
-                southBoundLatitude, northBoundLatitude), GeographicExtent.class);
-    }
-
-    /**
      * Constructs a new instance initialized with the values from the specified metadata
object.
      * This is a <cite>shallow</cite> copy constructor, since the other metadata
contained in the
      * given object are not recursively copied.

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java?rev=1507231&r1=1507230&r2=1507231&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
[UTF-8] Fri Jul 26 09:10:10 2013
@@ -75,16 +75,6 @@ public class DefaultGeographicBoundingBo
     private static final long serialVersionUID = -9200149606040429957L;
 
     /**
-     * A bounding box ranging from 180°W to 180°E and 90°S to 90°N.
-     */
-    public static final GeographicBoundingBox WORLD;
-    static {
-        final DefaultGeographicBoundingBox world = new DefaultGeographicBoundingBox(-180,
180, -90, 90);
-        world.freeze();
-        WORLD = world;
-    }
-
-    /**
      * The western-most coordinate of the limit of the dataset extent.
      * The value is expressed in longitude in decimal degrees (positive east).
      */
@@ -138,7 +128,6 @@ public class DefaultGeographicBoundingBo
      *         Note that {@linkplain Double#NaN NaN} values are allowed.
      *
      * @see #setBounds(double, double, double, double)
-     * @see DefaultExtent#DefaultExtent(double, double, double, double)
      */
     public DefaultGeographicBoundingBox(final double westBoundLongitude,
                                         final double eastBoundLongitude,

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java?rev=1507231&r1=1507230&r2=1507231&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
[UTF-8] Fri Jul 26 09:10:10 2013
@@ -20,6 +20,7 @@ import org.opengis.metadata.extent.Exten
 import org.opengis.metadata.extent.BoundingPolygon;
 import org.opengis.metadata.extent.GeographicExtent;
 import org.opengis.metadata.extent.GeographicBoundingBox;
+import org.apache.sis.util.resources.Vocabulary;
 import org.apache.sis.util.Static;
 
 import static org.apache.sis.internal.metadata.MetadataUtilities.getInclusion;
@@ -43,6 +44,20 @@ public final class Extents extends Stati
     }
 
     /**
+     * A geographic extent ranging from 180°W to 180°E and 90°S to 90°N.
+     * This extent has no vertical and no temporal components.
+     */
+    public static final Extent WORLD;
+    static {
+        final DefaultGeographicBoundingBox box = new DefaultGeographicBoundingBox(-180, 180,
-90, 90);
+        box.freeze();
+        final DefaultExtent world = new DefaultExtent(
+                Vocabulary.formatInternational(Vocabulary.Keys.World), box, null, null);
+        world.freeze();
+        WORLD = world;
+    }
+
+    /**
      * Returns a single geographic bounding box from the specified extent.
      * If no bounding box is found, then this method returns {@code null}.
      * If a single bounding box is found, then that box is returned directly.

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=1507231&r1=1507230&r2=1507231&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] Fri Jul 26 09:10:10 2013
@@ -622,8 +622,9 @@ final class MetadataReader {
         if (xmin != null || xmax != null || ymin != null || ymax != null) {
             final UnitConverter xConv = getConverterTo(decoder.unitValue(LONGITUDE.UNITS),
NonSI.DEGREE_ANGLE);
             final UnitConverter yConv = getConverterTo(decoder.unitValue(LATITUDE .UNITS),
NonSI.DEGREE_ANGLE);
-            extent = new DefaultExtent(valueOf(xmin, xConv), valueOf(xmax, xConv),
-                                       valueOf(ymin, yConv), valueOf(ymax, yConv));
+            extent = new DefaultExtent(null, new DefaultGeographicBoundingBox(
+                    valueOf(xmin, xConv), valueOf(xmax, xConv),
+                    valueOf(ymin, yConv), valueOf(ymax, yConv)), null, null);
         }
         /*
          * If at least one vertical ordinates above is available, add a VerticalExtent.



Mime
View raw message