sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1752301 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/internal/referencing/provider/ main/java/org/apache/sis/referencing/operation/projection/ test/java/org/apache/sis/referencing/report/
Date Tue, 12 Jul 2016 15:17:47 GMT
Author: desruisseaux
Date: Tue Jul 12 15:17:47 2016
New Revision: 1752301

URL: http://svn.apache.org/viewvc?rev=1752301&view=rev
Log:
Refactor the package-private helper methods used during map projection providers initialization.
The intend is to use slightly more readable methods in definitions of ESRI-specific projections.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/package-info.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -31,7 +31,7 @@ import org.apache.sis.referencing.operat
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.6
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @XmlTransient
@@ -42,12 +42,6 @@ abstract class AbstractStereographic ext
     private static final long serialVersionUID = -8797654778436582119L;
 
     /**
-     * The operation parameter descriptor for the <cite>Scale factor at natural origin</cite>
(k₀) parameter value.
-     * Valid values range is (0 … ∞) and default value is 1.
-     */
-    public static final ParameterDescriptor<Double> SCALE_FACTOR = Mercator1SP.SCALE_FACTOR;
-
-    /**
      * The operation parameter descriptor for the <cite>False easting</cite>
(FE) parameter value.
      * Valid values range is unrestricted and default value is 0 metre.
      */

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -107,9 +107,8 @@ public final class LambertConformal2SP e
          * NetCDF:  longitude_of_central_meridian
          * GeoTIFF: FalseOriginLong
          */
