sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1649320 - in /sis/branches/JDK8/core: sis-referencing/src/main/java/org/apache/sis/referencing/datum/ sis-utility/src/main/java/org/apache/sis/util/resources/
Date Sun, 04 Jan 2015 12:19:16 GMT
Author: desruisseaux
Date: Sun Jan  4 12:19:15 2015
New Revision: 1649320

URL: http://svn.apache.org/r1649320
Log:
Clarify that Bursa-Wolf parameters shall be between two Geodetic Datum having the same Prime
Meridian.
This commit contains also some error messages to be used in a later commit.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java?rev=1649320&r1=1649319&r2=1649320&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
[UTF-8] Sun Jan  4 12:19:15 2015
@@ -41,13 +41,13 @@ import java.util.Objects;
 
 
 /**
- * Parameters for a geographic transformation between two datum.
+ * Parameters for a geographic transformation between two datum having the same prime meridian.
  * Bursa-Wolf parameters are also known as <cite>Helmert transformation parameters</cite>.
  * For an explanation of their purpose, see the <cite>Bursa-Wolf parameters</cite>
section
  * of {@link DefaultGeodeticDatum} class javadoc.
  *
  * <p>The Bursa-Wolf parameters shall be applied to geocentric coordinates,
- * where the <var>X</var> axis points towards the Greenwich Prime Meridian,
+ * where the <var>X</var> axis points towards the Prime Meridian (usually Greenwich),
  * the <var>Y</var> axis points East, and the <var>Z</var> axis points
North.</p>
  *
  * <div class="note"><b>Note:</b>

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java?rev=1649320&r1=1649319&r2=1649320&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
[UTF-8] Sun Jan  4 12:19:15 2015
@@ -35,11 +35,13 @@ import org.apache.sis.referencing.operat
 import org.apache.sis.metadata.iso.extent.Extents;
 import org.apache.sis.internal.referencing.ExtentSelector;
 import org.apache.sis.internal.util.CollectionsExt;
+import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.io.wkt.Formatter;
 
 import static org.apache.sis.util.Utilities.deepEquals;
+import static org.apache.sis.util.Utilities.equalsIgnoreMetadata;
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 import static org.apache.sis.util.ArgumentChecks.ensureNonNullElement;
 import static org.apache.sis.internal.referencing.WKTUtilities.toFormattable;
@@ -111,7 +113,7 @@ import java.util.Objects;
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4 (derived from geotk-1.2)
- * @version 0.4
+ * @version 0.5
  * @module
  *
  * @see DefaultEllipsoid
@@ -231,6 +233,10 @@ public class DefaultGeodeticDatum extend
      *   </tr>
      * </table>
      *
+     * If the given {@code properties} map contains Bursa-Wolf parameters, then for all of
them the
+     * {@linkplain BursaWolfParameters#getTargetDatum() target datum} prime meridian shall
be equal
+     * (ignoring metadata) to the {@code primeMeridian} parameter given to this constructor.
+     *
      * @param properties    The properties to be given to the identified object.
      * @param ellipsoid     The ellipsoid.
      * @param primeMeridian The prime meridian.
@@ -252,6 +258,11 @@ public class DefaultGeodeticDatum extend
                 ensureNonNullElement("bursaWolf", i, param);
                 param = param.clone();
                 param.verify();
+                final GeodeticDatum targetDatum = param.getTargetDatum();
+                if (targetDatum != null && !equalsIgnoreMetadata(primeMeridian, targetDatum.getPrimeMeridian()))
{
+                    throw new IllegalArgumentException(Errors.format(
+                            Errors.Keys.MismatchedPrimeMeridianInBWP_1, primeMeridian.getName()));
+                }
                 bursaWolf[i] = param;
             }
         }
@@ -331,6 +342,10 @@ public class DefaultGeodeticDatum extend
      * Returns all Bursa-Wolf parameters specified in the {@code properties} map at construction
time.
      * For a discussion about what Bursa-Wolf parameters are, see the class javadoc.
      *
+     * <p><b>Invariant:</b> for all Bursa-Wolf parameters, the {@linkplain
BursaWolfParameters#getTargetDatum()
+     * target datum} prime meridian is equals (ignoring metadata) to this datum {@linkplain
#getPrimeMeridian()
+     * prime meridian}.</p>
+     *
      * @return The Bursa-Wolf parameters, or an empty array if none.
      */
     public BursaWolfParameters[] getBursaWolfParameters() {

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1649320&r1=1649319&r2=1649320&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] Sun Jan  4 12:19:15 2015
@@ -151,6 +151,11 @@ public final class Errors extends Indexe
         public static final short CanNotSetPropertyValue_1 = 11;
 
         /**
+         * Can not transform envelope to a geodetic CRS.
+         */
+        public static final short CanNotTransformEnvelopeToGeodetic = 174;
+
+        /**
          * Circular reference.
          */
         public static final short CircularReference = 52;
