sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1567972 - in /sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing: AbstractReferenceSystem.java cs/AbstractCS.java
Date Thu, 13 Feb 2014 16:27:33 GMT
Author: desruisseaux
Date: Thu Feb 13 16:27:33 2014
New Revision: 1567972

URL: http://svn.apache.org/r1567972
Log:
Javadoc update, and check for compliance of WKT CS element.

Modified:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java?rev=1567972&r1=1567971&r2=1567972&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
[UTF-8] Thu Feb 13 16:27:33 2014
@@ -36,9 +36,13 @@ import java.util.Objects;
 
 /**
  * Description of a spatial and temporal reference system used by a dataset.
- * This class inherits the {@linkplain #getName() name}, {@linkplain #getAlias() aliases},
+ * Reference systems do not necessarily use coordinates. For example a reference system could
use postal codes.
+ * The specialized case of referencing by coordinates is handled by the
+ * {@link org.apache.sis.referencing.crs.AbstractCRS} subclass.
+ *
+ * <p>This class inherits the {@linkplain #getName() name}, {@linkplain #getAlias()
aliases},
  * {@linkplain #getIdentifiers() identifiers} and {@linkplain #getRemarks() remarks} from
- * the parent class, and adds the following information:
+ * the parent class, and adds the following information:</p>
  *
  * <ul>
  *   <li>a {@linkplain #getDomainOfValidity() domain of validity}, the area for which
the reference system is valid,</li>

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java?rev=1567972&r1=1567971&r2=1567972&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
[UTF-8] Thu Feb 13 16:27:33 2014
@@ -415,26 +415,31 @@ public class AbstractCS extends Abstract
 
     /**
      * Formats the inner part of a <cite>Well Known Text</cite> (WKT) element.
+     * This method does <strong>not</strong> format the axes, because they shall
appear outside
+     * the {@code CS[…]} element for historical reasons. Axes shall be formatted by the
enclosing
+     * element (usually an {@link org.apache.sis.referencing.crs.AbstractCRS}).
      *
-     * {@example <blockquote><pre>CS[ellipsoidal,3],
-     *    AXIS["latitude",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],
-     *    AXIS["longitude",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]]</pre></blockquote>
+     * {@example Well Known Text of a two-dimensional <code>EllipsoidalCS</code>
having (φ,λ) axes
+     *           in a unit defined by the enclosing CRS (usually degrees):
+     *
+     * <pre>CS[ellipsoidal, 2],
+     *  AXIS["latitude", north],
+     *  AXIS["longitude", east]</pre>
      * }
      *
-     * This is supported only for version 2 of WKT.
+     * This Well Known Text is valid only for version 2 of WKT.
      *
      * @param  formatter The formatter to use.
      * @return The WKT element name, which is {@code "CS"}.
      */
     @Override
     protected String formatTo(final Formatter formatter) {
-        formatter.append(ReferencingUtilities.toWKTType(CoordinateSystem.class, getInterface()),
null);
-        formatter.append(getDimension());
-        // TODO: Axes need to be formatted outside CS.
-        for (final CoordinateSystemAxis axe : axes) {
-            formatter.newLine();
-            formatter.append(axe);
+        final String type = ReferencingUtilities.toWKTType(CoordinateSystem.class, getInterface());
+        if (type == null) {
+            formatter.setInvalidWKT(this, null);
         }
+        formatter.append(type, null);
+        formatter.append(getDimension());
         return "CS";
     }
 }



Mime
View raw message