sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1627730 - in /sis/branches/JDK8/core: sis-referencing/src/main/java/org/apache/sis/internal/referencing/ sis-utility/src/main/java/org/apache/sis/util/resources/
Date Fri, 26 Sep 2014 09:19:25 GMT
Author: desruisseaux
Date: Fri Sep 26 09:19:24 2014
New Revision: 1627730

URL: http://svn.apache.org/r1627730
Log:
Added PositionalAccuracy constants to be needed later by the referencing module.
Adding them now in SIS allows us to start preparing the Geotk code for migration.

Added:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
  (with props)
Modified:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties

Added: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java?rev=1627730&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
[UTF-8] Fri Sep 26 09:19:24 2014
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.referencing;
+
+import java.util.Collections;
+import java.io.ObjectStreamException;
+import javax.xml.bind.annotation.XmlTransient;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.quality.PositionalAccuracy;
+import org.opengis.metadata.quality.EvaluationMethodType;
+import org.apache.sis.metadata.iso.citation.Citations;
+import org.apache.sis.metadata.iso.quality.DefaultConformanceResult;
+import org.apache.sis.metadata.iso.quality.DefaultAbsoluteExternalPositionalAccuracy;
+import org.apache.sis.util.resources.Vocabulary;
+import org.apache.sis.util.resources.Messages;
+
+
+/**
+ * Pre-defined positional accuracy resulting from some coordinate operations.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.5 (derived from geotk-3.00)
+ * @version 0.5
+ * @module
+ *
+ * @see org.opengis.referencing.operation.Transformation#getCoordinateOperationAccuracy()
+ */
+@XmlTransient
+public final class PositionalAccuracyConstant extends DefaultAbsoluteExternalPositionalAccuracy
{
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = -2554090935254116470L;
+
+    /**
+     * Indicates that a {@linkplain org.opengis.referencing.operation.Transformation transformation}
+     * requires a datum shift and some method has been applied. Datum shift methods often
use
+     * {@linkplain org.apache.sis.referencing.datum.BursaWolfParameters Bursa Wolf parameters},
+     * but other kind of method may have been applied as well.
+     */
+    public static final PositionalAccuracy DATUM_SHIFT_APPLIED;
+
+    /**
+     * Indicates that a {@linkplain org.opengis.referencing.operation.Transformation transformation}
+     * requires a datum shift, but no method has been found applicable. This usually means
that no
+     * {@linkplain org.apache.sis.referencing.datum.BursaWolfParameters Bursa Wolf parameters}
have
+     * been found. Such datum shifts are approximative and may have 1 kilometer error.
+     */
+    public static final PositionalAccuracy DATUM_SHIFT_OMITTED;
+    static {
+        final InternationalString desc = Vocabulary.formatInternational(Vocabulary.Keys.TransformationAccuracy);
+        final InternationalString eval = Messages  .formatInternational(Messages.Keys.ConformanceMeansDatumShift);
+        DATUM_SHIFT_APPLIED = new PositionalAccuracyConstant(desc, eval, true);
+        DATUM_SHIFT_OMITTED = new PositionalAccuracyConstant(desc, eval, false);
+    }
+
+    /**
+     * Creates an positional accuracy initialized to the given result.
+     */
+    private PositionalAccuracyConstant(final InternationalString measureDescription,
+            final InternationalString evaluationMethodDescription, final boolean pass)
+    {
+        DefaultConformanceResult result = new DefaultConformanceResult(Citations.SIS, evaluationMethodDescription,
pass);
+        result.freeze();
+        setResults(Collections.singleton(result));
+        setMeasureDescription(measureDescription);
+        setEvaluationMethodDescription(evaluationMethodDescription);
+        setEvaluationMethodType(EvaluationMethodType.DIRECT_INTERNAL);
+        freeze();
+    }
+
+    /**
+     * Invoked on deserialization. Replace this instance by one of the constants, if applicable.
+     */
+    private Object readResolve() throws ObjectStreamException {
+        if (equals(DATUM_SHIFT_APPLIED)) return DATUM_SHIFT_APPLIED;
+        if (equals(DATUM_SHIFT_OMITTED)) return DATUM_SHIFT_OMITTED;
+        return this;
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java?rev=1627730&r1=1627729&r2=1627730&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
[UTF-8] Fri Sep 26 09:19:24 2014
@@ -65,6 +65,11 @@ public final class Messages extends Inde
         public static final short ChangedContainerCapacity_2 = 1;
 
         /**
+         * This result indicates if a datum shift method has been applied.
+         */
+        public static final short ConformanceMeansDatumShift = 8;
+
+        /**
          * Property “{0}” has been discarded in favor of “{1}”, because those two
properties are
          * mutually exclusive.
          */

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties?rev=1627730&r1=1627729&r2=1627730&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
[ISO-8859-1] Fri Sep 26 09:19:24 2014
@@ -16,6 +16,7 @@
 #
 AlreadyRegistered_2             = {0} \u201c{1}\u201d is already registered. The second instance
will be ignored.
 ChangedContainerCapacity_2      = Changed the container capacity from {0} to {1} elements.
+ConformanceMeansDatumShift      = This result indicates if a datum shift method has been
applied.
 DiscardedExclusiveProperty_2    = Property \u201c{0}\u201d has been discarded in favor of
\u201c{1}\u201d, because those two properties are mutually exclusive.
 IgnoredPropertiesAfterFirst_1   = Ignored properties after the first occurrence of \u2018{0}\u2019.
 IgnoredPropertyAssociatedTo_1   = Ignored property associated to \u2018{0}\u2019.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties?rev=1627730&r1=1627729&r2=1627730&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
[ISO-8859-1] Fri Sep 26 09:19:24 2014
@@ -16,6 +16,7 @@
 #
 AlreadyRegistered_2             = Le {0} \u00ab\u202f{1}\u202f\u00bb est d\u00e9j\u00e0 inscrit
dans le registre. La seconde instance sera ignor\u00e9e.
 ChangedContainerCapacity_2      = Changement de la capacit\u00e9 du conteneur de {0} vers
{1} \u00e9l\u00e9ments.
+ConformanceMeansDatumShift      = Ce r\u00e9sultat indique si un changement de r\u00e9f\u00e9rentiel
a \u00e9t\u00e9 appliqu\u00e9.
 DiscardedExclusiveProperty_2    = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb a \u00e9t\u00e9
\u00e9cart\u00e9e en faveur de \u00ab\u202f{1}\u202f\u00bb, parce que ces deux propri\u00e9t\u00e9s
sont mutuellement exclusives.
 IgnoredPropertiesAfterFirst_1   = Des propri\u00e9t\u00e9s ont \u00e9t\u00e9 ignor\u00e9es
apr\u00e8s la premi\u00e8re occurrence de \u2018{0}\u2019.
 IgnoredPropertyAssociatedTo_1   = Une propri\u00e9t\u00e9 associ\u00e9e \u00e0 \u2018{0}\u2019
a \u00e9t\u00e9 ignor\u00e9e.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1627730&r1=1627729&r2=1627730&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] Fri Sep 26 09:19:24 2014
@@ -385,6 +385,16 @@ public final class Vocabulary extends In
         public static final short Timezone = 54;
 
         /**
+         * Transformation
+         */
+        public static final short Transformation = 80;
+
+        /**
+         * Transformation accuracy
+         */
+        public static final short TransformationAccuracy = 81;
+
+        /**
          * Truncated Julian
          */
         public static final short TruncatedJulian = 55;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties?rev=1627730&r1=1627729&r2=1627730&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
[ISO-8859-1] Fri Sep 26 09:19:24 2014
@@ -80,6 +80,8 @@ Temporal                = Temporal
 Time                    = Time
 Time_1                  = {0} time
 Timezone                = Timezone
+Transformation          = Transformation
+TransformationAccuracy  = Transformation accuracy
 TruncatedJulian         = Truncated Julian
 Type                    = Type
 Unnamed                 = Unnamed

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1627730&r1=1627729&r2=1627730&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] Fri Sep 26 09:19:24 2014
@@ -80,6 +80,8 @@ Temporal                = Temporel
 Time                    = Temps
 Time_1                  = Heure {0}
 Timezone                = Fuseau horaire
+Transformation          = Transformation
+TransformationAccuracy  = Pr\u00e9cision de la transformation
 TruncatedJulian         = Julien tronqu\u00e9
 Type                    = Type
 Unnamed                 = Sans nom



Mime
View raw message