You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2015/05/08 16:40:03 UTC

svn commit: r1678365 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/ sis-referencing/src/main/java/org/apache/sis/geometry/ sis-referencing/src/main/java/org/apache/sis/referencing/crs/

Author: desruisseaux
Date: Fri May  8 14:40:02 2015
New Revision: 1678365

URL: http://svn.apache.org/r1678365
Log:
Add a few clarifications in javadoc.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java?rev=1678365&r1=1678364&r2=1678365&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java [UTF-8] Fri May  8 14:40:02 2015
@@ -602,7 +602,16 @@ public class DefaultGeographicBoundingBo
      * In both cases, if either this box or the specified box has {@linkplain Double#NaN NaN} bounds,
      * then the corresponding bounds of the result will bet set to NaN.
      *
+     * <div class="note"><b>Rational:</b>
+     * this class is stricter about NaN values than other classes like {@link org.apache.sis.geometry.GeneralEnvelope}.
+     * The reason is that computations on {@code GeographicBoundingBox} instances are rare ({@code Envelope} instances
+     * are preferred for this purpose). Usually, {@code GeographicBoundingBox} values come directly from some metadata
+     * structure. Consequently NaN values in {@code GeographicBoundingBox} means <cite>"information is unknown"</cite>
+     * more often than <cite>"not yet calculated"</cite>.</div>
+     *
      * @param box The geographic bounding box to add to this box.
+     *
+     * @see org.apache.sis.geometry.GeneralEnvelope#add(Envelope)
      */
     public void add(final GeographicBoundingBox box) {
         checkWritePermission();
@@ -659,6 +668,7 @@ public class DefaultGeographicBoundingBo
      * @throws IllegalArgumentException If the inclusion status is not the same for both boxes.
      *
      * @see Extents#intersection(GeographicBoundingBox, GeographicBoundingBox)
+     * @see org.apache.sis.geometry.GeneralEnvelope#intersect(Envelope)
      */
     public void intersect(final GeographicBoundingBox box) throws IllegalArgumentException {
         checkWritePermission();

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java?rev=1678365&r1=1678364&r2=1678365&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] Fri May  8 14:40:02 2015
@@ -507,7 +507,7 @@ public class GeneralEnvelope extends Arr
      * The default implementation moves only the border which is closest to the given point.
      *
      * @param  position The point to add.
-     * @throws MismatchedDimensionException if the specified point doesn't have the expected dimension.
+     * @throws MismatchedDimensionException If the given point does not have the expected number of dimensions.
      * @throws AssertionError If assertions are enabled and the envelopes have mismatched CRS.
      */
     public void add(final DirectPosition position) throws MismatchedDimensionException {
@@ -581,9 +581,10 @@ public class GeneralEnvelope extends Arr
      * whatever the original range span the anti-meridian or not.
      *
      * @param  envelope the {@code Envelope} to add to this envelope.
-     * @throws MismatchedDimensionException if the specified envelope doesn't
-     *         have the expected dimension.
+     * @throws MismatchedDimensionException If the given envelope does not have the expected number of dimensions.
      * @throws AssertionError If assertions are enabled and the envelopes have mismatched CRS.
+     *
+     * @see org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox#add(GeographicBoundingBox)
      */
     public void add(final Envelope envelope) throws MismatchedDimensionException {
         ensureNonNull("envelope", envelope);
@@ -705,9 +706,10 @@ public class GeneralEnvelope extends Arr
      * This method supports envelopes spanning the anti-meridian.
      *
      * @param  envelope the {@code Envelope} to intersect to this envelope.
-     * @throws MismatchedDimensionException if the specified envelope doesn't
-     *         have the expected dimension.
+     * @throws MismatchedDimensionException If the given envelope does not have the expected number of dimensions.
      * @throws AssertionError If assertions are enabled and the envelopes have mismatched CRS.
+     *
+     * @see org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox#intersect(GeographicBoundingBox)
      */
     public void intersect(final Envelope envelope) throws MismatchedDimensionException {
         ensureNonNull("envelope", envelope);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java?rev=1678365&r1=1678364&r2=1678365&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java [UTF-8] Fri May  8 14:40:02 2015
@@ -58,7 +58,7 @@ import org.apache.sis.util.Classes;
  * (for example in order to use a {@linkplain org.apache.sis.referencing.cs.DefaultPolarCS polar coordinate system}).
  *
  * <p>A {@code DerivedCRS} instance may also implement one of the interfaces listed below,
- * provided that the conditions in the right column are meet:</p>
+ * provided that the conditions in the right column are meet (derived from ISO 19162):</p>
  *
  * <table class="sis">
  *   <caption>Derived CRS types</caption>
@@ -66,7 +66,7 @@ import org.apache.sis.util.Classes;
  *   <tr><td>{@link GeodeticCRS}</td>    <td>Base CRS is also a {@code GeodeticCRS} and is associated to the same type of coordinate system.</td></tr>
  *   <tr><td>{@link VerticalCRS}</td>    <td>Base CRS is also a {@code VerticalCRS} and coordinate system is a {@code VerticalCS}.</td></tr>
  *   <tr><td>{@link TemporalCRS}</td>    <td>Base CRS is also a {@code TemporalCRS} and coordinate system is a {@code TimeCS}.</td></tr>
- *   <tr><td>{@link EngineeringCRS}</td> <td>Base CRS is also a {@code GeodeticCRS}, {@code ProjectedCRS} or {@code EngineeringCRS}.</td></tr>
+ *   <tr><td>{@link EngineeringCRS}</td> <td>Base CRS is a {@code GeodeticCRS}, {@code ProjectedCRS} or {@code EngineeringCRS}.</td></tr>
  * </table>
  *
  * Those specialized subclasses can be inferred automatically by the {@link #create create(…)} static method.