-        LONGITUDE_OF_FALSE_ORIGIN = createLongitude(exceptEPSG(LambertConformal1SP.LONGITUDE_OF_ORIGIN,
builder
-                .addIdentifier("8822")
-                .addName("Longitude of false origin"))
+        LONGITUDE_OF_FALSE_ORIGIN = createLongitude(
+                 rename(LambertConformal1SP.LONGITUDE_OF_ORIGIN, "8822", "Longitude of false
origin", builder)
                 .rename(Citations.NETCDF, "longitude_of_central_meridian")
                 .rename(Citations.GEOTIFF, "FalseOriginLong"));
         /*

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -57,7 +57,7 @@ import static org.opengis.metadata.Ident
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.7
+ * @version 0.8
  * @module
  */
 @XmlTransient
@@ -244,47 +244,105 @@ public abstract class MapProjection exte
     }
 
     /**
-     * Copies all aliases and identifiers except the ones for the given authority.
-     * If the given replacement is non-null, then it will be used instead of the
-     * first occurrence of the omitted name.
+     * Rename the primary name and identifier of the given descriptor. Aliases are copied
as-is.
      *
-     * <p>This method does not copy the primary name. It is caller's responsibility
to add it first.</p>
+     * @param  template    the parameter from which to copy the aliases.
+     * @param  identifier  the new EPSG identifier.
+     * @param  name        the new EPSG name.
+     * @param  builder     an initially clean builder where to add the names.
+     * @return the given {@code builder}, for method call chaining.
+     *
+     * @since 0.8
+     */
+    static ParameterBuilder rename(final ParameterDescriptor<?> template, final String
identifier, final String name,
+            final ParameterBuilder builder)
+    {
+        return exceptEPSG(template, builder.addIdentifier(identifier).addName(name));
+    }
+
+    /**
+     * Copies name, aliases and identifiers of the given {@code template}, except the alias
of the given authority
+     * which is replaced by the alias of the same authority in {@code replacement}.
      *
-     * @param  source      The parameter from which to copy the names.
-     * @param  except      The authority of the name to omit. Can not be EPSG.
-     * @param  replacement The name to use instead of the omitted one, or {@code null} if
none.
-     * @param  builder     Where to add the names.
-     * @return The given {@code builder}, for method call chaining.
+     * @param  template     the parameter from which to copy names and identifiers.
+     * @param  toRename     authority of the alias to rename.
+     * @param  replacement  the parameter from which to get the new name for the alias to
rename.
+     * @param  builder      an initially clean builder where to add the names and identifiers.
+     * @return the given {@code builder}, for method call chaining.
      *
-     * @since 0.7
+     * @since 0.8
      */
-    static ParameterBuilder except(final ParameterDescriptor<Double> source, final
Citation except,
+    static ParameterBuilder renameAlias(final ParameterDescriptor<Double> template,
final Citation toRename,
+            final ParameterDescriptor<Double> replacement, final ParameterBuilder builder)
+    {
+        copyAliases(template, toRename, sameNameAs(toRename, replacement), builder.addName(template.getName()));
+        for (final Identifier id : template.getIdentifiers()) {
+            builder.addIdentifier(id);
+        }
+        return builder;
+    }
+
+    /**
+     * Copies all aliases except the ones for the given authority. If the given replacement
is non-null,
+     * then it will be used instead of the first occurrence of the omitted name.
+     *
+     * <p>This method does not copy the primary name. It is caller's responsibility
to add it first.</p>
+     *
+     * @param  template     the parameter from which to copy the aliases.
+     * @param  exclude      the authority of the alias to omit. Can not be EPSG.
+     * @param  replacement  the alias to use instead of the omitted one, or {@code null}
if none.
+     * @param  builder      where to add the aliases.
+     * @return the given {@code builder}, for method call chaining.
+     */
+    private static ParameterBuilder copyAliases(final ParameterDescriptor<Double> template,
final Citation exclude,
             GenericName replacement, final ParameterBuilder builder)
     {
-        for (GenericName alias : source.getAlias()) {
-            if (((Identifier) alias).getAuthority() == except) {
+        for (GenericName alias : template.getAlias()) {
+            if (((Identifier) alias).getAuthority() == exclude) {
                 if (replacement == null) continue;
                 alias = replacement;
                 replacement = null;
             }
             builder.addName(alias);
         }
-        for (final Identifier id : source.getIdentifiers()) {
-            builder.addIdentifier(id);
-        }
         return builder;
     }
 
     /**
+     * Copies all aliases and identifiers, but using the alias specified by the given authority
as the primary name.
+     * The old primary name (usually the EPSG name) is discarded. Identifier are <strong>not</strong>
copied, which
+     * usually implies that only the EPSG identifier is ignored (because it is usually the
only parameter identifier).
+     *
+     * <p>This is a convenience method for defining the parameters of an ESRI-specific
(or any other authority)
+     * projection using the EPSG parameters as template. Note that in the particular case
where the desired
+     * authority is OGC, {@link #exceptEPSG(ParameterDescriptor, ParameterBuilder)} is more
efficient.</p>
+     *
+     * @param  template    the parameter from which to copy the names.
+     * @param  authority   the authority to use for the primary name.
+     * @param  builder     an initially clean builder where to add the names.
+     * @return the given {@code builder}, for method call chaining.
+     *
+     * @since 0.8
+     */
+    static ParameterBuilder alternativeAuthority(final ParameterDescriptor<Double>
template,
+            final Citation authority, final ParameterBuilder builder)
+    {
+        return copyAliases(template, authority, null, builder.addName(sameNameAs(authority,
template)));
+    }
+
+    /**
      * Copies all names except the EPSG one from the given parameter into the builder.
-     * The EPSG name is presumed the first name and identifier (this is not verified).
+     * The EPSG information are presumed to be the primary name and the only identifier (this
is not verified).
+     *
+     * <p>If this method is invoking with a "clean" builder, then the result is to
promote the first alias as
+     * the primary name. The first alias is usually the OGC name.</p>
      *
-     * @param  source  The parameter from which to copy the names.
-     * @param  builder Where to add the names.
-     * @return The given {@code builder}, for method call chaining.
+     * @param  template  the parameter from which to copy the names.
+     * @param  builder   where to add the names.
+     * @return the given {@code builder}, for method call chaining.
      */
-    static ParameterBuilder exceptEPSG(final ParameterDescriptor<?> source, final ParameterBuilder
builder) {
-        for (final GenericName alias : source.getAlias()) {
+    static ParameterBuilder exceptEPSG(final ParameterDescriptor<?> template, final
ParameterBuilder builder) {
+        for (final GenericName alias : template.getAlias()) {
             builder.addName(alias);
         }
         return builder;
@@ -293,8 +351,8 @@ public abstract class MapProjection exte
     /**
      * Creates a remarks for parameters that are not formally EPSG parameter.
      *
-     * @param  origin The name of the projection for where the parameter is formally used.
-     * @return A remarks saying that the parameter is actually defined in {@code origin}.
+     * @param  origin  the name of the projection for where the parameter is formally used.
+     * @return a remarks saying that the parameter is actually defined in {@code origin}.
      */
     static InternationalString notFormalParameter(final String origin) {
         return Messages.formatInternational(Messages.Keys.NotFormalProjectionParameter_1,
origin);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -31,7 +31,7 @@ import org.apache.sis.referencing.operat
  * @author  Rueben Schulz (UBC)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.7
+ * @version 0.8
  * @module
  *
  * @see <a href="http://www.remotesensing.org/geotiff/proj_list/oblique_stereographic.html">Oblique
Stereographic on RemoteSensing.org</a>
@@ -56,6 +56,12 @@ public final class ObliqueStereographic
     public static final ParameterDescriptor<Double> LONGITUDE_OF_ORIGIN = Mercator1SP.LONGITUDE_OF_ORIGIN;
 
     /**
+     * The operation parameter descriptor for the <cite>Scale factor at natural origin</cite>
(k₀) parameter value.
+     * Valid values range is (0 … ∞) and default value is 1.
+     */
+    public static final ParameterDescriptor<Double> SCALE_FACTOR = Mercator1SP.SCALE_FACTOR;
   // Same as PolarStereographicA.
+
+    /**
      * The group of all parameters expected by this coordinate operation.
      */
     private static final ParameterDescriptorGroup PARAMETERS;

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -29,7 +29,7 @@ import org.apache.sis.parameter.Paramete
  * @author  Rueben Schulz (UBC)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.7
+ * @version 0.8
  * @module
  *
  * @see <a href="http://www.remotesensing.org/geotiff/proj_list/polar_stereographic.html">Polar
Stereographic on RemoteSensing.org</a>
@@ -64,6 +64,12 @@ public final class PolarStereographicA e
     public static final ParameterDescriptor<Double> LONGITUDE_OF_ORIGIN;
 
     /**
+     * The operation parameter descriptor for the <cite>Scale factor at natural origin</cite>
(k₀) parameter value.
+     * Valid values range is (0 … ∞) and default value is 1.
+     */
+    public static final ParameterDescriptor<Double> SCALE_FACTOR = Mercator1SP.SCALE_FACTOR;
+
+    /**
      * The group of all parameters expected by this coordinate operation.
      */
     private static final ParameterDescriptorGroup PARAMETERS;

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -31,7 +31,7 @@ import org.apache.sis.parameter.Paramete
  * @author  Rueben Schulz (UBC)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @XmlTransient
@@ -67,7 +67,6 @@ public final class PolarStereographicB e
      * because it is sometime used in Well Known Text (WKT). However it shall be interpreted
as a
      * <cite>Scale factor at the standard parallel</cite> rather than at the
natural origin.</p>
      */
-    @SuppressWarnings("FieldNameHidesFieldInSuperclass")
     static final ParameterDescriptor<Double> SCALE_FACTOR;
 
     /**
@@ -77,8 +76,7 @@ public final class PolarStereographicB e
     static {
         final ParameterBuilder builder = builder();
         LONGITUDE_OF_ORIGIN = createLongitude(
-                exceptEPSG(PolarStereographicA.LONGITUDE_OF_ORIGIN,
-                builder.addIdentifier("8833").addName("Longitude of origin")));
+                rename(PolarStereographicA.LONGITUDE_OF_ORIGIN, "8833", "Longitude of origin",
builder));
 
         STANDARD_PARALLEL = createMandatoryLatitude(builder
                 .addIdentifier("8832").addName("Latitude of standard parallel")
@@ -98,7 +96,7 @@ public final class PolarStereographicB e
                 .createGroupForMapProjection(
                         STANDARD_PARALLEL,
                         LONGITUDE_OF_ORIGIN,
-                        SCALE_FACTOR,       // Not formally a parameter of this projection.
+                        SCALE_FACTOR,                   // Not formally a parameter of this
projection.
                         FALSE_EASTING,
                         FALSE_NORTHING);
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -44,22 +44,18 @@ public final class PolarStereographicSou
     private static final long serialVersionUID = -6173635411676914083L;
 
     /**
-     * Copies all names and identifiers, but using the ESRI authority as the primary name.
-     * This is a convenience method for defining the parameters of an ESRI-specific projection
-     * using the EPSG parameters as template.
-     */
-    private static ParameterBuilder addNamesAndIdentifiers(final ParameterDescriptor<Double>
source, final ParameterBuilder builder) {
-        return except(source, Citations.ESRI, null, builder.addName(sameNameAs(Citations.ESRI,
source)).addName(source.getName()));
-    }
-
-    /**
-     * Returns the same parameter than the given one, except that the primary name is the
ESRI name
-     * instead than the EPSG one.
+     * Returns the same parameter than the given one, except that the alias of the ESRI authority
+     * is promoted as the primary name. The old primary name and identifiers (which are usually
the
+     * EPSG ones) are discarded.
+     *
+     * @param  template    the parameter from which to copy the names and identifiers.
+     * @param  builder     an initially clean builder where to add the names.
+     * @return the given {@code builder}, for method call chaining.
      */
     @SuppressWarnings("unchecked")
-    private static ParameterDescriptor<Double> forESRI(final ParameterDescriptor<Double>
source, final ParameterBuilder builder) {
-        return addNamesAndIdentifiers(source, builder).createBounded((MeasurementRange<Double>)
-                ((DefaultParameterDescriptor<Double>) source).getValueDomain(), source.getDefaultValue());
+    private static ParameterDescriptor<Double> forESRI(final ParameterDescriptor<Double>
template, final ParameterBuilder builder) {
+        return alternativeAuthority(template, Citations.ESRI, builder).createBounded((MeasurementRange<Double>)
+                ((DefaultParameterDescriptor<Double>) template).getValueDomain(), template.getDefaultValue());
     }
 
     /**
@@ -69,11 +65,11 @@ public final class PolarStereographicSou
     static {
         final ParameterBuilder builder = builder();
         final ParameterDescriptor<?>[] parameters = {
-            addNamesAndIdentifiers(PolarStereographicB.STANDARD_PARALLEL, builder)
+            alternativeAuthority(PolarStereographicB.STANDARD_PARALLEL, Citations.ESRI, builder)
                    .createBounded(Latitude.MIN_VALUE, 0, Latitude.MIN_VALUE, NonSI.DEGREE_ANGLE),
 
             forESRI(PolarStereographicB.LONGITUDE_OF_ORIGIN, builder),
-            forESRI(PolarStereographicB.SCALE_FACTOR, builder),
+                    PolarStereographicB.SCALE_FACTOR,                   // Not formally a
parameter of this projection.
             forESRI(PolarStereographicB.FALSE_EASTING, builder),
             forESRI(PolarStereographicB.FALSE_NORTHING, builder)
         };

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -74,19 +74,16 @@ public class RegionalMercator extends Ab
     static {
         final ParameterBuilder builder = builder();
 
-        LATITUDE_OF_FALSE_ORIGIN = createLatitude(exceptEPSG(Mercator1SP.LATITUDE_OF_ORIGIN,
builder
-                .addIdentifier("8821")
-                .addName("Latitude of false origin"))
+        LATITUDE_OF_FALSE_ORIGIN = createLatitude(
+                 rename(Mercator1SP.LATITUDE_OF_ORIGIN, "8821", "Latitude of false origin",
builder)
                 .rename(Citations.GEOTIFF, "FalseOriginLat"), false);
 
-        EASTING_AT_FALSE_ORIGIN = createShift(exceptEPSG(FALSE_EASTING, builder
-                .addIdentifier("8826")
-                .addName("Easting at false origin"))
+        EASTING_AT_FALSE_ORIGIN = createShift(
+                 rename(FALSE_EASTING, "8826", "Easting at false origin", builder)
                 .rename(Citations.GEOTIFF, "FalseOriginEasting"));
 
-        NORTHING_AT_FALSE_ORIGIN = createShift(exceptEPSG(FALSE_NORTHING, builder
-                .addIdentifier("8827")
-                .addName("Northing at false origin"))
+        NORTHING_AT_FALSE_ORIGIN = createShift(
+                 rename(FALSE_NORTHING, "8827", "Northing at false origin", builder)
                 .rename(Citations.GEOTIFF, "FalseOriginNorthing"));
 
         PARAMETERS = builder

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -90,9 +90,8 @@ public final class TransverseMercator ex
         LATITUDE_OF_ORIGIN = createLatitude(builder
                 .addNamesAndIdentifiers(Mercator1SP.LATITUDE_OF_ORIGIN), true);
 
-        builder.addName(Mercator1SP.LONGITUDE_OF_ORIGIN.getName());
-        LONGITUDE_OF_ORIGIN = createLongitude(except(Mercator1SP.LONGITUDE_OF_ORIGIN, Citations.NETCDF,
-                sameNameAs(Citations.NETCDF, LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN),
builder));
+        LONGITUDE_OF_ORIGIN = createLongitude(renameAlias(Mercator1SP.LONGITUDE_OF_ORIGIN,
+                Citations.NETCDF, LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN, builder));
 
         SCALE_FACTOR = createScale(builder
                 .addNamesAndIdentifiers(Mercator1SP.SCALE_FACTOR)

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/package-info.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/package-info.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -22,7 +22,7 @@
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.7
+ * @version 0.8
  * @module
  *
  * @see org.apache.sis.referencing.operation.transform.MathTransformProvider

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -99,8 +99,9 @@ final class Initializer {
      *
      * @param method     Description of the map projection parameters.
      * @param parameters The parameters of the projection to be created.
-     * @param roles Parameters to look for <cite>central meridian</cite>, <cite>scale
factor</cite>,
-     *        <cite>false easting</cite>, <cite>false northing</cite>
and other values.
+     * @param roles      Parameters to look for <cite>central meridian</cite>,
<cite>scale factor</cite>,
+     *                   <cite>false easting</cite>, <cite>false northing</cite>
and other values.
+     * @param variant    Convenience field left at the discretion of {@link NormalizedProjection}
subclasses.
      */
     Initializer(final OperationMethod method, final Parameters parameters,
             final Map<ParameterRole, ? extends ParameterDescriptor<? extends Number>>
roles,
@@ -239,7 +240,7 @@ final class Initializer {
         final Number defaultValue = descriptor.getDefaultValue();
         if (defaultValue == null || !defaultValue.equals(value)) {
             MapProjection.validate(descriptor, value);
-            context.parameter(descriptor.getName().getCode()).setValue(value);
+            context.getOrCreate(descriptor).setValue(value);
         }
         return value;
     }
@@ -255,7 +256,7 @@ final class Initializer {
             return defaultValue;
         }
         MapProjection.validate(descriptor, value);
-        context.parameter(descriptor.getName().getCode()).setValue(value);
+        context.getOrCreate(descriptor).setValue(value);
         return value;
     }
 

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -113,7 +113,6 @@ public class PolarStereographic extends
      * Work around for RFE #4093999 in Sun's bug database
      * ("Relax constraint on placement of this()/super() call in constructors").
      */
-    @SuppressWarnings("fallthrough")
     @Workaround(library="JDK", version="1.7")
     private static Initializer initializer(final OperationMethod method, final Parameters
parameters) {
         final byte variant = getVariant(method);

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -155,7 +155,7 @@ public strictfp class CoordinateOperatio
      * @throws IOException if an error occurred while writing to the file.
      */
     public CoordinateOperationMethods() throws IOException {
-        super("CoordinateOperationMethods.html", "Apache SIS Coordinate Operation Methods");
+        super("CoordinateOperationMethods.html", "Apache SIS Coordinate Operation Methods",
"authority-codes.css");
         domainOfValidity = Collections.emptyMap();      // TODO: not yet available.
         rangeFormat = new RangeFormat(LOCALE);
         final int header = openTag("header");

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java?rev=1752301&r1=1752300&r2=1752301&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java
[UTF-8] Tue Jul 12 15:17:47 2016
@@ -83,11 +83,12 @@ abstract strictfp class HTMLGenerator im
      * Creates a new instance which will write in the given file.
      * This constructor immediately writes the HTML header up to the {@code <body>}
line, inclusive.
      *
-     * @param  filename The name of the file where to write.
-     * @param  title The document title.
+     * @param  filename  the name of the file where to write.
+     * @param  title     the document title.
+     * @param  path      path to the CSS file.
      * @throws IOException if the file can not be created (e.g. because it already exists).
      */
-    HTMLGenerator(final String filename, final String title) throws IOException {
+    HTMLGenerator(final String filename, final String title, final String css) throws IOException
{
         final File file = new File(filename);
         if (file.exists()) {
             throw new IOException("File " + file.getAbsolutePath() + " already exists.");
@@ -112,7 +113,11 @@ abstract strictfp class HTMLGenerator im
         out.newLine();
         println("title", title);
         openTag("style type=\"text/css\" media=\"all\"");
-        println("@import url(\"../tables.css\");");
+        out.write(margin);
+        out.write("@import url(\"");
+        out.write(css);
+        out.write("\");");
+        out.newLine();
         closeTags(head);
         openTag("body");
     }



Mime
View raw message