sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1520149 [1/2] - in /sis: branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/ branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/ branches/JDK7/core/sis-referencing/src/main/...
Date Wed, 04 Sep 2013 21:43:24 GMT
Author: desruisseaux
Date: Wed Sep  4 21:43:23 2013
New Revision: 1520149

URL: http://svn.apache.org/r1520149
Log:
Initial port of DefaultEllipsoid

Added:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java   (with props)
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/package-info.java   (with props)
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java   (with props)
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/Spheroid.java   (with props)
    sis/ip-review/DefaultEllipsoid.xhtml   (with props)
    sis/ip-review/Spheroid.xhtml   (with props)
    sis/ip-review/rev/10796/DefaultEllipsoid.xhtml   (with props)
    sis/ip-review/rev/10796/Spheroid.xhtml   (with props)
    sis/ip-review/rev/20874/DefaultEllipsoid.xhtml   (with props)
    sis/ip-review/rev/20874/Spheroid.xhtml   (with props)
    sis/ip-review/rev/26413/
    sis/ip-review/rev/26413/DefaultEllipsoid.xhtml   (with props)
    sis/ip-review/rev/26413/HEADER.html   (with props)
Modified:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
    sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml

Added: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java?rev=1520149&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java (added)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameter.java [UTF-8] Wed Sep  4 21:43:23 2013
@@ -0,0 +1,135 @@
+/*
+ * 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.jaxb.referencing;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.measure.unit.Unit;
+import org.opengis.referencing.datum.Ellipsoid;
+import org.apache.sis.measure.Units;
+import org.apache.sis.xml.Namespaces;
+import org.apache.sis.internal.jaxb.gco.Measure;
+
+
+/**
+ * Stores the second defining parameter of an {@link Ellipsoid}.
+ * The purpose of this class is to allow JAXB to handle a second defining parameter,
+ * according to the kind of ellipsoid we are facing to.
+ *
+ * @author  Cédric Briançon (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.4 (derived from geotk-3.05)
+ * @version 0.4
+ * @module
+ */
+@XmlRootElement(name = "SecondDefiningParameter", namespace = Namespaces.GML)
+public final class SecondDefiningParameter {
+    /**
+     * Nested parameter, for JAXB purpose.
+     */
+    @XmlElement(name = "SecondDefiningParameter")
+    public SecondDefiningParameter secondDefiningParameter;
+
+    /**
+     * The measure, which is either the polar radius or the inverse of the flattening value.
+     * We distinguish those two cases by the unit: if the measure is the inverse flattening,
+     * then the unit must be {@link Unit#ONE}.
+     *
+     * @see Ellipsoid#getSemiMinorAxis()
+     * @see Ellipsoid#getInverseFlattening()
+     */
+    public Measure measure;
+
+    /**
+     * JAXB mandatory empty constructor.
+     */
+    public SecondDefiningParameter() {
+    }
+
+    /**
+     * Stores the semi-minor axis or the inverse of the flattening value.
+     *
+     * @param ellipsoid The ellipsoid from which to get the semi-minor or inverse flattening value.
+     * @param nested {@code true} if the element should be nested in an other XML type.
+     */
+    public SecondDefiningParameter(final Ellipsoid ellipsoid, final boolean nested) {
+        if (nested) {
+            secondDefiningParameter = new SecondDefiningParameter(ellipsoid, false);
+        } else {
+            if (ellipsoid.isIvfDefinitive()) {
+                measure = new Measure(ellipsoid.getInverseFlattening(), Unit.ONE);
+            } else {
+                measure = new Measure(ellipsoid.getSemiMinorAxis(), ellipsoid.getAxisUnit());
+                Units.ensureLinear(measure.unit);
+            }
+        }
+    }
+
+    /**
+     * Returns {@code true} if the measure is the inverse of the flattening value.
+     *
+     * @return {@code true} if the measure is the inverse of the flattening value.
+     */
+    public boolean isIvfDefinitive() {
+        return (measure != null) && Unit.ONE.equals(measure.unit);
+    }
+
+    /**
+     * Returns the semi-minor axis value as a measurement.
+     *
+     * @return The measure of the semi-minor axis.
+     */
+    @XmlElement(name = "semiMinorAxis")
+    public Measure getSemiMinorAxis() {
+        return isIvfDefinitive() ? null : measure;
+    }
+
+    /**
+     * Sets the semi-minor axis value. This is invoked by JAXB for unmarshalling.
+     *
+     * @param measure The semi-minor axis value.
+     */
+    public void setSemiMinorAxis(final Measure measure) {
+        this.measure = measure;
+        Units.ensureLinear(measure.unit);
+    }
+
+    /**
+     * Returns the inverse of the flattening value as a measurement.
+     * Note: The unit of this measurement is dimensionless.
+     *
+     * @return The inverse of the flattening value as a measurement.
+     */
+    @XmlElement(name = "inverseFlattening")
+    public Measure getInverseFlattening() {
+        return isIvfDefinitive() ? measure : null;
+    }
+
+    /**
+     * Sets the inverse of the flattening value. This is invoked by JAXB for unmarshalling.
+     *
+     * <p>Note that some GML wrongly assign the "m" unit to this measure, which is wrong.
+     * This method overwrite the unit with a dimensionless one. This is required anyway
+     * in order to distinguish between the two cases.</p>
+     *
+     * @param measure The inverse flattening value.
+     */
+    public void setInverseFlattening(final Measure measure) {
+        measure.setUnit(Unit.ONE);
+        this.measure = measure;
+    }
+}

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

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

Added: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/package-info.java?rev=1520149&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/package-info.java (added)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/package-info.java [UTF-8] Wed Sep  4 21:43:23 2013
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+/**
+ * JAXB adapters for referencing.
+ * This package regroups all adapters mapping GeoAPI interfaces to their SIS implementation.
+ * We must use adapters since JAXB can not annotate interfaces. Every time JAXB tries to
+ * marshall or unmarshall an interface, the adapter will be substituted to that interface.
+ *
+ * @author  Guilhem Legal (Geomatys)
+ * @author  Cédric Briançon (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.4 (derived from geotk-3.00)
+ * @version 0.4
+ * @module
+ *
+ * @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
+ */
+@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GML, xmlns = {
+    @XmlNs(prefix = "gml", namespaceURI = Namespaces.GML),
+    @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD),
+    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),
+    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)
+})
+@XmlAccessorType(XmlAccessType.NONE)
+package org.apache.sis.internal.jaxb.referencing;
+
+import org.apache.sis.xml.Namespaces;
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;

Propchange: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java?rev=1520149&r1=1520148&r2=1520149&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java [UTF-8] Wed Sep  4 21:43:23 2013
@@ -20,6 +20,7 @@ import org.apache.sis.util.Static;
 import org.apache.sis.measure.Latitude;
 
 import static java.lang.Math.*;
+import static org.apache.sis.math.MathFunctions.atanh;
 
 
 /**
@@ -28,8 +29,8 @@ import static java.lang.Math.*;
  * do not want to expose publicly those arbitrary values (or at least not in a too direct way).
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @since   0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @since   0.4 (derived from geotk-3.00)
+ * @version 0.4
  * @module
  */
 public final class Formulas extends Static {
@@ -39,7 +40,7 @@ public final class Formulas extends Stat
      * testing map projection accuracy.
      *
      * @see #ANGULAR_TOLERANCE
-     * @see org.apache.sis.internal.util.Utilities#COMPARISON_THRESHOLD
+     * @see org.apache.sis.internal.util.Numerics#COMPARISON_THRESHOLD
      */
     public static final double LINEAR_TOLERANCE = 1.0;
 
@@ -49,7 +50,7 @@ public final class Formulas extends Stat
      * nautical mile length.
      *
      * @see #LINEAR_TOLERANCE
-     * @see org.apache.sis.internal.util.Utilities#COMPARISON_THRESHOLD
+     * @see org.apache.sis.internal.util.Numerics#COMPARISON_THRESHOLD
      */
     public static final double ANGULAR_TOLERANCE = LINEAR_TOLERANCE / (1852 * 60);
 
@@ -70,4 +71,22 @@ public final class Formulas extends Stat
         return abs(ymin - Latitude.MIN_VALUE) <= ANGULAR_TOLERANCE &&
                abs(ymax - Latitude.MAX_VALUE) <= ANGULAR_TOLERANCE;
     }
+
+    /**
+     * Returns the radius of a hypothetical sphere having the same surface than the ellipsoid
+     * specified by the given axis length. This method does not verify if {@code a == b}
+     * (in which case {@code a} could be returned directly); it is up to the caller to perform
+     * such optimization if desired.
+     *
+     * @param  a The semi-major axis length.
+     * @param  b The semi-minor axis length.
+     * @return The radius of a sphere having the same surface than the specified ellipsoid.
+     *
+     * @see org.apache.sis.referencing.datum.DefaultEllipsoid#getAuthalicRadius()
+     */
+    public static double getAuthalicRadius(final double a, final double b) {
+        final double f = 1 - b/a;
+        final double e = sqrt(2*f - f*f);
+        return sqrt(0.5 * (a*a + b*b*atanh(e)/e));
+    }
 }