@@ -464,6 +469,11 @@ public final class Errors extends Indexe
         public static final short MismatchedParameterDescriptor_1 = 146;
 
         /**
+         * Bursa-Wolf parameters shall target a datum having the “{0}” prime meridian.
+         */
+        public static final short MismatchedPrimeMeridianInBWP_1 = 175;
+
+        /**
          * Mismatched type for “{0}” property.
          */
         public static final short MismatchedPropertyType_1 = 154;
@@ -479,6 +489,11 @@ public final class Errors extends Indexe
         public static final short MissingAuthority_1 = 135;
 
         /**
+         * No horizontal dimension found in “{0}”.
+         */
+        public static final short MissingHorizontalDimension_1 = 169;
+
+        /**
          * “{0}” has no namespace.
          */
         public static final short MissingNamespace_1 = 163;
@@ -494,6 +509,16 @@ public final class Errors extends Indexe
         public static final short MissingSchemeInURI = 62;
 
         /**
+         * No spatial or temporal dimension found in “{0}”
+         */
+        public static final short MissingSpatioTemporalDimension_1 = 170;
+
+        /**
+         * No temporal dimension found in “{0}”
+         */
+        public static final short MissingTemporalDimension_1 = 171;
+
+        /**
          * Missing value for “{0}” option.
          */
         public static final short MissingValueForOption_1 = 63;
@@ -514,6 +539,11 @@ public final class Errors extends Indexe
         public static final short MissingValueInColumn_1 = 65;
 
         /**
+         * No vertical dimension found in “{0}”
+         */
+        public static final short MissingVerticalDimension_1 = 172;
+
+        /**
          * Options “{0}” and “{1}” are mutually exclusive.
          */
         public static final short MutuallyExclusiveOptions_2 = 66;
@@ -874,6 +904,11 @@ public final class Errors extends Indexe
         public static final short UnresolvedFeatureName_1 = 164;
 
         /**
+         * Coordinate reference system is unspecified.
+         */
+        public static final short UnspecifiedCRS = 173;
+
+        /**
          * No format is specified for objects of class ‘{0}’.
          */
         public static final short UnspecifiedFormatForClass_1 = 126;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1649320&r1=1649319&r2=1649320&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] Sun Jan  4 12:19:15 2015
@@ -41,6 +41,7 @@ CanNotParseFile_2                 = Can
 CanNotRead_1                      = Can not read \u201c{0}\u201d.
 CanNotRepresentInFormat_2         = Can not represent \u201c{1}\u201d in the {0} format.
 CanNotSetPropertyValue_1          = Can not set a value for property \u201c{0}\u201d.
+CanNotTransformEnvelopeToGeodetic = Can not transform envelope to a geodetic CRS.
 CircularReference                 = Circular reference.
 ClassNotFinal_1                   = Class \u2018{0}\u2019 is not final.
 CloneNotSupported_1               = Can not clone an object of type \u2018{0}\u2019.
