sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1648665 - in /sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis: internal/metadata/ReferencingServices.java metadata/iso/extent/DefaultSpatialTemporalExtent.java metadata/iso/extent/DefaultTemporalExtent.java
Date Wed, 31 Dec 2014 09:04:24 GMT
Author: desruisseaux
Date: Wed Dec 31 09:04:24 2014
New Revision: 1648665

URL: http://svn.apache.org/r1648665
Log:
Change in the contract specified by javadoc: in SpatialTemporalExtent, the temporal component
is no longer mandatory as long as if have at least one of spatial, vertical or temporal parts.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultSpatialTemporalExtent.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java?rev=1648665&r1=1648664&r2=1648665&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
[UTF-8] Wed Dec 31 09:04:24 2014
@@ -141,9 +141,10 @@ public abstract class ReferencingService
     public abstract FormattableObject toFormattableObject(IdentifiedObject object);
 
     /**
-     * Sets a geographic bounding box from the specified envelope. If the envelope contains
-     * a CRS, then the bounding box will be projected to a geographic CRS. Otherwise, the
envelope
-     * is assumed already in appropriate CRS.
+     * Sets a geographic bounding box from the specified envelope.
+     * If the envelope contains a CRS which is not geographic, then the bounding box will
be transformed
+     * to a geographic CRS (without datum shift if possible). Otherwise, the envelope is
assumed already
+     * in a geographic CRS using (<var>longitude</var>, <var>latitude</var>)
axis order.
      *
      * @param  envelope The source envelope.
      * @param  target The target bounding box.
@@ -175,8 +176,18 @@ public abstract class ReferencingService
             throws TransformException;
 
     /**
-     * Sets a temporal extent with the value inferred from the given envelope,
-     * and optionally sets a geographic bounding box if a spatial component if found.
+     * Sets the geographic, vertical and temporal extents with the values inferred from the
given envelope.
+     * If the given {@code target} has more geographic or vertical extents than needed (0
or 1), then the
+     * extraneous extents are removed.
+     *
+     * <p>Behavior regarding missing dimensions:</p>
+     * <ul>
+     *   <li>If the given envelope has no horizontal component, then all geographic
extents are removed
+     *       from the given {@code target}. Non-geographic extents (e.g. descriptions and
polygons) are
+     *       left unchanged.</li>
+     *   <li>If the given envelope has no vertical component, then the vertical extent
is set to {@code null}.</li>
+     *   <li>If the given envelope has no temporal component, then the temporal extent
is set to {@code null}.</li>
+     * </ul>
      *
      * @param  envelope The source envelope.
      * @param  target The target spatio-temporal extent.

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultSpatialTemporalExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultSpatialTemporalExtent.java?rev=1648665&r1=1648664&r2=1648665&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultSpatialTemporalExtent.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultSpatialTemporalExtent.java
[UTF-8] Wed Dec 31 09:04:24 2014
@@ -182,15 +182,29 @@ public class DefaultSpatialTemporalExten
 
     /**
      * Sets this spatio-temporal extent to values inferred from the specified envelope.
-     * The envelope shall have at least a temporal component. If a spatial component is
-     * also found, then:
+     * The given envelope shall have at least a spatial, vertical or temporal component.
      *
+     * <p>The spatial component is handled as below:</p>
      * <ul>
-     *   <li>If the collection of {@link #getSpatialExtent() spatial extents} contains
a
-     *       {@link GeographicBoundingBox}, then that bounding box will be updated or replaced
-     *       by a bounding box containing the spatial component of the given envelope.</li>
-     *   <li>Otherwise a new {@link DefaultGeographicBoundingBox} with the spatial
component
-     *       of the given envelope is added to the list of spatial extents.</li>
+     *   <li>If the given envelope has an horizontal component, then:
+     *     <ul>
+     *       <li>If the collection of {@linkplain #getSpatialExtent() spatial extents}
contains a
+     *           {@link GeographicBoundingBox}, then that bounding box will be updated or
replaced
+     *           by a bounding box containing the spatial component of the given envelope.</li>
+     *       <li>Otherwise a new {@link DefaultGeographicBoundingBox} with the spatial
component
+     *           of the given envelope is added to the list of spatial extents.</li>
+     *     </ul>
+     *   </li>
+     *   <li>All extraneous geographic extents are removed.
+     *       Non-geographic extents (e.g. descriptions and polygons) are left unchanged.</li>
+     * </ul>
+     *
+     * <p>Other dimensions are handled in a more straightforward way:</p>
+     * <ul>
+     *   <li>The {@linkplain #getVerticalExtent() vertical extent} is set to the vertical
component
+     *       of the given envelope, or {@code null} if none.</li>
+     *   <li>The {@linkplain #getExtent() temporal extent} is set to the temporal component
+     *       of the given envelope, or {@code null} if none.</li>
      * </ul>
      *
      * <b>Note:</b> This method is available only if the {@code sis-referencing}
module is

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java?rev=1648665&r1=1648664&r2=1648665&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
[UTF-8] Wed Dec 31 09:04:24 2014
@@ -218,9 +218,9 @@ public class DefaultTemporalExtent exten
     }
 
     /**
-     * Sets this temporal extent to values inferred from the specified envelope. The envelope
can
-     * be multi-dimensional, in which case the {@linkplain Envelope#getCoordinateReferenceSystem()
-     * envelope CRS} must have a temporal component.
+     * Sets this temporal extent to values inferred from the specified envelope.
+     * The given envelope must have a {@linkplain Envelope#getCoordinateReferenceSystem()
CRS},
+     * and at least one dimension of that CRS shall be assignable to a property of this extent.
      *
      * <p><b>Note:</b> This method is available only if the {@code sis-referencing}
module is
      * available on the classpath.</p>



Mime
View raw message