sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1649757 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/cs/ test/java/org/apache/sis/referencing/ test/java/org/apache/sis/referencing/crs/ test/java/org/apache/sis/referencing/datum/ test/java/org/ap...
Date Tue, 06 Jan 2015 09:21:24 GMT
Author: desruisseaux
Date: Tue Jan  6 09:21:23 2015
New Revision: 1649757

URL: http://svn.apache.org/r1649757
Log:
Documentation update and added tests for the Paris prime meridian.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/mock/GeodeticDatumMock.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/mock/PrimeMeridianMock.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java?rev=1649757&r1=1649756&r2=1649757&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
[UTF-8] Tue Jan  6 09:21:23 2015
@@ -124,12 +124,18 @@ public enum AxesConvention {
      * </ul>
      *
      * Current implementation does not normalize longitude values to the [-180 … +180]°
range and does not set
-     * the {@linkplain org.apache.sis.referencing.datum.DefaultGeodeticDatum#getPrimeMeridian()
prime meridian} to
-     * Greenwich, because doing so would cause the conversion between old and new coordinate
systems to be non-affine.
-     * Furthermore changing the prime meridian would be a datum change rather than a coordinate
system change.
-     * However those rules may be adjusted in future SIS versions based on experience gained.
+     * the {@linkplain org.apache.sis.referencing.datum.DefaultGeodeticDatum#getPrimeMeridian()
prime meridian}
+     * to Greenwich. However those rules may be adjusted in future SIS versions based on
experience gained.
      * For more predictable results, consider using {@link #CONVENTIONALLY_ORIENTED} or {@link
#RIGHT_HANDED} instead.
      *
+     * <div class="note"><b>Rational:</b>
+     * The reason why we do not yet normalize the range and the prime meridian is because
doing so
+     * would cause the conversion between old and new coordinate systems to be non-affine
for axes
+     * having {@link org.opengis.referencing.cs.RangeMeaning#WRAPAROUND}. Furthermore changing
the
+     * prime meridian would be a datum change rather than a coordinate system change, and
datum
+     * changes are more difficult to handle by coordinate operation factories.
+     * </div>
+     *
      * @see org.apache.sis.referencing.CommonCRS#normalizedGeographic()
      */
     NORMALIZED,
@@ -214,19 +220,24 @@ public enum AxesConvention {
 
     /**
      * Axes having a <cite>wraparound</cite>
-     * {@linkplain org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis#getRangeMeaning()
range meaning}
-     * are shifted to their ranges of positive values. The units of measurement and range
period are unchanged.
+     * {@linkplain org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis#getRangeMeaning()
range meaning} are
+     * shifted to their ranges of positive values. The units of measurement and range period
(difference between
+     * {@linkplain org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis#getMaximumValue()
maximum} and
+     * {@linkplain org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis#getMinimumValue()
minimum value})
+     * are unchanged.
+     *
+     * <p>Note that projecting geometry objects from the old to the new coordinate
system may require
+     * a non-affine conversion. Some geometries may need to be separated in two parts, and
others may
+     * need to be merged.</p>
      *
      * {@section Usage}
      * The most frequent usage of this enum is for shifting longitude values from the [-180
… +180]° range
      * to the [0 … 360]° range. However this enum could also be used with climatological
calendars if their
      * time axis has a wrapround range meaning.
      *
-     * <p><b>Caution:</b>
-     * Conversions between the original Coordinate System and new CS compliant to this {@code
POSITIVE_RANGE}
-     * may not be affine. For example if an image was spanning the [0 … 360]° range of
longitude values, then
-     * a change to the [-180 … +180]° range requires cutting the right side (the side
spanning the [180 … 360]°
-     * range of longitude values) and pasting it on the left side of the image (in the [-180
… 0]° range).</p>
+     * <p>Note that conversions from an coordinate system using the [-180 … +180]°
range to a coordinate system
+     * using the [0 … 360]° range may not be affine. For example the data in the West
hemisphere ([-180 … 0]°)
+     * may need to move on the right side of the East hemisphere ([180 … 360]°).</p>
      *
      * @see org.opengis.referencing.cs.RangeMeaning#WRAPAROUND
      */

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java?rev=1649757&r1=1649756&r2=1649757&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
[UTF-8] Tue Jan  6 09:21:23 2015
@@ -236,6 +236,7 @@ public final strictfp class CRSTest exte
      */
     @Test
     public void testGetGreenwichLongitude() {
-        assertEquals(0, CRS.getGreenwichLongitude(HardCodedCRS.WGS84), STRICT);
+        assertEquals(0,          CRS.getGreenwichLongitude(HardCodedCRS.WGS84), STRICT);
+        assertEquals(2.33722917, CRS.getGreenwichLongitude(HardCodedCRS.NTF),   1E-12);
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java?rev=1649757&r1=1649756&r2=1649757&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
[UTF-8] Tue Jan  6 09:21:23 2015
@@ -33,7 +33,7 @@ import static org.apache.sis.referencing
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final strictfp class HardCodedCRS {
@@ -73,6 +73,22 @@ public final strictfp class HardCodedCRS
             properties("WGS 84 (3D)"), HardCodedDatum.WGS84, HardCodedCS.GEODETIC_3D);
 
     /**
+     * A two-dimensional geographic coordinate reference system using the Paris prime meridian.
+     * This CRS uses (<var>longitude</var>, <var>latitude</var>)
ordinates with longitude values
+     * increasing towards the East and latitude values increasing towards the North.
+     * The angular units are decimal degrees except for the prime meridian (Paris),
+     * which is measured in grades.
+     *
+     * <p>This CRS is equivalent to {@code EPSG:4807} except for axis order and units
of measurement,
+     * since EPSG defines (<var>latitude</var>, <var>longitude</var>)
in grades. The main purpose of
+     * this CRS is to test operations between CRS having different prime meridian.</p>
+     *
+     * @since 0.5
+     */
+    public static final DefaultGeographicCRS NTF = new DefaultGeographicCRS(
+            properties("NTF (Paris)"), HardCodedDatum.NTF, HardCodedCS.GEODETIC_2D);
+
+    /**
      * A two-dimensional geographic coordinate reference system using a spherical datum.
      * This CRS uses (<var>longitude</var>, <var>latitude</var>)
ordinates with longitude values
      * increasing towards the East and latitude values increasing towards the North.

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java?rev=1649757&r1=1649756&r2=1649757&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
[UTF-8] Tue Jan  6 09:21:23 2015
@@ -47,6 +47,8 @@ public final strictfp class HardCodedDat
 
     /**
      * Paris meridian (EPSG:8903), with angular measurements in grad.
+     *
+     * @since 0.5
      */
     public static final DefaultPrimeMeridian PARIS = new DefaultPrimeMeridian(
             properties("Paris", "8903"), 2.5969213, NonSI.GRADE);
@@ -54,6 +56,11 @@ public final strictfp class HardCodedDat
     /**
      * Old Paris meridian (EPSG:8914) defined as 2°20'13.95"E.
      * Equivalent to 2.596898 grad (value given by EPSG).
+     *
+     * <p>When used together with {@link #PARIS}, this prime meridian is useful for
testing
+     * two real-world prime meridians that are very close together but still different.</p>
+     *
+     * @since 0.5
      */
     public static final DefaultPrimeMeridian PARIS_RGS = new DefaultPrimeMeridian(
             properties("Paris RGS", "8914"), 2 + (20 + 13.95/60)/60, NonSI.DEGREE_ANGLE);
@@ -77,6 +84,15 @@ public final strictfp class HardCodedDat
             new DefaultEllipsoid(GeodeticDatumMock.WGS84.getEllipsoid()), GREENWICH);
 
     /**
+     * Nouvelle Triangulation Française datum (EPSG:6807). Prime meridian is Paris.
+     *
+     * @since 0.5
+     */
+    public static final DefaultGeodeticDatum NTF = new DefaultGeodeticDatum(
+            properties("Nouvelle Triangulation Française", "6807"),
+            new DefaultEllipsoid(GeodeticDatumMock.NTF.getEllipsoid()), PARIS);
+
+    /**
      * Spherical datum based on GRS 1980 Authalic Sphere (EPSG:6047). Prime meridian is Greenwich.
      */
     public static final DefaultGeodeticDatum SPHERE = new DefaultGeodeticDatum(

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/mock/GeodeticDatumMock.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/mock/GeodeticDatumMock.java?rev=1649757&r1=1649756&r2=1649757&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/mock/GeodeticDatumMock.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/mock/GeodeticDatumMock.java
[UTF-8] Tue Jan  6 09:21:23 2015
@@ -32,7 +32,7 @@ import org.opengis.referencing.datum.Pri
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.5
  * @module
  */
 @SuppressWarnings("serial")
@@ -58,6 +58,15 @@ public final strictfp class GeodeticDatu
     public static final GeodeticDatum NAD27 = new GeodeticDatumMock("NAD27", 6378206.4, 6356583.8,
294.97869821390583, false);
 
     /**
+     * The "Nouvelle Triangulation Française" (EPSG:6807) datum with "Clarke 1880 (IGN)"
ellipsoid.
+     * This is the same datum than "Nouvelle Triangulation Française (Paris)" (EPSG:6275)
except
+     * for the prime meridian, which is Greenwich instead of Paris.
+     *
+     * @since 0.5
+     */
+    public static final GeodeticDatum NTF = new GeodeticDatumMock("NTF", 6378249.2, 6356515,
293.4660212936269, false);
+
+    /**
      * The sphere based on the GRS 1980 Authalic sphere.
      */
     public static final GeodeticDatum SPHERE = new GeodeticDatumMock("SPHERE", 6371007, 6371007,
Double.POSITIVE_INFINITY, false);

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/mock/PrimeMeridianMock.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/mock/PrimeMeridianMock.java?rev=1649757&r1=1649756&r2=1649757&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/mock/PrimeMeridianMock.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/mock/PrimeMeridianMock.java
[UTF-8] Tue Jan  6 09:21:23 2015
@@ -19,7 +19,6 @@ package org.apache.sis.test.mock;
 import javax.measure.unit.Unit;
 import javax.measure.unit.NonSI;
 import javax.measure.quantity.Angle;
-import org.apache.sis.test.mock.IdentifiedObjectMock;
 import org.opengis.referencing.datum.PrimeMeridian;
 
 



Mime
View raw message