sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1534152 - in /sis/branches/JDK7/core: sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/ sis-referencing/src/main/java/org/apache/sis/referencing/ sis-referencing/src/main/java/org/apache/sis/referencing/datum/ sis-referencin...
Date Mon, 21 Oct 2013 13:46:11 GMT
Author: desruisseaux
Date: Mon Oct 21 13:46:10 2013
New Revision: 1534152

URL: http://svn.apache.org/r1534152
Log:
Abandon the @EPSG annotation experiment. It was polluting a bit the javadoc and source files,
and was more difficult to apply than initially though because the relationship was not always
one-to-one. We will rely on javadoc instead.

Added:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/package-info.java
      - copied, changed from r1533647, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSG.java
Removed:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSG.java
Modified:
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticObjects.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1534152&r1=1534151&r2=1534152&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
[UTF-8] Mon Oct 21 13:46:10 2013
@@ -119,11 +119,7 @@ public final class Citations extends Sta
      * The <a href="http://www.epsg.org">European Petroleum Survey Group</a>
authority.
      * This citation is used as an authority for
      * {@linkplain org.opengis.referencing.crs.CoordinateReferenceSystem coordinate reference
system}
-     * identifiers. When searching an {@linkplain org.opengis.referencing.crs.CRSAuthorityFactory
CRS
-     * authority factory} on EPSG data, SIS compares the {@code "EPSG"} string against the
-     * {@linkplain Citation#getIdentifiers identifiers} (or against the {@linkplain Citation#getTitle
-     * title} and {@linkplain Citation#getAlternateTitles alternate titles} if there is no
identifier)
-     * using the {@link #identifierMatches(Citation,String) identifierMatches} method.
+     * identifiers.
      *
      * @see #AUTO
      * @see #AUTO2

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticObjects.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticObjects.java?rev=1534152&r1=1534151&r2=1534152&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticObjects.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticObjects.java
[UTF-8] Mon Oct 21 13:46:10 2013
@@ -104,7 +104,6 @@ public enum GeodeticObjects {
      *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
      * </table></blockquote>
      */
-    @EPSG(type = GeographicCRS.class, code = 4326)
     WGS84((short) 7030),
 
     /**
@@ -121,7 +120,6 @@ public enum GeodeticObjects {
      *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
      * </table></blockquote>
      */
-    @EPSG(type = GeographicCRS.class, code = 4322)
     WGS72((short) 7043),
 
     /**
@@ -144,7 +142,6 @@ public enum GeodeticObjects {
      *        The <cite>Web Map Server</cite> <code>"CRS:83"</code>
authority code uses the NAD83 datum,
      *        while the <code>"IGNF:MILLER"</code> authority code uses the GRS80
datum.}
      */
-    @EPSG(type = GeographicCRS.class, code = 4258)
     ETRS89((short) 7019),
 
     /**
@@ -168,7 +165,6 @@ public enum GeodeticObjects {
      *        The <cite>Web Map Server</cite> <code>"CRS:83"</code>
authority code uses the NAD83 datum,
      *        while the <code>"IGNF:MILLER"</code> authority code uses the GRS80
datum.}
      */
-    @EPSG(type = GeographicCRS.class, code = 4269)
     NAD83((short) 7019),
 
     /**
@@ -185,7 +181,6 @@ public enum GeodeticObjects {
      *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
      * </table></blockquote>
      */
-    @EPSG(type = GeographicCRS.class, code = 4267)
     NAD27((short) 7008),
 
     /**
@@ -202,7 +197,6 @@ public enum GeodeticObjects {
      *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
      * </table></blockquote>
      */
-    @EPSG(type = GeographicCRS.class, code = 4230)
     ED50((short) 7022),
 
     /**
@@ -219,7 +213,6 @@ public enum GeodeticObjects {
      *   <tr><th>Ellipsoid axes unit:</th>     <td>{@link SI#METRE}</td></tr>
      * </table></blockquote>
      */
-    @EPSG(type = GeographicCRS.class, code = 4047)
     SPHERE((short) 7048);
 
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java?rev=1534152&r1=1534151&r2=1534152&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
[UTF-8] Mon Oct 21 13:46:10 2013
@@ -18,13 +18,10 @@ package org.apache.sis.referencing.datum
 
 import java.util.Arrays;
 import java.io.Serializable;
-import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.referencing.datum.GeodeticDatum;
-import org.opengis.referencing.operation.OperationMethod;
 import org.opengis.referencing.operation.Matrix;
 import org.apache.sis.referencing.operation.matrix.Matrix4;
 import org.apache.sis.referencing.operation.matrix.Matrices;
-import org.apache.sis.referencing.EPSG;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.util.Immutable;
@@ -167,42 +164,36 @@ public class BursaWolfParameters extends
      * X-axis translation in metres (EPSG:8605).
      * The legacy OGC parameter name is {@code "dx"}.
      */
-    @EPSG(type = ParameterDescriptor.class, code = 8605)
     public final double tX;
 
     /**
      * Y-axis translation in metres (EPSG:8606).
      * The legacy OGC parameter name is {@code "dy"}.
      */
-    @EPSG(type = ParameterDescriptor.class, code = 8606)
     public final double tY;
 
     /**
      * Z-axis translation in metres (EPSG:8607).
      * The legacy OGC parameter name is {@code "dz"}.
      */
-    @EPSG(type = ParameterDescriptor.class, code = 8607)
     public final double tZ;
 
     /**
      * X-axis rotation in arc seconds (EPSG:8608), sign following the <cite>Position
Vector</cite> convention.
      * The legacy OGC parameter name is {@code "ex"}.
      */
-    @EPSG(type = ParameterDescriptor.class, code = 8608)
     public final double rX;
 
     /**
      * Y-axis rotation in arc seconds (EPSG:8609), sign following the <cite>Position
Vector</cite> convention.
      * The legacy OGC parameter name is {@code "ey"}.
      */
-    @EPSG(type = ParameterDescriptor.class, code = 8609)
     public final double rY;
 
     /**
      * Z-axis rotation in arc seconds (EPSG:8610), sign following the <cite>Position
Vector</cite> convention.
      * The legacy OGC parameter name is {@code "ez"}.
      */
-    @EPSG(type = ParameterDescriptor.class, code = 8610)
     public final double rZ;
 
     /**
@@ -213,7 +204,6 @@ public class BursaWolfParameters extends
      *           of 100.001 km in the target coordinate reference system, the scale difference
is 1 ppm
      *           (the ratio being 1.000001).}
      */
-    @EPSG(type = ParameterDescriptor.class, code = 8611)
     public final double dS;
 
     /**
@@ -370,7 +360,6 @@ public class BursaWolfParameters extends
      *
      * @see DefaultGeodeticDatum#getPositionVectorTransformation(GeodeticDatum)
      */
-    @EPSG(type = OperationMethod.class, code = 1033)
     public Matrix getPositionVectorTransformation(final boolean inverse) {
         final double sgn = inverse ? -1 : +1;
         final double   S = 1 + sgn*dS / PPM;

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java?rev=1534152&r1=1534151&r2=1534152&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
[UTF-8] Mon Oct 21 13:46:10 2013
@@ -27,8 +27,6 @@ import org.opengis.referencing.datum.Ell
 import org.opengis.referencing.datum.PrimeMeridian;
 import org.opengis.referencing.datum.GeodeticDatum;
 import org.opengis.referencing.operation.Matrix;
-import org.opengis.referencing.operation.OperationMethod;
-import org.apache.sis.referencing.EPSG;
 import org.apache.sis.referencing.operation.matrix.MatrixSIS;
 import org.apache.sis.internal.util.CollectionsExt;
 import org.apache.sis.util.ComparisonMode;
@@ -253,14 +251,14 @@ public class DefaultGeodeticDatum extend
      * If no transformation path is found, then this method returns {@code null}.
      * If non-null, then the representation is represented as an affine transform.
      *
-     * {@note This is identified as operation method 1033 in the EPSG database.}
+     * {@note This is identified in the EPSG database as operation method 1033 -
+     *        <cite>Position Vector transformation (geocentric domain)</cite>.}
      *
      * @param  targetDatum The target datum.
      * @return An affine transform from {@code this} to {@code target} in geocentric space,
or {@code null} if none.
      *
      * @see BursaWolfParameters#getPositionVectorTransformation(boolean)
      */
-    @EPSG(type = OperationMethod.class, code = 1033)
     public Matrix getPositionVectorTransformation(final GeodeticDatum targetDatum) {
         ensureNonNull("targetDatum", targetDatum);
         return getPositionVectorTransformation(this, targetDatum, null);

Copied: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/package-info.java
(from r1533647, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSG.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/package-info.java?p2=sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/package-info.java&p1=sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSG.java&r1=1533647&r2=1534152&rev=1534152&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSG.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/package-info.java
[UTF-8] Mon Oct 21 13:46:10 2013
@@ -14,27 +14,34 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.referencing;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
 
 /**
- * Documents the relationship between a SIS element and the corresponding EPSG element.
+ * {@linkplain org.apache.sis.referencing.AbstractReferenceSystem Reference system} implementations.
+ * An explanation for this package is provided in the {@linkplain org.opengis.referencing
OpenGISĀ® javadoc}.
+ * The remaining discussion on this page is specific to the SIS implementation.
+ *
+ * <p>This package provides implementations for general positioning, coordinate reference
systems (CRS),
+ * and coordinate transformations. Coordinates can have any number of dimensions. So this
implementation
+ * can handle 2D and 3D coordinates, as well as 4D, 5D, <i>etc.</i></p>
+ *
+ * {@section Fetching geodetic object instances}
+ * Geodetic objects can be instantiated either directly by specifying all information to
a factory method
+ * or constructor, or indirectly by specifying the identifier of an entry in a database.
In particular,
+ * the <a href="http://www.epsg.org">EPSG</a> database provides definitions for
many geodetic objects,
+ * and Apache SIS provides convenience shortcuts for some of them in the
+ * {@link org.apache.sis.referencing.GeodeticObjects} enumerations.
+ *
+ * {@section The EPSG database}
  * The EPSG geodetic parameter dataset is a structured database required to:
  *
  * <ul>
- *   <li>define {@linkplain org.opengis.referencing.crs.CoordinateReferenceSystem Coordinate
Reference Systems} (CRS)
- *       such that coordinates describe positions unambiguously;</li>
+ *   <li>define {@linkplain org.opengis.referencing.crs.CoordinateReferenceSystem Coordinate
Reference Systems}
+ *       (CRS) such that coordinates describe positions unambiguously;</li>
  *   <li>define {@linkplain org.opengis.referencing.operation.CoordinateOperation Coordinate
Operations}
  *       that allow coordinates to be changed from one CRS to another CRS.</li>
  * </ul>
  *
- * This {@code EPSG} annotation is associated to various elements defined by SIS in Java,
including:
+ * Various programmatic elements in Apache SIS have a relationship with EPSG entries, including:
  *
  * <ul>
  *   <li>classes or methods implementing a specific coordinate operation method;</li>
@@ -42,51 +49,24 @@ import java.lang.annotation.Target;
  *   <li>fields containing parameter values.</li>
  * </ul>
  *
- * This annotation has two members: the GeoAPI {@linkplain #type() type} and the EPSG {@linkplain
#code() code}.
+ * Relationship with EPSG has two components documented in the javadoc: the object type and
the EPSG code.
  * The <var>type</var> specifies which {@link org.opengis.referencing.AuthorityFactory}
method to invoke, while
- * the <var>code</var> specifies the argument value to give to that method in
order to get the EPSG object. For
- * example the {@link GeodeticObjects#WGS84} enumeration constants has the following annotation:
+ * the <var>code</var> specifies the argument value to give to that method in
order to get the EPSG object.
+ * For example the {@link org.apache.sis.referencing.GeodeticObjects#WGS84} documentation
said that object
+ * of type <cite>geodetic datum</cite> is associated to code {@code EPSG:6326}.
+ * This means that the EPSG object could be obtained by the following code:
  *
  * {@preformat java
- *   &#64;EPSG(type = GeographicCRS.class, code = 4326)
- * }
- *
- * which means that the annotated constant is related to an EPSG object that could be obtained
by the following
- * code, where {@code factory} is an instance of {@link org.opengis.referencing.crs.CRSAuthorityFactory}:
- *
- * {@preformat java
- *   GeographicCRS crs = factory.createGeographicCRS("4326");
+ *   DatumAuthorityFactory factory = ...; // TODO: document how to obtain an EPSG factory.
+ *   GeodeticDatum datum = factory.createGeodeticDatum("6326");
  * }
  *
  * The EPSG objects can also be inspected online on the <a href="http://www.epsg-registry.org/">EPSG
registry</a> web site.
  *
- * @author  Martin Desruisseaux (Geomatys)
- * @since   0.4
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @author  Guilhem Legal (Geomatys)
+ * @since   0.4 (derived from geotk-2.0)
  * @version 0.4
  * @module
- *
- * @see org.apache.sis.metadata.iso.citation.Citations#EPSG
- * @see org.apache.sis.io.wkt.Convention#EPSG
- * @see <a href="http://www.epsg.org">EPSG Geodetic Parameters</a>
  */
-@Documented
-@Retention(RetentionPolicy.SOURCE)
-@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
-public @interface EPSG {
-    /**
-     * The type returned by the {@link org.opengis.referencing.AuthorityFactory} method
-     * which create the EPSG object. There is a one-to-one relationship between this type
-     * and the table to query in the EPSG database.
-     *
-     * @return The type of the object identified by the EPSG code.
-     */
-    Class<?> type();
-
-    /**
-     * The argument to give to the method identified by {@link #type()} in order to create
the EPSG object.
-     * Those codes are used as primary keys in the EPSG database.
-     *
-     * @return The code of the EPSG object.
-     */
-    int code();
-}
+package org.apache.sis.referencing;

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java?rev=1534152&r1=1534151&r2=1534152&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
[UTF-8] Mon Oct 21 13:46:10 2013
@@ -16,11 +16,8 @@
  */
 package org.apache.sis.referencing.datum;
 
-import org.opengis.referencing.operation.OperationMethod;
-import org.opengis.referencing.operation.Transformation;
 import org.apache.sis.referencing.operation.matrix.MatrixSIS;
 import org.apache.sis.referencing.operation.matrix.Matrices;
-import org.apache.sis.referencing.EPSG;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
@@ -42,7 +39,6 @@ public final strictfp class BursaWolfPar
      * as documented in the example section of EPSG operation method 9606.
      */
     @Test
-    @EPSG(type = OperationMethod.class, code = 9606)
     public void testGetPositionVectorTransformation() {
         final BursaWolfParameters bursaWolf = new BursaWolfParameters(0, 0, 4.5, 0, 0, 0.554,
0.219, null);
         final MatrixSIS toWGS84 = MatrixSIS.castOrCopy(bursaWolf.getPositionVectorTransformation(false));
@@ -57,7 +53,6 @@ public final strictfp class BursaWolfPar
      * Tests serialization of <cite>ED87 to WGS 84</cite> parameters (EPSG:1146).
      */
     @Test
-    @EPSG(type = Transformation.class, code = 1146)
     public void testToString() {
         final BursaWolfParameters bursaWolf = new BursaWolfParameters(
                 -82.981, -99.719, -110.709, -0.5076, 0.1503, 0.3898, -0.3143, null);



Mime
View raw message