@@ -103,6 +104,7 @@ MismatchedDimension_2             = Mism
 MismatchedDimension_3             = Argument \u2018{0}\u2019 has {2} dimension{2,choice,1#|2#s},
while {1} was expected.
 MismatchedMatrixSize_4            = Mismatched matrix sizes: expected {0}\u00d7{1} but got
{2}\u00d7{3}.
 MismatchedParameterDescriptor_1   = Mismatched descriptor for \u201c{0}\u201d parameter.
+MismatchedPrimeMeridianInBWP_1    = Bursa-Wolf parameters shall target a datum having the
\u201c{0}\u201d prime meridian.
 MismatchedPropertyType_1          = Mismatched type for \u201c{0}\u201d property.
 MismatchedValueClass_3            = Class of \u201c{0}\u201d values is \u2018{2}\u2019, but
the requested type is \u2018{1}\u2019.
 MissingAuthority_1                = No authority was specified for code \u201c{0}\u201d.
The expected syntax is \u201cAUTHORITY:CODE\u201d.
@@ -113,6 +115,10 @@ MissingValueForOption_1           = Miss
 MissingValueForParameter_1        = Missing value for \u201c{0}\u201d parameter.
 MissingValueForProperty_1         = Missing value for \u201c{0}\u201d property.
 MissingValueInColumn_1            = Missing value in the \u201c{0}\u201d column.
+MissingHorizontalDimension_1      = No horizontal dimension found in \u201c{0}\u201d.
+MissingVerticalDimension_1        = No vertical dimension found in \u201c{0}\u201d
+MissingTemporalDimension_1        = No temporal dimension found in \u201c{0}\u201d
+MissingSpatioTemporalDimension_1  = No spatial or temporal dimension found in \u201c{0}\u201d
 MutuallyExclusiveOptions_2        = Options \u201c{0}\u201d and \u201c{1}\u201d are mutually
exclusive.
 NegativeArgument_2                = Argument \u2018{0}\u2019 shall not be negative. The given
value was {1}.
 NegativeArrayLength_1             = Can not create a \u201c{0}\u201d array of negative length.
@@ -186,6 +192,7 @@ UnmodifiableObject_1              = Obje
 UnparsableStringForClass_2        = Text \u201c{1}\u201d can not be parsed as an object of
type \u2018{0}\u2019.
 UnparsableStringForClass_3        = Text \u201c{1}\u201d can not be parsed as an object of
type \u2018{0}\u2019, because of the \u201c{2}\u201d characters.
 UnresolvedFeatureName_1           = Feature named \u201c{0}\u201d has not yet been resolved.
+UnspecifiedCRS                    = Coordinate reference system is unspecified.
 UnspecifiedFormatForClass_1       = No format is specified for objects of class \u2018{0}\u2019.
 UnsupportedImplementation_1       = Can not handle instances of \u2018{0}\u2019 because arbitrary
implementations are not yet supported.
 UnsupportedOperation_1            = The \u2018{0}\u2019 operation is unsupported.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1649320&r1=1649319&r2=1649320&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] Sun Jan  4 12:19:15 2015
@@ -31,6 +31,7 @@ CanNotParseFile_2                 = Ne p
 CanNotRead_1                      = Ne peut pas lire \u00ab\u202f{0}\u202f\u00bb.
 CanNotRepresentInFormat_2         = Ne peut pas repr\u00e9senter \u00ab\u202f{1}\u202f\u00bb
dans le format {0}.
 CanNotSetPropertyValue_1          = Ne peut pas d\u00e9finir une valeur pour la propri\u00e9t\u00e9
\u00ab\u202f{0}\u202f\u00bb.
+CanNotTransformEnvelopeToGeodetic = Ne peut pas transformer l\u2019enveloppe vers un syst\u00e8me
g\u00e9od\u00e9sique.
 CircularReference                 = R\u00e9f\u00e9rence circulaire.
 ClassNotFinal_1                   = La classe \u2018{0}\u2019 n\u2019est pas finale.
 CloneNotSupported_1               = Un objet de type \u2018{0}\u2019 ne peut pas \u00eatre