Added: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java?rev=1520149&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java (added)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] Wed Sep  4 21:43:23 2013
@@ -0,0 +1,767 @@
+/*
+ * 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.referencing.datum;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import javax.measure.unit.SI;
+import javax.measure.unit.Unit;
+import javax.measure.quantity.Length;
+import javax.measure.converter.ConversionException;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.referencing.datum.Ellipsoid;
+import org.apache.sis.geometry.DirectPosition2D;
+import org.apache.sis.internal.util.Numerics;
+import org.apache.sis.internal.jaxb.Context;
+import org.apache.sis.internal.jaxb.gco.Measure;
+import org.apache.sis.internal.jaxb.referencing.SecondDefiningParameter;
+import org.apache.sis.internal.referencing.Formulas;
+import org.apache.sis.referencing.NamedIdentifier;
+import org.apache.sis.referencing.IdentifiedObjects;
+import org.apache.sis.referencing.AbstractIdentifiedObject;
+import org.apache.sis.metadata.iso.citation.Citations;
+import org.apache.sis.io.wkt.Formatter;
+import org.apache.sis.util.Immutable;
+import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.util.resources.Errors;
+
+import static java.lang.Math.*;
+import static java.lang.Double.*;
+import static org.apache.sis.internal.util.Numerics.hash;
+import static org.apache.sis.internal.util.Numerics.epsilonEqual;
+import static org.apache.sis.util.ArgumentChecks.ensureStrictlyPositive;
+import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
+
+// Related to JDK7
+import java.util.Objects;
+
+
+/**
+ * Geometric figure that can be used to describe the approximate shape of the earth.
+ * In mathematical terms, it is a surface formed by the rotation of an ellipse about
+ * its minor axis. An ellipsoid requires two defining parameters:
+ *
+ * <ul>
+ *   <li>{@linkplain #getSemiMajorAxis() semi-major axis} and
+ *       {@linkplain #getInverseFlattening() inverse flattening}, or</li>
+ *   <li>{@linkplain #getSemiMajorAxis() semi-major axis} and
+ *       {@linkplain #getSemiMinorAxis() semi-minor axis}.</li>
+ * </ul>
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @author  Cédric Briançon (Geomatys)
+ * @since   0.4 (derived from geotk-1.2)
+ * @version 0.4
+ * @module
+ */
+@Immutable
+@XmlType(name="EllipsoidType", propOrder={
+    "semiMajorAxisMeasure",
+    "secondDefiningParameter"
+})
+@XmlRootElement(name = "Ellipsoid")
+public class DefaultEllipsoid extends AbstractIdentifiedObject implements Ellipsoid {
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = -1149451543954764081L;
+
+    /**
+     * Maximum number of iterations in the {@link #orthodromicDistance(double, double, double, double)} method.
+     */
+    private static final int MAX_ITERATIONS = 100;
+
+    /**
+     * Small tolerance value for {@link #orthodromicDistance(double, double, double, double)}.
+     */
+    private static final double EPS = 0.5E-13;
+
+    /**
+     * Tolerance threshold for comparing floating point numbers.
+     *
+     * @see Numerics#COMPARISON_THRESHOLD
+     */
+    private static final double COMPARISON_THRESHOLD = 1E-10;
+
+    /**
+     * Returns a properties map with the given name and EPSG code.
+     * This is used for the creation of default ellipsoid constants.
+     */
+    private static Map<String,?> properties(final String name, final int code, final Object alias) {
+        final Map<String,Object> map = new HashMap<>(8);
+        map.put(NAME_KEY, name);
+        map.put(IDENTIFIERS_KEY, new NamedIdentifier(Citations.EPSG, String.valueOf(code)));
+        if (alias != null) {
+            map.put(ALIAS_KEY, alias);
+        }
+        return map;
+    }
+
+    /**
+     * WGS 1984 ellipsoid (EPSG:7030) used in GPS systems.
+     * The semi-major and semi-minor axis length are approximatively 6378137 and 6356752
+     * {@linkplain SI#METRE metres} respectively.
+     * This is the default ellipsoid for most {@code org.apache.sis} packages.
+     *
+     * @see DefaultGeodeticDatum#WGS84
+     */
+    public static final DefaultEllipsoid WGS84 = createFlattenedSphere(
+            properties("WGS84", 7030, "WGS 1984"), 6378137.0, 298.257223563, SI.METRE);
+
+    /**
+     * WGS 1972 ellipsoid (EPSG:7043).
+     * The semi-major and semi-minor axis length are approximatively 6378135 and 6356751
+     * {@linkplain SI#METRE metres} respectively.
+     *
+     * @see DefaultGeodeticDatum#WGS72
+     */
+    public static final DefaultEllipsoid WGS72 = createFlattenedSphere(
+            properties("WGS72", 7043, "WGS 1972"), 6378135.0, 298.26, SI.METRE);
+
+    /**
+     * GRS 1980 ellipsoid (EPSG:7019), also called "<cite>International 1979</cite>".
+     * The semi-major and semi-minor axis length are approximatively 6378137 and 6356752
+     * {@linkplain SI#METRE metres} respectively. This ellipsoid is very close, but not
+     * identical, to {@linkplain #WGS84}.
+     *
+     * {@note The <cite>NAD83</cite> ellipsoid uses the same semi-axis length and units.
+     *        The <cite>Web Map Server</cite> <code>"CRS:83"</code> authority code uses that NAD83 ellipsoid.
+     *        The <code>"IGNF:MILLER"</code> authority code uses the GRS80 ellipsoid.}
+     */
+    public static final DefaultEllipsoid GRS80 = createFlattenedSphere(
+            properties("GRS80", 7019, new String[] {"GRS 1980", "International 1979"}),
+            6378137.0, 298.257222101, SI.METRE);
+
+    /**
+     * International 1924 ellipsoid (EPSG:7022).
+     * The semi-major and semi-minor axis length are approximatively 6378388 and 6356912
+     * {@linkplain SI#METRE metres} respectively.
+     *
+     * {@note The <cite>European Datum 1950</cite> ellipsoid uses the same semi-axis length and units.}
+     */
+    public static final DefaultEllipsoid INTERNATIONAL_1924 = createFlattenedSphere(
+            properties("International 1924", 7022, null), 6378388.0, 297.0, SI.METRE);
+
+    /**
+     * Clarke 1866 ellipsoid (EPSG:7008).
+     * The semi-major and semi-minor axis length are approximatively 6378206 and 6356584
+     * {@linkplain SI#METRE metres} respectively.
+     *
+     * {@note The <cite>NAD27</cite> ellipsoid uses the same semi-axis length and units.
+     *        The <cite>Web Map Server</cite> <code>"CRS:27"</code> authority code uses that NAD27 ellipsoid.}
+     */
+    public static final DefaultEllipsoid CLARKE_1866 = createEllipsoid(
+            properties("Clarke 1866", 7008, null), 6378206.4, 6356583.8, SI.METRE);
+
+    /**
+     * A sphere with a radius of 6371000 {@linkplain SI#METRE metres}. Spheres use a simpler
+     * algorithm for {@linkplain #orthodromicDistance orthodromic distance computation}, which
+     * may be faster and more robust.
+     *
+     * {@note This ellipsoid is close to the <cite>GRS 1980 Authalic Sphere</cite> (EPSG:7048),
+     *        which has a radius of 6371007 metres.}
+     *
+     * @see DefaultGeodeticDatum#SPHERE
+     */
+    public static final DefaultEllipsoid SPHERE =
+            createEllipsoid("SPHERE", 6371000, 6371000, SI.METRE);
+
+    /**
+     * The equatorial radius. This field should be considered as final.
+     * It is modified only by JAXB at unmarshalling time.
+     *
+     * @see #getSemiMajorAxis()
+     */
+    private double semiMajorAxis;
+
+    /**
+     * The polar radius. This field should be considered as final.
+     * It is modified only by JAXB at unmarshalling time.
+     *
+     * @see #getSemiMinorAxis()
+     */
+    private double semiMinorAxis;
+
+    /**
+     * The inverse of the flattening value, or {@link Double#POSITIVE_INFINITY} if the ellipsoid is a sphere.
+     * This field shall be considered as final. It is modified only by JAXB at unmarshalling time.
+     *
+     * @see #getInverseFlattening()
+     */
+    private double inverseFlattening;
+
+    /**
+     * Tells if the Inverse Flattening is definitive for this ellipsoid.
+     * This field shall be considered as final. It is modified only by JAXB at unmarshalling time.
+     *
+     * @see #isIvfDefinitive()
+     */
+    private boolean ivfDefinitive;
+
+    /**
+     * The units of the semi-major and semi-minor axis values.
+     */
+    private Unit<Length> unit;
+
+    /**
+     * Constructs a new ellipsoid with the same values than the specified one.
+     * This copy constructor provides a way to convert an arbitrary implementation into a SIS one
+     * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API.
+     *
+     * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p>
+     *
+     * @param ellipsoid The ellipsoid to copy.
+     *
+     * @see #castOrCopy(Ellipsoid)
+     */
+    protected DefaultEllipsoid(final Ellipsoid ellipsoid) {
+        super(ellipsoid);
+        semiMajorAxis     = ellipsoid.getSemiMajorAxis();
+        semiMinorAxis     = ellipsoid.getSemiMinorAxis();
+        inverseFlattening = ellipsoid.getInverseFlattening();
+        ivfDefinitive     = ellipsoid.isIvfDefinitive();
+        unit              = ellipsoid.getAxisUnit();
+    }
+
+    /**
+     * Constructs a new ellipsoid using the specified axis length. The properties map is
+     * given unchanged to the {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map)
+     * super-class constructor}.
+     *
+     * @param properties        Set of properties. Should contains at least {@code "name"}.
+     * @param semiMajorAxis     The equatorial radius.
+     * @param semiMinorAxis     The polar radius.
+     * @param inverseFlattening The inverse of the flattening value.
+     * @param ivfDefinitive     {@code true} if the inverse flattening is definitive.
+     * @param unit              The units of the semi-major and semi-minor axis values.
+     *
+     * @see #createEllipsoid(Map, double, double, Unit)
+     * @see #createFlattenedSphere(Map, double, double, Unit)
+     */
+    protected DefaultEllipsoid(final Map<String,?> properties,
+                               final double  semiMajorAxis,
+                               final double  semiMinorAxis,
+                               final double  inverseFlattening,
+                               final boolean ivfDefinitive,
+                               final Unit<Length> unit)
+    {
+        super(properties);
+        ensureNonNull         ("unit",              unit);
+        ensureStrictlyPositive("semiMajorAxis",     semiMajorAxis);
+        ensureStrictlyPositive("semiMinorAxis",     semiMinorAxis);
+        ensureStrictlyPositive("inverseFlattening", inverseFlattening);
+        this.unit              = unit;
+        this.semiMajorAxis     = semiMajorAxis;
+        this.semiMinorAxis     = semiMinorAxis;
+        this.inverseFlattening = inverseFlattening;
+        this.ivfDefinitive     = ivfDefinitive;
+    }
+
+    /**
+     * Constructs a new ellipsoid using the specified axis length.
+     *
+     * @param name          The ellipsoid name.
+     * @param semiMajorAxis The equatorial radius.
+     * @param semiMinorAxis The polar radius.
+     * @param unit          The units of the semi-major and semi-minor axis values.
+     * @return An ellipsoid with the given axis length.
+     */
+    public static DefaultEllipsoid createEllipsoid(final String name,
+                                                   final double semiMajorAxis,
+                                                   final double semiMinorAxis,
+                                                   final Unit<Length> unit)
+    {
+        return createEllipsoid(Collections.singletonMap(NAME_KEY, name), semiMajorAxis, semiMinorAxis, unit);
+    }
+
+    /**
+     * Constructs a new ellipsoid using the specified axis length. The properties map is
+     * given unchanged to the {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map)
+     * super-class constructor}.
+     *
+     * @param properties    Set of properties. Should contains at least {@code "name"}.
+     * @param semiMajorAxis The equatorial radius.
+     * @param semiMinorAxis The polar radius.
+     * @param unit          The units of the semi-major and semi-minor axis values.
+     * @return An ellipsoid with the given axis length.
+     */
+    public static DefaultEllipsoid createEllipsoid(final Map<String,?> properties,
+                                                   final double semiMajorAxis,
+                                                   final double semiMinorAxis,
+                                                   final Unit<Length> unit)
+    {
+        if (semiMajorAxis == semiMinorAxis) {
+            return new Spheroid(properties, semiMajorAxis, false, unit);
+        } else {
+            return new DefaultEllipsoid(properties, semiMajorAxis, semiMinorAxis,
+                       semiMajorAxis / (semiMajorAxis - semiMinorAxis), false, unit);
+        }
+    }
+
+    /**
+     * Constructs a new ellipsoid using the specified axis length and inverse flattening value.
+     *
+     * @param name              The ellipsoid name.
+     * @param semiMajorAxis     The equatorial radius.
+     * @param inverseFlattening The inverse flattening value.
+     * @param unit              The units of the semi-major and semi-minor axis values.
+     * @return An ellipsoid with the given axis length.
+     */
+    public static DefaultEllipsoid createFlattenedSphere(final String name,
+                                                         final double semiMajorAxis,
+                                                         final double inverseFlattening,
+                                                         final Unit<Length> unit)
+    {
+        return createFlattenedSphere(Collections.singletonMap(NAME_KEY, name), semiMajorAxis, inverseFlattening, unit);
+    }
+
+    /**
+     * Constructs a new ellipsoid using the specified axis length and
+     * inverse flattening value. The properties map is given unchanged to the
+     * {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}.
+     *
+     * @param properties        Set of properties. Should contains at least {@code "name"}.
+     * @param semiMajorAxis     The equatorial radius.
+     * @param inverseFlattening The inverse flattening value.
+     * @param unit              The units of the semi-major and semi-minor axis values.
+     * @return An ellipsoid with the given axis length.
+     */
+    public static DefaultEllipsoid createFlattenedSphere(final Map<String,?> properties,
+                                                         final double semiMajorAxis,
+                                                         final double inverseFlattening,
+                                                         final Unit<Length> unit)
+    {
+        if (isInfinite(inverseFlattening)) {
+            return new Spheroid(properties, semiMajorAxis, true, unit);
+        } else {
+            return new DefaultEllipsoid(properties, semiMajorAxis,
+                    semiMajorAxis * (1 - 1/inverseFlattening), inverseFlattening, true, unit);
+        }
+    }
+
+    /**
+     * Returns a SIS ellipsoid implementation with the same values than the given arbitrary implementation.
+     * If the given object is {@code null}, then this method returns {@code null}.
+     * Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged.
+     * Otherwise a new SIS implementation is created and initialized to the attribute values of the given object.
+     *
+     * @param  object The object to get as a SIS implementation, or {@code null} if none.
+     * @return A SIS implementation containing the values of the given object (may be the
+     *         given object itself), or {@code null} if the argument was null.
+     */
+    public static DefaultEllipsoid castOrCopy(final Ellipsoid object) {
+        if (object == null || object instanceof DefaultEllipsoid) {
+            return (DefaultEllipsoid) object;
+        }
+        final Map<String,?> properties = IdentifiedObjects.getProperties(object);
+        final double        semiMajor  = object.getSemiMajorAxis();
+        final Unit<Length>  unit       = object.getAxisUnit();
+        return object.isIvfDefinitive() ?
+                createFlattenedSphere(properties, semiMajor, object.getInverseFlattening(), unit) :
+                createEllipsoid      (properties, semiMajor, object.getSemiMinorAxis(),     unit);
+    }
+
+    /**
+     * After the unmarshalling process, only one value between {@link #semiMinorAxis} and
+     * {@link #inverseFlattening} has been defined. Since the {@link #semiMajorAxis} has
+     * been defined, it is now possible to calculate the value of the missing parameter
+     * using the values of those that are set.
+     *
+     * <p>This method is invoked by JAXB only.</p>
+     *
+     * @see #setSemiMajorAxisMeasure(Measure)
+     * @see #setSecondDefiningParameter(SecondDefiningParameter)
+     */
+    private void afterUnmarshal(Object target, Object parent) {
+        if (ivfDefinitive) {
+            if (semiMinorAxis == 0) {
+                semiMinorAxis = semiMajorAxis * (1 - 1/inverseFlattening);
+            }
+        } else {
+            if (inverseFlattening == 0) {
+                inverseFlattening = semiMajorAxis / (semiMajorAxis - semiMinorAxis);
+            }
+        }
+    }
+
+    /**
+     * Returns the linear unit of the {@linkplain #getSemiMajorAxis() semi-major}
+     * and {@linkplain #getSemiMinorAxis() semi-minor} axis values.
+     *
+     * @return The axis linear unit.
+     */
+    @Override
+    public Unit<Length> getAxisUnit() {
+        return unit;
+    }
+
+    /**
+     * Length of the semi-major axis of the ellipsoid.
+     * This is the equatorial radius in {@linkplain #getAxisUnit() axis linear unit}.
+     *
+     * @return Length of semi-major axis.
+     */
+    @Override
+    public double getSemiMajorAxis() {
+        return semiMajorAxis;
+    }
+
+    /**
+     * Returns the semi-major axis value as a measurement.
+     * This method is invoked by JAXB for XML marshalling.
+     */
+    @XmlElement(name = "semiMajorAxis", required = true)
+    final Measure getSemiMajorAxisMeasure() {
+        return new Measure(semiMajorAxis, unit);
+    }
+
+    /**
+     * Sets the semi-major axis value.
+     * This method is invoked by JAXB at unmarshalling time only.
+     *
+     * @see #setSecondDefiningParameter(SecondDefiningParameter)
+     * @see #afterUnmarshal(Object, Object)
+     */
+    private void setSemiMajorAxisMeasure(final Measure uom) {
+        if (semiMajorAxis != 0) {
+            warnDuplicated("semiMajorAxis");
+        } else {
+            semiMajorAxis = uom.value;
+            unit = uom.unit.asType(Length.class);
+        }
+    }
+
+    /**
+     * Length of the semi-minor axis of the ellipsoid. This is the
+     * polar radius in {@linkplain #getAxisUnit() axis linear unit}.
+     *
+     * @return Length of semi-minor axis.
+     */
+    @Override
+    public double getSemiMinorAxis() {
+        return semiMinorAxis;
+    }
+
+    /**
+     * Returns the radius of a hypothetical sphere having the same surface than this ellipsoid.
+     * The radius is expressed in {@linkplain #getAxisUnit() axis linear unit}.
+     *
+     * @return The radius of a sphere having the same surface than this ellipsoid.
+     */
+    public double getAuthalicRadius() {
+        return Formulas.getAuthalicRadius(getSemiMajorAxis(), getSemiMinorAxis());
+    }
+
+    /**
+     * The ratio of the distance between the center and a focus of the ellipse
+     * to the length of its semi-major axis. The eccentricity can alternately be
+     * computed from the equation: <code>e = sqrt(2f - f²)</code>.
+     *
+     * @return The eccentricity of this ellipsoid.
+     */
+    public double getEccentricity() {
+        final double f = 1 - getSemiMinorAxis() / getSemiMajorAxis();
+        return sqrt(2*f - f*f);
+    }
+
+    /**
+     * Returns the value of the inverse of the flattening constant. Flattening is a value
+     * used to indicate how closely an ellipsoid approaches a spherical shape. The inverse
+     * flattening is related to the equatorial/polar radius by the formula:
+     *
+     * <blockquote>
+     * <var>ivf</var> = <var>r</var><sub>e</sub> / (<var>r</var><sub>e</sub> - <var>r</var><sub>p</sub>).
+     * </blockquote>
+     *
+     * For perfect spheres (i.e. if {@link #isSphere()} returns {@code true}),
+     * the {@link Double#POSITIVE_INFINITY} value is used.
+     *
+     * @return The inverse flattening value.
+     */
+    @Override
+    public double getInverseFlattening() {
+        return inverseFlattening;
+    }
+
+    /**
+     * Indicates if the {@linkplain #getInverseFlattening() inverse flattening} is definitive for
+     * this ellipsoid. Some ellipsoids use the IVF as the defining value, and calculate the polar
+     * radius whenever asked. Other ellipsoids use the polar radius to calculate the IVF whenever
+     * asked. This distinction can be important to avoid floating-point rounding errors.
+     *
+     * @return {@code true} if the {@linkplain #getInverseFlattening inverse flattening} is definitive,
+     *         or {@code false} if the {@linkplain #getSemiMinorAxis() polar radius} is definitive.
+     */
+    @Override
+    public boolean isIvfDefinitive() {
+        return ivfDefinitive;
+    }
+
+    /**
+     * Returns the object to be marshalled as the {@code SecondDefiningParameter} XML element. The
+     * returned object contains the values for {@link #semiMinorAxis} or {@link #inverseFlattening},
+     * according to the {@link #isIvfDefinitive()} value. This method is for JAXB marshalling only.
+     */
+    @XmlElement(name = "secondDefiningParameter")
+    final SecondDefiningParameter getSecondDefiningParameter() {
+        return new SecondDefiningParameter(this, true);
+    }
+
+    /**
+     * Sets the second defining parameter value, either the inverse of the flattening
+     * value or the semi minor axis value, according to what have been defined in the
+     * second defining parameter given. This is for JAXB unmarshalling process only.
+     *
+     * @see #setSemiMajorAxisMeasure(Measure)
+     * @see #afterUnmarshal(Object, Object)
+     */
+    private void setSecondDefiningParameter(SecondDefiningParameter second) throws ConversionException {
+        while (second.secondDefiningParameter != null) {
+            second = second.secondDefiningParameter;
+        }
+        final Measure measure = second.measure;
+        if (measure != null) {
+            double value = measure.value;
+            if (second.isIvfDefinitive()) {
+                if (inverseFlattening == 0) {
+                    inverseFlattening = value;
+                    ivfDefinitive = true;
+                    return;
+                }
+            } else {
+                final Unit<?> uom = measure.unit;
+                if (uom != null) {
+                    if (unit != null) {
+                        value = uom.getConverterToAny(unit).convert(value);
+                    } else {
+                        unit = uom.asType(Length.class);
+                    }
+                }
+                if (semiMinorAxis == 0) {
+                    semiMinorAxis = value;
+                    ivfDefinitive = false;
+                    return;
+                }
+            }
+            warnDuplicated("secondDefiningParameter");
+        }
+    }
+
+    /**
+     * Emits a warning telling that the given element is repeated twice.
+     */
+    private void warnDuplicated(final String element) {
+        final LogRecord record = Errors.getResources(null)
+                .getLogRecord(Level.WARNING, Errors.Keys.DuplicatedElement_1, element);
+        record.setSourceClassName(DefaultEllipsoid.class.getName());
+        record.setSourceMethodName("unmarshal"); // We cheat a bit since there is not such method...
+        Context.warningOccured(Context.current(), this, record);
+    }
+
+    /**
+     * {@code true} if the ellipsoid is degenerate and is actually a sphere.
+     * The sphere is completely defined by the {@linkplain #getSemiMajorAxis() semi-major axis},
+     * which is the radius of the sphere.
+     *
+     * @return {@code true} if the ellipsoid is degenerate and is actually a sphere.
+     */
+    @Override
+    public boolean isSphere() {
+        return semiMajorAxis == semiMinorAxis;
+    }
+
+    /**
+     * Returns the orthodromic distance between two geographic coordinates.
+     * The orthodromic distance is the shortest distance between two points on a sphere's surface.
+     * The orthodromic path is always on a great circle.
+     * This is different from the <cite>loxodromic distance</cite>, which is a
+     * longer distance on a path with a constant direction on the compass.
+     *
+     * @param  x1 Longitude of first  point (in decimal degrees).
+     * @param  y1 Latitude  of first  point (in decimal degrees).
+     * @param  x2 Longitude of second point (in decimal degrees).
+     * @param  y2 Latitude  of second point (in decimal degrees).
+     * @return The orthodromic distance (in the units of this ellipsoid's axis).
+     */
+    public double orthodromicDistance(double x1, double y1, double x2, double y2) {
+        x1 = toRadians(x1);
+        y1 = toRadians(y1);
+        x2 = toRadians(x2);
+        y2 = toRadians(y2);
+        /*
+         * Solution of the geodetic inverse problem after T.Vincenty.
+         * Modified Rainsford's method with Helmert's elliptical terms.
+         * Effective in any azimuth and at any distance short of antipodal.
+         *
+         * Latitudes and longitudes in radians positive North and East.
+         * Forward azimuths at both points returned in radians from North.
+         *
+         * Programmed for CDC-6600 by LCDR L.Pfeifer NGS ROCKVILLE MD 18FEB75
+         * Modified for IBM SYSTEM 360 by John G.Gergen NGS ROCKVILLE MD 7507
+         * Ported from Fortran to Java by Martin Desruisseaux.
+         *
+         * Source: ftp://ftp.ngs.noaa.gov/pub/pcsoft/for_inv.3d/source/inverse.for
+         *         subroutine INVER1
+         */
+        final double F = 1 / getInverseFlattening();
+        final double R = 1 - F;
+
+        double tu1 = R * tan(y1);
+        double tu2 = R * tan(y2);
+        double cu1 = 1 / sqrt(tu1*tu1 + 1);
+        double cu2 = 1 / sqrt(tu2*tu2 + 1);
+        double su1 = cu1 * tu1;
+        double s   = cu1 * cu2;
+        double baz =   s * tu2;
+        double faz = baz * tu1;
+        double x   =  x2 - x1;
+        for (int i=0; i<MAX_ITERATIONS; i++) {
+            final double sx = sin(x);
+            final double cx = cos(x);
+            tu1 = cu2 * sx;
+            tu2 = baz - su1*cu2*cx;
+            final double sy = hypot(tu1, tu2);
+            final double cy = s*cx + faz;
+            final double y = atan2(sy, cy);
+            final double SA = s * (sx/sy);
+            final double c2a = 1 - SA*SA;
+            double cz = 2*faz;
+            if (c2a > 0) {
+                cz = -cz/c2a + cy;
+            }
+            double e = cz*cz*2 - 1;
+            double c = ((-3*c2a+4)*F + 4) * c2a * F/16;
+            double d = x;
+            x = ((e*cy*c+cz)*sy*c + y) * SA;
+            x = (1-c)*x*F + x2-x1;
+
+            if (abs(d-x) <= EPS) {
+                x = sqrt((1/(R*R) - 1) * c2a + 1) + 1;
+                x = (x-2)/x;
+                c = 1-x;
+                c = (x*x/4 + 1)/c;
+                d = (0.375*x*x - 1)*x;
+                x = e*cy;
+                s = 1 - 2*e;
+                s = ((((sy*sy*4 - 3)*s*cz*d/6-x)*d/4+cz)*sy*d+y)*c*R * getSemiMajorAxis();
+                return s;
+            }
+        }
+        // No convergence. It may be because coordinate points
+        // are equals or because they are at antipodes.
+        if (abs(x1-x2) <= COMPARISON_THRESHOLD && abs(y1-y2) <= COMPARISON_THRESHOLD) {
+            return 0; // Coordinate points are equals
+        }
+        if (abs(y1) <= COMPARISON_THRESHOLD && abs(y2) <= COMPARISON_THRESHOLD) {
+            return abs(x1-x2) * getSemiMajorAxis(); // Points are on the equator.
+        }
+        // At least one input ordinate is NaN.
+        if (isNaN(x1) || isNaN(y1) || isNaN(x2) || isNaN(y2)) {
+            return NaN;
+        }
+        // Other cases: no solution for this algorithm.
+        throw new ArithmeticException(Errors.format(Errors.Keys.NoConvergenceForPoints_2,
+                  new DirectPosition2D(toDegrees(x1), toDegrees(y1)),
+                  new DirectPosition2D(toDegrees(x2), toDegrees(y2))));
+    }
+
+    /**
+     * Compares this ellipsoid with the specified object for equality.
+     *
+     * @param  object The object to compare to {@code this}.
+     * @param  mode {@link ComparisonMode#STRICT STRICT} for performing a strict comparison, or
+     *         {@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} for comparing only properties
+     *         relevant to transformations.
+     * @return {@code true} if both objects are equal.
+     */
+    @Override
+    public boolean equals(final Object object, final ComparisonMode mode) {
+        if (object == this) {
+            return true; // Slight optimization.
+        }
+        if (super.equals(object, mode)) {
+            if (mode == ComparisonMode.STRICT) {
+                final DefaultEllipsoid that = (DefaultEllipsoid) object;
+                return ivfDefinitive == that.ivfDefinitive &&
+                       Numerics.equals(this.semiMajorAxis,     that.semiMajorAxis)     &&
+                       Numerics.equals(this.semiMinorAxis,     that.semiMinorAxis)     &&
+                       Numerics.equals(this.inverseFlattening, that.inverseFlattening) &&
+                        Objects.equals(this.unit,              that.unit);
+            } else {
+                if (object instanceof Ellipsoid) {
+                    final Ellipsoid that = (Ellipsoid) object;
+                    if (mode == ComparisonMode.BY_CONTRACT) {
+                        /*
+                         * isIvfDefinitive has no incidence on calculation using ellipsoid parameters,
+                         * so we consider it as metadata that can be ignored in IGNORE_METADATA mode.
+                         */
+                        if (isIvfDefinitive() != that.isIvfDefinitive()) {
+                            return false;
+                        }
+                    }
+                    return epsilonEqual(getSemiMajorAxis(),     that.getSemiMajorAxis(),     mode) &&
+                           epsilonEqual(getSemiMinorAxis(),     that.getSemiMinorAxis(),     mode) &&
+                           epsilonEqual(getInverseFlattening(), that.getInverseFlattening(), mode) &&
+                           Objects.equals(getAxisUnit(),        that.getAxisUnit());
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Computes a hash value consistent with the given comparison mode.
+     */
+    @Override
+    public int hashCode(final ComparisonMode mode) throws IllegalArgumentException {
+        /*
+         * The "^ (int) serialVersionUID" is an arbitrary change applied to the hash code value in order to
+         * differentiate this DefaultEllipsoid implementation from implementations of other GeoAPI interfaces.
+         */
+        int code = super.hashCode(mode) ^ (int) serialVersionUID;
+        switch (mode) {
+            case STRICT: {
+                code = hash(semiMajorAxis, hash(ivfDefinitive ? inverseFlattening : semiMinorAxis, code));
+                break;
+            }
+            default: {
+                code = hash(getSemiMajorAxis(), hash(isIvfDefinitive() ? getInverseFlattening() : getSemiMinorAxis(), code));
+                break;
+            }
+        }
+        return code;
+    }
+
+    /**
+     * Formats the inner part of a <cite>Well Known Text</cite> (WKT) element.
+     *
+     * @param  formatter The formatter to use.
+     * @return The WKT element name, which is {@code "SPHEROID"}.
+     */
+    @Override
+    public String formatTo(final Formatter formatter) {
+        final double ivf = getInverseFlattening();
+        formatter.append(getAxisUnit().getConverterTo(SI.METRE).convert(getSemiMajorAxis()));
+        formatter.append(isInfinite(ivf) ? 0 : ivf);
+        return "SPHEROID";
+    }
+}

Propchange: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/Spheroid.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/Spheroid.java?rev=1520149&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/Spheroid.java (added)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/Spheroid.java [UTF-8] Wed Sep  4 21:43:23 2013
@@ -0,0 +1,112 @@
+/*
+ * 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.referencing.datum;
+
+import java.util.Map;
+import javax.measure.unit.Unit;
+import javax.measure.quantity.Length;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.sis.util.Immutable;
+
+import static java.lang.Math.*;
+
+
+/**
+ * A ellipsoid which is spherical. This ellipsoid implements a faster
+ * {@link #orthodromicDistance(double, double, double, double)} method.
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @since   0.4 (derived from geotk-2.0)
+ * @version 0.4
+ * @module
+ */
+@Immutable
+@XmlTransient
+final class Spheroid extends DefaultEllipsoid {
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = 7867565381280669821L;
+
+    /**
+     * Constructs a new sphere using the specified radius.
+     *
+     * @param properties    Set of properties. Should contains at least {@code "name"}.
+     * @param radius        The equatorial and polar radius.
+     * @param ivfDefinitive {@code true} if the inverse flattening is definitive.
+     * @param unit          The units of the radius value.
+     */
+    protected Spheroid(Map<String,?> properties, double radius, boolean ivfDefinitive, Unit<Length> unit) {
+        super(properties, radius, radius, Double.POSITIVE_INFINITY, ivfDefinitive, unit);
+    }
+
+    /**
+     * Returns {@code true} since this object is a sphere.
+     */
+    @Override
+    public boolean isSphere() {
+        return true;
+    }
+
+    /**
+     * This ellipsoid is already a sphere, so returns its radius directly.
+     */
+    @Override
+    public double getAuthalicRadius() {
+        return getSemiMajorAxis();
+    }
+
+    /**
+     * Eccentricity of a sphere is always zero.
+     */
+    @Override
+    public double getEccentricity() {
+        return 0;
+    }
+
+    /**
+     * Returns the orthodromic distance between two geographic coordinates.
+     * The orthodromic distance is the shortest distance between two points
+     * on a sphere's surface. The orthodromic path is always on a great circle.
+     *
+     * @param  x1 Longitude of first point (in decimal degrees).
+     * @param  y1 Latitude of first point (in decimal degrees).
+     * @param  x2 Longitude of second point (in decimal degrees).
+     * @param  y2 Latitude of second point (in decimal degrees).
+     * @return The orthodromic distance (in the units of this ellipsoid's axis).
+     */
+    @Override
+    public double orthodromicDistance(double x1, double y1, double x2, double y2) {
+        /*
+         * The calculation of orthodromic distance on an ellipsoidal surface is complex,
+         * subject to rounding errors and has no solution near the poles. In some situation
+         * we use a calculation based on a spherical shape of the earth.  A Fortran program
+         * which calculates orthodromic distances on an ellipsoidal surface can be downloaded
+         * from the NOAA site:
+         *
+         *            ftp://ftp.ngs.noaa.gov/pub/pcsoft/for_inv.3d/source/
+         */
+        y1 = toRadians(y1);
+        y2 = toRadians(y2);
+        final double dx = toRadians(abs(x2-x1) % 360);
+        double rho = sin(y1)*sin(y2) + cos(y1)*cos(y2)*cos(dx);
+        assert abs(rho) < 1.0000001 : rho;
+        if (rho > +1) rho = +1; // Catch rounding error.
+        if (rho < -1) rho = -1; // Catch rounding error.
+        return acos(rho) * getSemiMajorAxis();
+    }
+}

Propchange: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/Spheroid.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java?rev=1520149&r1=1520148&r2=1520149&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java [UTF-8] Wed Sep  4 21:43:23 2013
@@ -19,6 +19,8 @@ package org.apache.sis.internal.jaxb.gco
 import java.io.File;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
 import javax.measure.unit.Unit;
 import javax.measure.unit.NonSI;
 import javax.xml.bind.annotation.XmlValue;
@@ -27,6 +29,7 @@ import org.apache.sis.internal.jaxb.gmd.
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.xml.ValueConverter;
 import org.apache.sis.util.CharSequences;
+import org.apache.sis.util.resources.Errors;
 
 
 /**
@@ -150,4 +153,24 @@ public final class Measure {
         }
         unit = converter.toUnit(context, uom);
     }
+
+    /**
+     * Sets the unit to the given value, with a warning logged if the user specified an other unit.
+     *
+     * {@example Some users wrongly assign the "m" unit to <code>Ellipsoid.inverseFlattening</code>.
+     *           The SIS adapter force the unit to <code>Unit.ONE</code>, but we want to let the user
+     *           know that he probably did something wrong.}
+     *
+     * @param newUnit The new unit (can not be null).
+     */
+    public void setUnit(final Unit<?> newUnit) {
+        if (unit != null && !unit.equals(newUnit)) {
+            final LogRecord record = Errors.getResources(null)
+                    .getLogRecord(Level.WARNING, Errors.Keys.IncompatiblePropertyValue_1, unit);
+            record.setSourceClassName(getClass().getName());
+            record.setSourceMethodName("setUnit");
+            Context.warningOccured(Context.current(), this, record);
+        }
+        unit = newUnit;
+    }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java?rev=1520149&r1=1520148&r2=1520149&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java [UTF-8] Wed Sep  4 21:43:23 2013
@@ -45,15 +45,15 @@ public final class Numerics extends Stat
      * {@preformat java
      *     Matrix m1 = ...;
      *     Matrix m2 = ...;
-     *     if (Matrices.epsilonEqual(m1, m2, EQUIVALENT_THRESHOLD, true)) {
+     *     if (Matrices.epsilonEqual(m1, m2, COMPARISON_THRESHOLD, true)) {
      *         // Consider that matrixes are equal.
      *     }
      * }
      *
      * By extension, the same threshold value is used for comparing other floating point values.
      *
-     * @see org.apache.sis.internal.referencing.Utilities#LINEAR_TOLERANCE
-     * @see org.apache.sis.internal.referencing.Utilities#ANGULAR_TOLERANCE
+     * @see org.apache.sis.internal.referencing.Formulas#LINEAR_TOLERANCE
+     * @see org.apache.sis.internal.referencing.Formulas#ANGULAR_TOLERANCE
      */
     public static final double COMPARISON_THRESHOLD = 1E-14;
 

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1520149&r1=1520148&r2=1520149&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Wed Sep  4 21:43:23 2013
@@ -134,6 +134,11 @@ public final class Errors extends Indexe
         public static final int DeadThread_1 = 43;
 
         /**
+         * Element “{0}” is duplicated.
+         */
+        public static final int DuplicatedElement_1 = 116;
+
+        /**
          * Identifier “{0}” is duplicated.
          */
         public static final int DuplicatedIdentifier_1 = 38;
@@ -371,6 +376,11 @@ public final class Errors extends Indexe
         public static final int NegativeArrayLength_1 = 78;
 
         /**
+         * No convergence for points {0} and {1}.
+         */
+        public static final int NoConvergenceForPoints_2 = 117;
+
+        /**
          * Element “{0}” has not been found.
          */
         public static final int NoSuchElement_1 = 96;

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1520149&r1=1520148&r2=1520149&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Wed Sep  4 21:43:23 2013
@@ -38,8 +38,9 @@ CanNotSetPropertyValue_1        = Can no
 ClassNotFinal_1                 = Class \u2018{0}\u2019 is not final.
 CloneNotSupported_1             = Can not clone an object of type \u2018{0}\u2019.
 DeadThread_1                    = Thread \u201c{0}\u201d is dead.
-DuplicatedOption_1              = Option \u201c{0}\u201d is duplicated.
+DuplicatedElement_1             = Element \u201c{0}\u201d is duplicated.
 DuplicatedIdentifier_1          = Identifier \u201c{0}\u201d is duplicated.
+DuplicatedOption_1              = Option \u201c{0}\u201d is duplicated.
 ElementAlreadyPresent_1         = Element \u201c{0}\u201d is already present.
 EmptyArgument_1                 = Argument \u2018{0}\u2019 shall not be empty.
 EmptyDictionary                 = The dictionary shall contain at least one entry.
@@ -85,6 +86,7 @@ MissingValueInColumn_1          = Missin
 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.
+NoConvergenceForPoints_2        = No convergence for points {0} and {1}.
 NodeChildOfItself_1             = Node \u201c{0}\u201d can not be a child of itself.
 NodeHasAnotherParent_1          = Node \u201c{0}\u201d already has another parent.
 NodeHasNoParent_1               = Node \u201c{0}\u201d has no parent.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1520149&r1=1520148&r2=1520149&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Wed Sep  4 21:43:23 2013
@@ -28,8 +28,9 @@ CanNotSetPropertyValue_1        = Ne peu
 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.
 DeadThread_1                    = La t\u00e2che \u201c{0}\u201d est morte.
-DuplicatedOption_1              = L\u2019option \u201c{0}\u201d est dupliqu\u00e9e.
+DuplicatedElement_1             = L\u2019\u00e9lement \u201c{0}\u201d est dupliqu\u00e9.
 DuplicatedIdentifier_1          = L\u2019identifiant \u201c{0}\u201d est dupliqu\u00e9.
+DuplicatedOption_1              = L\u2019option \u201c{0}\u201d est dupliqu\u00e9e.
 ElementAlreadyPresent_1         = L\u2019\u00e9lement \u201c{0}\u201d est d\u00e9j\u00e0 pr\u00e9sent.
 EmptyArgument_1                 = L\u2019argument \u2018{0}\u2019 ne doit pas \u00eatre vide.
 EmptyDictionary                 = Le dictionnaire doit contenir au moins une entr\u00e9e.
@@ -75,6 +76,7 @@ MissingValueInColumn_1          = Il man
 MutuallyExclusiveOptions_2      = Les options \u201c{0}\u201d et \u201c{1}\u201d 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 \u201c{0}\u201d de longueur n\u00e9gative.
+NoConvergenceForPoints_2        = Le calcul ne converge pas pour les points {0} et {1}.
 NodeChildOfItself_1             = Le n\u0153ud \u201c{0}\u201d ne peut pas \u00eatre un enfant de lui-m\u00eame.
 NodeHasAnotherParent_1          = Le n\u0153ud \u201c{0}\u201d a d\u00e9j\u00e0 un autre parent.
 NodeHasNoParent_1               = Le n\u0153ud \u201c{0}\u201d n\u2019a pas de parent.

Modified: sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml?rev=1520149&r1=1520148&r2=1520149&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml Wed Sep  4 21:43:23 2013
@@ -68,6 +68,7 @@
             <word>monospaced</word>
             <word>namespace</word>
             <word>namespaces</word>
+            <word>orthodromic</word>
             <word>parsable</word>
             <word>timezone</word>
             <word>Unicode</word>

Added: sis/ip-review/DefaultEllipsoid.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/DefaultEllipsoid.xhtml?rev=1520149&view=auto
==============================================================================
--- sis/ip-review/DefaultEllipsoid.xhtml (added)
+++ sis/ip-review/DefaultEllipsoid.xhtml Wed Sep  4 21:43:23 2013
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>DefaultEllipsoid history</title>
+    <style type="text/css" media="all">
+      @import url("./reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>DefaultEllipsoid history</h1>
+  <p>Click on the commit message for inspecting the <code>diff</code> and how the code has been rewritten.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn log -r31996:1 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/datum/DefaultEllipsoid.java</code></blockquote>
+<table>
+  <tr>
+    <th>Rev.</th>
+    <th>Date</th>
+    <th>Author</th>
+    <th class="last">Message</th>
+  </tr>
+<tr><td class="rev">31000</td><td>2008-07-10</td><td>desruisseaux</td><td>Avoid usage of 2 deprecated constructors from CRSFactory. Their replacement were tricky and required more sophesticated code in ReferencingFactoryContainer.toGeodetic3D.</td></tr>
+<tr><td class="rev">30760</td><td>2008-06-18</td><td>desruisseaux</td><td>Upgrated from JSR-108 to JSR-275 (GEOT-1266). Some opportunist javadoc fixes and @Override annotations in the process.</td></tr>
+<tr><td class="rev">30641</td><td>2008-06-12</td><td>acuster</td><td>Copyright headers: lib/referencing, this time with feeling (and the el in Toolkit)</td></tr>
+<tr><td class="rev">30521</td><td>2008-06-05</td><td>acuster</td><td>Copyright: Update referencing headers</td></tr>
+<tr><td class="rev">30313</td><td>2008-05-16</td><td>desruisseaux</td><td>Changed my mind about Utilities.shallowEquals(Object,Object) and renamed it as equals, since a few tests show that the compiler always select the best overloaded flavor working on primitive types (except if an argument is a boolean and the other a different primitive type). Updated a few references. Fixed a few javadoc warnings by explicit declaration of parameter and return values.</td></tr>
+<tr><td class="rev">30258</td><td>2008-05-08</td><td>acuster</td><td>Reshuffle the top level repo: drop uDig, move up trunk, tags, and branches.</td></tr>
+<tr><td class="rev">30257</td><td>2008-05-08</td><td>acuster</td><td>Move trunk/gt/ directory contents up to trunk/ and drop gt</td></tr>
+<tr><td class="rev">28922</td><td>2008-01-24</td><td>acuster</td><td>Bump the (at)since version to 2.5 since WKTParser was cut from 2.4</td></tr>
+<tr><td class="rev">28540</td><td>2007-12-29</td><td>acuster</td><td>Hide buttons which are not yet used</td></tr>
+<tr><td class="rev">28393</td><td>2007-12-17</td><td>desruisseaux</td><td>WKT formatting now includes the semi-major and semi-minor axis length if they differ from the datum. Applied Java 5 features. Uses WarpAffine when applicable during Raster reprojection.</td></tr>
+<tr><td class="rev">28081</td><td>2007-11-27</td><td>desruisseaux</td><td>Java 5 constructs: replaced some StringBuffer by StringBuilder in order to avoid unecessary synchronisation; rely on auto-boxing in order to give a chance to the JVM to reuse its cached values.</td></tr>
+<tr><td class="rev">27983</td><td>2007-11-22</td><td>desruisseaux</td><td>Use more Java 5 constructs for safety.</td></tr>
+<tr><td class="rev">27575</td><td>2007-10-22</td><td>desruisseaux</td><td>Converted Java source files from ISO-LATIN-1 encoding to UTF-8 (GEOT-1516).</td></tr>
+<tr><td class="rev">26413</td><td>2007-08-01</td><td class="unav">aaime</td><td><a href="rev/26413/DefaultEllipsoid.xhtml">Fix for GEOT-1411, lenient datum comparisong should not consider ivDefinitive</a></td></tr>
+<tr><td class="rev">22327</td><td>2006-10-23</td><td>desruisseaux</td><td>GEOT-982: regroup 'module', 'plugin', 'ext' and 'unsupported' in a common directory.</td></tr>
+<tr><td class="rev">22315</td><td>2006-10-22</td><td>desruisseaux</td><td>Reorganisation of directory tree structure (GEOT-982) phase 1: moved 'src' to 'src/main/java'.</td></tr>
+<tr><td class="rev">20874</td><td>2006-08-07</td><td class="unav">jgarnett</td><td><a href="rev/20874/DefaultEllipsoid.xhtml">ip review</a></td></tr>
+<tr><td class="rev">19769</td><td>2006-06-02</td><td>desruisseaux</td><td>Javadoc fix: replaced 'degrees' by 'decimal degrees' when relevant (GEOT-855)</td></tr>
+<tr><td class="rev">17672</td><td>2006-01-19</td><td>desruisseaux</td><td>Added @source tag.</td></tr>
+<tr><td class="rev">17660</td><td>2006-01-18</td><td>desruisseaux</td><td>Fixed SVN attributes, including the addition of URL attribute.</td></tr>
+<tr><td class="rev">16982</td><td>2005-11-25</td><td>desruisseaux</td><td>Copied AUTO factory from plugin/epsg-wkt to module/referencing (GEOT-773). Not yet tested neither enabled.</td></tr>
+<tr><td class="rev">15736</td><td>2005-09-19</td><td>desruisseaux</td><td>Added convenience methods or constructors</td></tr>
+<tr><td class="rev">15350</td><td>2005-08-16</td><td>desruisseaux</td><td>Merged the 'split-main' branch to trunk (GEOT-662)</td></tr>
+<tr><td class="rev">15256</td><td>2005-08-09</td><td>desruisseaux</td><td>Extraction of referencing module from main</td></tr>
+<tr><td class="rev">15255</td><td>2005-08-09</td><td>desruisseaux</td><td>Prepare branch for splitting main</td></tr>
+<tr><td class="rev">14834</td><td>2005-07-20</td><td>desruisseaux</td><td>Reorganized I18N resources</td></tr>
+<tr><td class="rev">14592</td><td>2005-06-23</td><td>desruisseaux</td><td>Added a test case for GeocentricTranslation</td></tr>
+<tr><td class="rev">14545</td><td>2005-06-15</td><td>desruisseaux</td><td>Initial port of coverage I/O helper classes (work in progress)</td></tr>
+<tr><td class="rev">14235</td><td>2005-06-10</td><td>desruisseaux</td><td>Replaced _PROPERTY suffix by _KEY as of GEOT-577</td></tr>
+<tr><td class="rev">13925</td><td>2005-05-30</td><td>desruisseaux</td><td>Added @since javadoc tag</td></tr>
+<tr><td class="rev">13906</td><td>2005-05-28</td><td>desruisseaux</td><td>Renamed some 'Default' prefix as 'Abstract'</td></tr>
+<tr><td class="rev">13836</td><td>2005-05-26</td><td>desruisseaux</td><td>Added 'Default' suffix to some CRS implementations: partial work</td></tr>
+<tr><td class="rev">12960</td><td>2005-04-04</td><td>desruisseaux</td><td>Added convenience wrapper methods</td></tr>
+<tr><td class="rev">11001</td><td>2005-02-02</td><td>desruisseaux</td><td>Fixed wrong encoding in main/src</td></tr>
+<tr><td class="rev">10796</td><td>2005-01-28</td><td class="unav">dzwiers</td><td><a href="rev/10796/DefaultEllipsoid.xhtml">imports cleaned</a></td></tr>
+<tr><td class="rev">10184</td><td>2005-01-03</td><td>desruisseaux</td><td>Firsts ScriptTest running</td></tr>
+<tr><td class="rev">8518</td><td>2004-10-11</td><td>desruisseaux</td><td>Apply changes voted in OGC meeting at Southampton: use of Identifier and GenericName</td></tr>
+<tr><td class="rev">6888</td><td>2004-07-14</td><td>desruisseaux</td><td>Update for GeoAPI changes (Info -->  IdentifiedObject)</td></tr>
+<tr><td class="rev">6343</td><td>2004-06-07</td><td>desruisseaux</td><td>More ports of legacy CTS to new CRS</td></tr>
+<tr><td class="rev">6333</td><td>2004-06-06</td><td>desruisseaux</td><td>Continuing CRS implementation</td></tr>
+<tr><td class="rev">6112</td><td>2004-05-24</td><td>desruisseaux</td><td>WKT tunning / Added test cases</td></tr>
+<tr><td class="rev">6098</td><td>2004-05-23</td><td>desruisseaux</td><td>Partial implementation of GeoAPI referencing package</td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/DefaultEllipsoid.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/DefaultEllipsoid.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/Spheroid.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/Spheroid.xhtml?rev=1520149&view=auto
==============================================================================
--- sis/ip-review/Spheroid.xhtml (added)
+++ sis/ip-review/Spheroid.xhtml Wed Sep  4 21:43:23 2013
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Spheroid history</title>
+    <style type="text/css" media="all">
+      @import url("./reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>Spheroid history</h1>
+  <p>Click on the commit message for inspecting the <code>diff</code> and how the code has been rewritten.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn log -r31996:1 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/datum/Spheroid.java</code></blockquote>
+<table>
+  <tr>
+    <th>Rev.</th>
+    <th>Date</th>
+    <th>Author</th>
+    <th class="last">Message</th>
+  </tr>
+<tr><td class="rev">31000</td><td>2008-07-10</td><td>desruisseaux</td><td>Avoid usage of 2 deprecated constructors from CRSFactory. Their replacement were tricky and required more sophesticated code in ReferencingFactoryContainer.toGeodetic3D.</td></tr>
+<tr><td class="rev">30760</td><td>2008-06-18</td><td>desruisseaux</td><td>Upgrated from JSR-108 to JSR-275 (GEOT-1266). Some opportunist javadoc fixes and @Override annotations in the process.</td></tr>
+<tr><td class="rev">30641</td><td>2008-06-12</td><td>acuster</td><td>Copyright headers: lib/referencing, this time with feeling (and the el in Toolkit)</td></tr>
+<tr><td class="rev">30521</td><td>2008-06-05</td><td>acuster</td><td>Copyright: Update referencing headers</td></tr>
+<tr><td class="rev">30258</td><td>2008-05-08</td><td>acuster</td><td>Reshuffle the top level repo: drop uDig, move up trunk, tags, and branches.</td></tr>
+<tr><td class="rev">30257</td><td>2008-05-08</td><td>acuster</td><td>Move trunk/gt/ directory contents up to trunk/ and drop gt</td></tr>
+<tr><td class="rev">28922</td><td>2008-01-24</td><td>acuster</td><td>Bump the (at)since version to 2.5 since WKTParser was cut from 2.4</td></tr>
+<tr><td class="rev">28540</td><td>2007-12-29</td><td>acuster</td><td>Hide buttons which are not yet used</td></tr>
+<tr><td class="rev">28393</td><td>2007-12-17</td><td>desruisseaux</td><td>WKT formatting now includes the semi-major and semi-minor axis length if they differ from the datum. Applied Java 5 features. Uses WarpAffine when applicable during Raster reprojection.</td></tr>
+<tr><td class="rev">27575</td><td>2007-10-22</td><td>desruisseaux</td><td>Converted Java source files from ISO-LATIN-1 encoding to UTF-8 (GEOT-1516).</td></tr>
+<tr><td class="rev">22327</td><td>2006-10-23</td><td>desruisseaux</td><td>GEOT-982: regroup 'module', 'plugin', 'ext' and 'unsupported' in a common directory.</td></tr>
+<tr><td class="rev">22315</td><td>2006-10-22</td><td>desruisseaux</td><td>Reorganisation of directory tree structure (GEOT-982) phase 1: moved 'src' to 'src/main/java'.</td></tr>
+<tr><td class="rev">20874</td><td>2006-08-07</td><td class="unav">jgarnett</td><td><a href="rev/20874/Spheroid.xhtml">ip review</a></td></tr>
+<tr><td class="rev">19769</td><td>2006-06-02</td><td>desruisseaux</td><td>Javadoc fix: replaced 'degrees' by 'decimal degrees' when relevant (GEOT-855)</td></tr>
+<tr><td class="rev">17672</td><td>2006-01-19</td><td>desruisseaux</td><td>Added @source tag.</td></tr>
+<tr><td class="rev">17660</td><td>2006-01-18</td><td>desruisseaux</td><td>Fixed SVN attributes, including the addition of URL attribute.</td></tr>
+<tr><td class="rev">15350</td><td>2005-08-16</td><td>desruisseaux</td><td>Merged the 'split-main' branch to trunk (GEOT-662)</td></tr>
+<tr><td class="rev">15256</td><td>2005-08-09</td><td>desruisseaux</td><td>Extraction of referencing module from main</td></tr>
+<tr><td class="rev">15255</td><td>2005-08-09</td><td>desruisseaux</td><td>Prepare branch for splitting main</td></tr>
+<tr><td class="rev">13925</td><td>2005-05-30</td><td>desruisseaux</td><td>Added @since javadoc tag</td></tr>
+<tr><td class="rev">13836</td><td>2005-05-26</td><td>desruisseaux</td><td>Added 'Default' suffix to some CRS implementations: partial work</td></tr>
+<tr><td class="rev">11001</td><td>2005-02-02</td><td>desruisseaux</td><td>Fixed wrong encoding in main/src</td></tr>
+<tr><td class="rev">10796</td><td>2005-01-28</td><td class="unav">dzwiers</td><td><a href="rev/10796/Spheroid.xhtml">imports cleaned</a></td></tr>
+<tr><td class="rev">6098</td><td>2004-05-23</td><td>desruisseaux</td><td>Partial implementation of GeoAPI referencing package</td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/Spheroid.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/Spheroid.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/10796/DefaultEllipsoid.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10796/DefaultEllipsoid.xhtml?rev=1520149&view=auto
==============================================================================
--- sis/ip-review/rev/10796/DefaultEllipsoid.xhtml (added)
+++ sis/ip-review/rev/10796/DefaultEllipsoid.xhtml Wed Sep  4 21:43:23 2013
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>DefaultEllipsoid changes for revisions 10795:10796</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>DefaultEllipsoid changes for revisions 10795:10796</h1>
+<p>Changes in this commit seem to be the result of some "<cite>auto reformat</cite>" tool execution.
+The <cite>Java</cite> - <cite>GeoAPI</cite> - <cite>GeoTools</cite> import ordering is altered,
+imports used only in Javadoc are lost and the encoding of non-ASCII characters is broken.
+This commit has been reverted, except for the removal of really unused imports which are keep removed.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r10795:10796 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/datum/DefaultEllipsoid.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 10795</th><th>Revision 10796</th></tr>
+<tr><td><pre>/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Managment Committee (PMC)
+<span class="del"> * (C) 2001, Institut de Recherche pour le Développement</span>
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public</pre></td>
+<td><pre>/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Managment Committee (PMC)
+<span class="add"> * (C) 2001, Institut de Recherche pour le D�veloppement</span>
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public</pre></td></tr>
+<tr><td><pre>package org.geotools.referencing.datum;
+
+// J2SE extensions
+import java.util.Map;
+<span class="del">import java.util.Collections;</span>
+<span class="del">import java.awt.geom.Point2D;</span>
+import javax.units.SI;
+import javax.units.Unit;
+
+<span class="del">// Geotools dependencies</span>
+import org.geotools.referencing.IdentifiedObject;
+import org.geotools.referencing.wkt.Formatter;
+import org.geotools.resources.XMath;
+<span class="del">import org.geotools.resources.Utilities;</span>
+import org.geotools.resources.cts.Resources;
+<span class="del">import org.geotools.resources.cts.ResourceKeys;</span>
+<span class="del">import org.geotools.geometry.GeneralDirectPosition;</span>
+<span class="del">import org.geotools.measure.CoordinateFormat;</span>
+
+
+/**</pre></td>
+<td><pre>package org.geotools.referencing.datum;
+
+// J2SE extensions
+<span class="add">import java.awt.geom.Point2D;</span>
+<span class="add">import java.util.Collections;</span>
+import java.util.Map;
+<span class="add"></span>
+import javax.units.SI;
+import javax.units.Unit;
+
+<span class="add">import org.geotools.geometry.GeneralDirectPosition;</span>
+<span class="add">import org.geotools.measure.CoordinateFormat;</span>
+import org.geotools.referencing.IdentifiedObject;
+import org.geotools.referencing.wkt.Formatter;
+<span class="add">import org.geotools.resources.Utilities;</span>
+import org.geotools.resources.XMath;
+<span class="add">import org.geotools.resources.cts.ResourceKeys;</span>
+import org.geotools.resources.cts.Resources;
+
+
+/**</pre></td></tr>
+<tr><td><pre>/**
+ * The ratio of the distance between the center and a focus of the ellipse
+ * to the length of its semimajor axis. The eccentricity can alternately be
+<span class="del"> * computed from the equation: &lt;code&gt;e=sqrt(2f-f²)&lt;/code&gt;.</span>
+ */
+public double getEccentricity() {
+    final double f = 1-getSemiMinorAxis()/getSemiMajorAxis();</pre></td>
+<td><pre>/**
+ * The ratio of the distance between the center and a focus of the ellipse
+ * to the length of its semimajor axis. The eccentricity can alternately be
+<span class="add"> * computed from the equation: &lt;code&gt;e=sqrt(2f-f�)&lt;/code&gt;.</span>
+ */
+public double getEccentricity() {
+    final double f = 1-getSemiMinorAxis()/getSemiMajorAxis();</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/10796/DefaultEllipsoid.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/10796/DefaultEllipsoid.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/10796/Spheroid.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10796/Spheroid.xhtml?rev=1520149&view=auto
==============================================================================
--- sis/ip-review/rev/10796/Spheroid.xhtml (added)
+++ sis/ip-review/rev/10796/Spheroid.xhtml Wed Sep  4 21:43:23 2013
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Spheroid changes for revisions 10795:10796</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>Spheroid changes for revisions 10795:10796</h1>
+<p>Changes in this commit seem to be the result of some "<cite>auto reformat</cite>" tool execution.
+The <cite>Java</cite> - <cite>GeoAPI</cite> - <cite>GeoTools</cite> import ordering is altered,
+imports used only in Javadoc are lost and the encoding of non-ASCII characters is broken.
+This commit has been reverted, except for the removal of really unused imports which are keep removed.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r10795:10796 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/datum/Spheroid.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 10795</th><th>Revision 10796</th></tr>
+<tr><td><pre>/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Managment Committee (PMC)
+<span class="del"> * (C) 2001, Institut de Recherche pour le Développement</span>
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public</pre></td>
+<td><pre>/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Managment Committee (PMC)
+<span class="add"> * (C) 2001, Institut de Recherche pour le D�veloppement</span>
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public</pre></td></tr>
+<tr><td><pre>// J2SE dependencies
+import java.util.Map;
+import javax.units.Unit;</pre></td>
+<td><pre>// J2SE dependencies
+import java.util.Map;
+<span class="add"></span>
+import javax.units.Unit;</pre></td></tr>
+<tr><td><pre>                                                           &lt; getSemiMajorAxis()/1E+9 : delta;
+    } catch (ArithmeticException exception) {
+        // The ellipsoidal model do not converge. Give up the assertion test.
+<span class="del">        // Note: the assertion fails for illegal latitudes (i.e. abs(y1)&gt;90°</span>
+<span class="del">        //       or abs(y2)&gt;90°).</span>
+    }
+    return distance;
+}</pre></td>
+<td><pre>                                                           &lt; getSemiMajorAxis()/1E+9 : delta;
+    } catch (ArithmeticException exception) {
+        // The ellipsoidal model do not converge. Give up the assertion test.
+<span class="add">        // Note: the assertion fails for illegal latitudes (i.e. abs(y1)&gt;90�</span>
+<span class="add">        //       or abs(y2)&gt;90�).</span>
+    }
+    return distance;
+}</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/10796/Spheroid.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/10796/Spheroid.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html



Mime
View raw message