clon\u00e9.
@@ -93,6 +94,7 @@ MismatchedDimension_2             = Les
 MismatchedDimension_3             = L\u2019argument \u2018{0}\u2019 a {2} dimension{2,choice,1#|2#s},
alors qu\u2019on en attendait {1}.
 MismatchedMatrixSize_4            = Une matrice de taille de {0}\u00d7{1} \u00e9tait attendue
mais la matrice donn\u00e9es est de taille {2}\u00d7{3}.
 MismatchedParameterDescriptor_1   = Le descripteur du param\u00e8tre \u00ab\u202f{0}\u202f\u00bb
ne correspond pas.
+MismatchedPrimeMeridianInBWP_1    = Les param\u00e8tres de Bursa-Wolf doivent avoir un r\u00e9f\u00e9rentiel
de destination ayant le m\u00e9ridien d\u2019origine \u00ab\u202f{0}\u202f\u00bb.
 MismatchedPropertyType_1          = Le type de la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb
ne correspond pas.
 MismatchedValueClass_3            = Les valeurs de \u00ab\u202f{0}\u202f\u00bb sont de la
classe \u2018{2}\u2019, alors que le type demand\u00e9 \u00e9tait \u2018{1}\u2019.
 MissingAuthority_1                = Aucune autorit\u00e9 n\u2019a \u00e9t\u00e9 sp\u00e9cifi\u00e9e
pour le code \u00ab\u202f{0}\u202f\u00bb. Le format attendu est \u00ab\u202fAUTORIT\u00c9:CODE\u202f\u00bb.
@@ -103,6 +105,10 @@ MissingValueForOption_1           = Aucu
 MissingValueForParameter_1        = Aucune valeur n\u2019a \u00e9t\u00e9 d\u00e9finie pour
le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb.
 MissingValueForProperty_1         = Aucune valeur n\u2019a \u00e9t\u00e9 d\u00e9finie pour
la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb.
 MissingValueInColumn_1            = Il manque une valeur dans la colonne \u00ab\u202f{0}\u202f\u00bb.
+MissingHorizontalDimension_1      = Aucune dimension horizontale n\u2019a \u00e9t\u00e9 trouv\u00e9e
dans \u00ab\u202f{0}\u202f\u00bb.
+MissingVerticalDimension_1        = Aucune dimension verticale n\u2019a \u00e9t\u00e9 trouv\u00e9e
dans \u00ab\u202f{0}\u202f\u00bb.
+MissingTemporalDimension_1        = Aucune dimension temporelle n\u2019a \u00e9t\u00e9 trouv\u00e9e
dans \u00ab\u202f{0}\u202f\u00bb.
+MissingSpatioTemporalDimension_1  = Aucune dimension spatiale ou temporelle n\u2019a \u00e9t\u00e9
trouv\u00e9e dans \u00ab\u202f{0}\u202f\u00bb.
 MutuallyExclusiveOptions_2        = Les options \u00ab\u202f{0}\u202f\u00bb et \u00ab\u202f{1}\u202f\u00bb
sont mutuellement exclusives.
 NegativeArgument_2                = L\u2019argument \u2018{0}\u2019 ne doit pas \u00eatre
n\u00e9gatif. La valeur donn\u00e9e \u00e9tait {1}.
 NegativeArrayLength_1             = Ne peut pas cr\u00e9er un tableau \u00ab\u202f{0}\u202f\u00bb
de longueur n\u00e9gative.
@@ -172,6 +178,7 @@ UnmodifiableCellValue_2           = La c
 UnmodifiableGeometry              = Cette g\u00e9om\u00e9trie n\u2019est pas modifiable.
 UnmodifiableMetadata              = Cette m\u00e9ta-donn\u00e9e n\u2019est pas modifiable.
 UnmodifiableObject_1              = L\u2019objet \u2018{0}\u2019 n\u2019est pas modifiable.
+UnspecifiedCRS                    = Le syst\u00e8me de r\u00e9f\u00e9rence des coordonn\u00e9es
n\u2019a pas \u00e9t\u00e9 sp\u00e9cifi\u00e9.
 UnspecifiedFormatForClass_1       = Aucun format n\u2019est sp\u00e9cifi\u00e9 pour les objets
de classe \u2018{0}\u2019.
 UnparsableStringForClass_2        = Le texte \u00ab\u202f{1}\u202f\u00bb n\u2019est pas reconnu
comme un objet de type \u2018{0}\u2019.
 UnparsableStringForClass_3        = Le texte \u00ab\u202f{1}\u202f\u00bb n\u2019est pas reconnu
comme un objet de type \u2018{0}\u2019, \u00e0 cause des caract\u00e8res \u00ab\u202f{2}\u202f\u00bb.



Mime
View raw message