sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1673294 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/internal/referencing/provider/ main/resources/META-INF/services/ test/java/org/apache/sis/internal/referencing/provider/ test/java/org/apache/sis/test/
Date Mon, 13 Apr 2015 21:52:52 GMT
Author: desruisseaux
Date: Mon Apr 13 21:52:51 2015
New Revision: 1673294

URL: http://svn.apache.org/r1673294
Log:
Referencing: added parameters for "Lambert Conformal (2SP)" and the Belgium case.
Not yet connected to the actual map projection code.

Added:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java
  (with props)
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalBelgium.java
  (with props)
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.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/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java?rev=1673294&r1=1673293&r2=1673294&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java
[UTF-8] Mon Apr 13 21:52:51 2015
@@ -68,7 +68,7 @@ public final class LambertConformal1SP e
             .addName(                    "Lambert Conic Conformal (1SP)")
             .addName(Citations.OGC,      "Lambert_Conformal_Conic_1SP")
             .addName(Citations.GEOTIFF,  "CT_LambertConfConic_1SP")
-            .addName(Citations.PROJ4,    "lcc")
+            .addIdentifier(Citations.GEOTIFF, "9")
             .createGroupForMapProjection(
                     LATITUDE_OF_ORIGIN,
                     CENTRAL_MERIDIAN,

Added: 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=1673294&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java
[UTF-8] Mon Apr 13 21:52:51 2015
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.referencing.provider;
+
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.apache.sis.internal.util.Constants;
+import org.apache.sis.parameter.ParameterBuilder;
+import org.apache.sis.metadata.iso.citation.Citations;
+
+
+/**
+ * The provider for <cite>"Lambert Conic Conformal (2SP)"</cite> projection (EPSG:9802).
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @author  Rueben Schulz (UBC)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ *
+ * @see <a href="http://www.remotesensing.org/geotiff/proj_list/lambert_conic_conformal_2sp.html">Lambert
Conic Conformal 2SP on RemoteSensing.org</a>
+ */
+public final class LambertConformal2SP extends AbstractLambert {
+    /**
+     * For cross-version compatibility.
+     */
+    private static final long serialVersionUID = 3240860802816724947L;
+
+    /**
+     * The operation parameter descriptor for the <cite>Latitude of false origin</cite>
(φf) parameter value.
+     * Valid values range is [-90 … 90]° and default value is 0°.
+     */
+    public static final ParameterDescriptor<Double> LATITUDE_OF_FALSE_ORIGIN;
+
+    /**
+     * The operation parameter descriptor for the <cite>Longitude of false origin</cite>
(λf) parameter value.
+     * Valid values range is [-180 … 180]° and default value is 0°.
+     */
+    public static final ParameterDescriptor<Double> LONGITUDE_OF_FALSE_ORIGIN;
+
+    /**
+     * The operation parameter descriptor for the <cite>Latitude of 1st standard parallel</cite>
parameter value.
+     * Valid values range is [-90 … 90]° and default value is the value given to the {@link
#LATITUDE_OF_FALSE_ORIGIN}
+     * parameter.
+     */
+    public static final ParameterDescriptor<Double> STANDARD_PARALLEL_1;
+
+    /**
+     * The operation parameter descriptor for the <cite>Latitude of 2nd standard parallel</cite>
parameter value.
+     * Valid values range is [-90 … 90]° and default value is the value given to the {@link
#STANDARD_PARALLEL_2}
+     * parameter.
+     */
+    public static final ParameterDescriptor<Double> STANDARD_PARALLEL_2;
+
+    /**
+     * The operation parameter descriptor for the <cite>Scale factor</cite> (not
necessarily at natural origin)
+     * parameter value. Valid values range is (0 … ∞) and default value is 1.
+     *
+     * <p>This parameter is used by {@link LambertConformal1SP} and is not formally
a parameter of
+     * {@link LambertConformal2SP} projections. Nevertheless we declare it is as an optional
parameter because
+     * it is sometime used in Well Known Text (WKT). However it shall be interpreted as a
<cite>Scale factor at
+     * the standard parallels</cite> rather than at the natural origin.</p>
+     */
+    static final ParameterDescriptor<Double> SCALE_FACTOR;
+
+    /**
+     * The operation parameter descriptor for the <cite>Easting at false origin</cite>
(Ef) parameter value.
+     * Valid values range is unrestricted and default value is 0 metre.
+     */
+    public static final ParameterDescriptor<Double> EASTING_AT_FALSE_ORIGIN = RegionalMercator.EASTING_AT_FALSE_ORIGIN;
+
+    /**
+     * The operation parameter descriptor for the <cite>Northing at false origin</cite>
(Nf) parameter value.
+     * Valid values range is unrestricted and default value is 0 metre.
+     */
+    public static final ParameterDescriptor<Double> NORTHING_AT_FALSE_ORIGIN = RegionalMercator.NORTHING_AT_FALSE_ORIGIN;
+
+    /**
+     * The group of all parameters expected by this coordinate operation.
+     */
+    public static final ParameterDescriptorGroup PARAMETERS;
+    static {
+        final ParameterBuilder builder = builder();
+        /*
+         * EPSG:    Latitude of false origin
+         * OGC:     latitude_of_origin
+         * ESRI:    Latitude_Of_Origin
+         * NetCDF:  latitude_of_projection_origin
+         * GeoTIFF: FalseOriginLat
+         */
+        LATITUDE_OF_FALSE_ORIGIN = createLatitude(builder
+                .addNamesAndIdentifiers(RegionalMercator.LATITUDE_OF_FALSE_ORIGIN), true);
+        /*
+         * EPSG:    Longitude of false origin
+         * OGC:     central_meridian
+         * ESRI:    Central_Meridian
+         * NetCDF:  longitude_of_central_meridian
+         * GeoTIFF: FalseOriginLong
+         */
+        LONGITUDE_OF_FALSE_ORIGIN = createLongitude(exceptEPSG(LambertConformal1SP.CENTRAL_MERIDIAN,
builder
+                .addIdentifier("8822")
+                .addName("Longitude of false origin"))
+                .rename(Citations.NETCDF, "longitude_of_central_meridian")
+                .rename(Citations.GEOTIFF, "FalseOriginLong"));
+        /*
+         * EPSG:    Latitude of 1st standard parallel
+         * OGC:     standard_parallel_1
+         * ESRI:    Standard_Parallel_1
+         * NetCDF:  standard_parallel
+         * GeoTIFF: StdParallel1
+         */
+        STANDARD_PARALLEL_1 = createLatitude(builder
+                .addNamesAndIdentifiers(Mercator2SP.STANDARD_PARALLEL), true);  // TODO:
default value should be NaN
+        /*
+         * EPSG:    Latitude of 2nd standard parallel
+         * OGC:     standard_parallel_2
+         * ESRI:    Standard_Parallel_2
+         * NetCDF:  standard_parallel
+         * GeoTIFF: StdParallel2
+         */
+        STANDARD_PARALLEL_2 = createLatitude(builder
+                .addIdentifier("8824")
+                .addName("Latitude of 2nd standard parallel")
+                .addName(Citations.OGC,     Constants.STANDARD_PARALLEL_2)
+                .addName(Citations.ESRI,    "Standard_Parallel_2")
+                .addName(Citations.GEOTIFF, "StdParallel2")
+                .addName(Citations.PROJ4,   "lat_2"), true);  // TODO: default value should
be NaN
+        /*
+         * Remove the EPSG name and identifier at least for the scale factor, because its
meaning does not fit well
+         * in this context. The EPSG name is "Scale factor at natural origin" while actually
the scale factor applied
+         * here would rather be at the standard parallels.
+         */
+        SCALE_FACTOR = createScale(builder
+                .addNamesAndIdentifiers(Mercator2SP.SCALE_FACTOR)
+                .setRemarks(notFormalParameter("Lambert Conic Conformal (1SP)")).setDeprecated(true));
+
+        PARAMETERS = builder
+            .addIdentifier(              "9802")
+            .addName(                    "Lambert Conic Conformal (2SP)")
+            .addName(Citations.OGC,      "Lambert_Conformal_Conic_2SP")
+            .addName(Citations.ESRI,     "Lambert_Conformal_Conic")
+            .addName(Citations.NETCDF,   "LambertConformal")
+            .addName(Citations.GEOTIFF,  "CT_LambertConfConic_2SP")
+            .addName(Citations.GEOTIFF,  "CT_LambertConfConic")
+            .addName(Citations.PROJ4,    "lcc")
+            .addIdentifier(Citations.GEOTIFF,  "8")
+            .addIdentifier(Citations.MAP_INFO, "3")
+            .addIdentifier(Citations.S57,      "6")
+            .createGroupForMapProjection(
+                    LATITUDE_OF_FALSE_ORIGIN,
+                    LONGITUDE_OF_FALSE_ORIGIN,
+                    STANDARD_PARALLEL_1,
+                    STANDARD_PARALLEL_2,
+                    SCALE_FACTOR,
+                    EASTING_AT_FALSE_ORIGIN,
+                    NORTHING_AT_FALSE_ORIGIN);
+    }
+
+    /**
+     * Constructs a new provider.
+     */
+    public LambertConformal2SP() {
+        super(PARAMETERS);
+    }
+}

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

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

Added: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalBelgium.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalBelgium.java?rev=1673294&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalBelgium.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalBelgium.java
[UTF-8] Mon Apr 13 21:52:51 2015
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.referencing.provider;
+
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.apache.sis.parameter.ParameterBuilder;
+import org.apache.sis.metadata.iso.citation.Citations;
+
+
+/**
+ * The provider for <cite>"Lambert Conic Conformal (2SP Belgium)"</cite> projection
(EPSG:9803).
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @author  Rueben Schulz (UBC)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ *
+ * @see <a href="http://www.remotesensing.org/geotiff/proj_list/lambert_conic_conformal_2sp_belgium.html">Lambert
Conic Conformal 2SP (Belgium) on RemoteSensing.org</a>
+ */
+public final class LambertConformalBelgium extends AbstractLambert {
+    /**
+     * For cross-version compatibility.
+     */
+    private static final long serialVersionUID = -6388030784088639876L;
+
+    /**
+     * The group of all parameters expected by this coordinate operation.
+     */
+    public static final ParameterDescriptorGroup PARAMETERS;
+    static {
+        final ParameterBuilder builder = builder();
+
+        PARAMETERS = builder
+            .addIdentifier(              "9803")
+            .addName(                    "Lambert Conic Conformal (2SP Belgium)")
+            .addName(Citations.OGC,      "Lambert_Conformal_Conic_2SP_Belgium")
+            .addName(Citations.ESRI,     "Lambert_Conformal_Conic_2SP_Belgium")
+            .addIdentifier(Citations.MAP_INFO, "19")
+            .addIdentifier(Citations.S57,       "6")
+            .createGroupForMapProjection(
+                    LambertConformal2SP.LATITUDE_OF_FALSE_ORIGIN,
+                    LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN,
+                    LambertConformal2SP.STANDARD_PARALLEL_1,
+                    LambertConformal2SP.STANDARD_PARALLEL_2,
+                    LambertConformal2SP.EASTING_AT_FALSE_ORIGIN,
+                    LambertConformal2SP.NORTHING_AT_FALSE_ORIGIN);
+    }
+
+    /**
+     * Constructs a new provider.
+     */
+    public LambertConformalBelgium() {
+        super(PARAMETERS);
+    }
+}

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

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

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java?rev=1673294&r1=1673293&r2=1673294&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java
[UTF-8] Mon Apr 13 21:52:51 2015
@@ -83,9 +83,12 @@ public final class Mercator2SP extends A
         /*
          * Remove the EPSG name and identifier at least for the scale factor, because its
meaning does not fit well
          * in this context. The EPSG name is "Scale factor at natural origin" while actually
the scale factor applied
-         * here would rather be at the standard parallel.
+         * here would rather be at the standard parallel. We keep the OGC, ESRI and Proj.4
names because they are just
+         * "scale_factor" or "k", which is vague enough for the purpose of this non-standard
parameter.
          */
         SCALE_FACTOR = createScale(exceptEPSG(Mercator1SP.SCALE_FACTOR, builder)
+                .rename(Citations.NETCDF,  (String[]) null)  // "scale_factor_at_projection_origin"
is too specific.
+                .rename(Citations.GEOTIFF, (String[]) null)  // "ScaleAtNatOrigin" is too
specific.
                 .setRemarks(remarks).setDeprecated(true));
 
         PARAMETERS = builder.setDeprecated(false)

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=1673294&r1=1673293&r2=1673294&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] Mon Apr 13 21:52:51 2015
@@ -53,7 +53,7 @@ public class RegionalMercator extends Ab
     public static final String IDENTIFIER = "1044";
 
     /**
-     * The operation parameter descriptor for the <cite>Latitude of false origin</cite>
parameter value.
+     * The operation parameter descriptor for the <cite>Latitude of false origin</cite>
(φf) parameter value.
      * Valid values range is (-90 … 90)° and default value is 0°.
      */
     public static final ParameterDescriptor<Double> LATITUDE_OF_FALSE_ORIGIN;
@@ -77,19 +77,20 @@ public class RegionalMercator extends Ab
     static {
         final ParameterBuilder builder = builder();
 
-        LATITUDE_OF_FALSE_ORIGIN = createLatitude(builder
+        LATITUDE_OF_FALSE_ORIGIN = createLatitude(exceptEPSG(Mercator1SP.LATITUDE_OF_ORIGIN,
builder
                 .addIdentifier("8821")
-                .addName("Latitude of false origin"), false);
+                .addName("Latitude of false origin"))
+                .rename(Citations.GEOTIFF, "FalseOriginLat"), false);
 
-        EASTING_AT_FALSE_ORIGIN = createShift(builder
+        EASTING_AT_FALSE_ORIGIN = createShift(exceptEPSG(FALSE_EASTING, builder
                 .addIdentifier("8826")
-                .addName("Easting at false origin")
-                .addName(sameNameAs(Citations.OGC, FALSE_EASTING)));
+                .addName("Easting at false origin"))
+                .rename(Citations.GEOTIFF, "FalseOriginEasting"));
 
-        NORTHING_AT_FALSE_ORIGIN = createShift(builder
+        NORTHING_AT_FALSE_ORIGIN = createShift(exceptEPSG(FALSE_NORTHING, builder
                 .addIdentifier("8827")
-                .addName("Northing at false origin")
-                .addName(sameNameAs(Citations.OGC, FALSE_NORTHING)));
+                .addName("Northing at false origin"))
+                .rename(Citations.GEOTIFF, "FalseOriginNorthing"));
 
         PARAMETERS = builder
             .addIdentifier(IDENTIFIER)

Modified: sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod?rev=1673294&r1=1673293&r2=1673294&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
[UTF-8] Mon Apr 13 21:52:51 2015
@@ -10,3 +10,5 @@ org.apache.sis.internal.referencing.prov
 org.apache.sis.internal.referencing.provider.RegionalMercator
 org.apache.sis.internal.referencing.provider.MillerCylindrical
 org.apache.sis.internal.referencing.provider.LambertConformal1SP
+org.apache.sis.internal.referencing.provider.LambertConformal2SP
+org.apache.sis.internal.referencing.provider.LambertConformalBelgium

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java?rev=1673294&r1=1673293&r2=1673294&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java
[UTF-8] Mon Apr 13 21:52:51 2015
@@ -60,7 +60,9 @@ public final strictfp class AllProviders
             PseudoMercator.class,
             RegionalMercator.class,
             MillerCylindrical.class,
-            LambertConformal1SP.class
+            LambertConformal1SP.class,
+            LambertConformal2SP.class,
+            LambertConformalBelgium.class
         };
     }
 

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java?rev=1673294&r1=1673293&r2=1673294&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
[UTF-8] Mon Apr 13 21:52:51 2015
@@ -94,7 +94,8 @@ public final class CoordinateOperationMe
     /**
      * Values returned by {@link #category(OperationMethod)}.
      */
-    private static final int PROJECTION = 1, CONVERSION = 2, TRANSFORMATION = 3;
+    private static final int CYLINDRICAL_PROJECTION = 1, CONIC_PROJECTION = 2,
+            PLANAR_PROJECTION = 3, CONVERSION = 4, TRANSFORMATION = 5;
 
     /**
      * Parameters to default to the latitude of origin. We can hardly detect those cases
@@ -103,9 +104,9 @@ public final class CoordinateOperationMe
      * @todo Not yet completed.
      */
     private final GeneralParameterDescriptor defaultToLatitudeOfOrigin[] = {
-//      AlbersEqualArea            .PARAMETERS.descriptor("Latitude of 1st standard parallel"),
-//      LambertConformal2SP        .PARAMETERS.descriptor("Latitude of 1st standard parallel"),
-//      LambertConformal2SP.Belgium.PARAMETERS.descriptor("Latitude of 1st standard parallel")
+//      AlbersEqualArea        .PARAMETERS.descriptor("Latitude of 1st standard parallel"),
+        LambertConformal2SP    .PARAMETERS.descriptor("Latitude of 1st standard parallel"),
+        LambertConformalBelgium.PARAMETERS.descriptor("Latitude of 1st standard parallel")
     };
 
     /**
@@ -115,9 +116,9 @@ public final class CoordinateOperationMe
      * @todo Not yet completed.
      */
     private final GeneralParameterDescriptor defaultToStandardParallel1[] = {
-//      AlbersEqualArea            .PARAMETERS.descriptor("Latitude of 2nd standard parallel"),
-//      LambertConformal2SP        .PARAMETERS.descriptor("Latitude of 2nd standard parallel"),
-//      LambertConformal2SP.Belgium.PARAMETERS.descriptor("Latitude of 2nd standard parallel")
+//      AlbersEqualArea        .PARAMETERS.descriptor("Latitude of 2nd standard parallel"),
+        LambertConformal2SP    .PARAMETERS.descriptor("Latitude of 2nd standard parallel"),
+        LambertConformalBelgium.PARAMETERS.descriptor("Latitude of 2nd standard parallel")
     };
 
     /**
@@ -151,21 +152,22 @@ public final class CoordinateOperationMe
      * @throws IOException if an error occurred while writing to the file.
      */
     public CoordinateOperationMethodsHTML() throws IOException {
-        super("CoordinateOperationMethods.html", "Apache SIS™ Coordinate Operation Methods");
+        super("CoordinateOperationMethods.html", "Apache SIS Coordinate Operation Methods");
         domainOfValidity = Collections.emptyMap(); // TODO: not yet available.
         rangeFormat = new RangeFormat(LOCALE);
-        int p = openTag("p");
+        final int header = openTag("header");
+        println("h1", "Apache SIS™ Coordinate Operation Methods");
+        openTag("p");
         println("The following tables summarize the coordinate operation methods known to
Apache SIS, together with the recognized parameters.");
         println("Unless otherwise noticed, all parameters are mandatory");
         println("(in the sense that they should always be shown in forms, regardless of whether
they have default value),");
         println("but two of them are handled in a special way: the <code>semi-major</code>
and <code>semi-minor</code> parameters.");
         println("Those two parameters are needed for all map projections, but usually do
not need to be specified explicitely since they are inferred from the ellipsoid.");
         println("The only exception is when <a href=\"http://sis.apache.org/apidocs/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.html\">creating
parameterized transforms directly</a>.");
-        closeTags(p);
-        p = openTag("p");
+        reopenTag("p");
         println("All map projections support also implicit <code>earth_radius</code>
and <code>inverse_flattening</code> parameters (not shown below).");
         println("Read and write operations on those implicit parameters are delegated to
the <code>semi-major</code> and <code>semi-minor</code> parameters.");
-        closeTags(p);
+        closeTags(header);
     }
 
     /**
@@ -175,9 +177,9 @@ public final class CoordinateOperationMe
      * @throws IOException if an error occurred while writing to the file.
      */
     public void writeIndex(final Iterable<? extends OperationMethod> methods) throws
IOException {
+        final int nav = openTag("nav");
         println("p", "<b>Table of content:</b>");
-        final int ul = openTag("ul");
-        int innerUL  = ul + 1;
+        int innerUL  = openTag("ul") + 1;
         int category = 0;
         for (final OperationMethod method : methods) {
             final int nc = category(method);
@@ -185,9 +187,11 @@ public final class CoordinateOperationMe
                 closeTags(innerUL);
                 reopenTag("li");
                 switch (nc) {
-                    case PROJECTION:     println("Projections");    break;
-                    case CONVERSION:     println("Conversions");    break;
-                    case TRANSFORMATION: println("Tranformations"); break;
+                    case CYLINDRICAL_PROJECTION: println("Cylindrical projections"); break;
+                    case CONIC_PROJECTION:       println("Conic projections");       break;
+                    case PLANAR_PROJECTION:      println("Planar projections");      break;
+                    case CONVERSION:             println("Conversions");             break;
+                    case TRANSFORMATION:         println("Tranformations");          break;
                     default: throw new AssertionError(category);
                 }
                 innerUL = openTag("ul");
@@ -195,7 +199,7 @@ public final class CoordinateOperationMe
             }
             println("li", "<a href=\"#" + getAnchor(method) + "\">" + escape(method.getName().getCode())
+ "</a>");
         }
-        closeTags(ul);
+        closeTags(nav);
     }
 
     /**
@@ -205,11 +209,15 @@ public final class CoordinateOperationMe
      * @throws IOException if an error occurred while writing to the file.
      */
     public void write(final OperationMethod method) throws IOException {
+        final int article = openTag("article");
+        final int header = openTag("header");
         println("h2 id=\"" + getAnchor(method) + '"', escape(method.getName().getCode()));
+        closeTags(header);
         final int blockquote = openTag("blockquote");
         writeIdentification(method);
         writeParameters(method.getParameters());
         closeTags(blockquote);
+        closeTags(article);
     }
 
     /**
@@ -487,9 +495,11 @@ public final class CoordinateOperationMe
      */
     private static int category(final OperationMethod method) {
         final Class<?> c = ((DefaultOperationMethod) method).getOperationType();
-        if (Projection    .class.isAssignableFrom(c)) return PROJECTION;
-        if (Conversion    .class.isAssignableFrom(c)) return CONVERSION;
-        if (Transformation.class.isAssignableFrom(c)) return TRANSFORMATION;
+        if (CylindricalProjection.class.isAssignableFrom(c)) return CYLINDRICAL_PROJECTION;
+        if (ConicProjection      .class.isAssignableFrom(c)) return CONIC_PROJECTION;
+        if (PlanarProjection     .class.isAssignableFrom(c)) return PLANAR_PROJECTION;
+        if (Conversion           .class.isAssignableFrom(c)) return CONVERSION;
+        if (Transformation       .class.isAssignableFrom(c)) return TRANSFORMATION;
         return 0;
     }
 

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java?rev=1673294&r1=1673293&r2=1673294&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java
[UTF-8] Mon Apr 13 21:52:51 2015
@@ -80,10 +80,10 @@ public abstract class HTMLGenerator impl
 
     /**
      * Creates a new instance which will write in the given file.
-     * This constructor immediately writes the HTML header up to the {@code <h1>} line,
inclusive.
+     * 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 and the title to write as {@code <h1>} line.
+     * @param  title The document title.
      * @throws IOException if the file can not be created (e.g. because it already exists).
      */
     protected HTMLGenerator(final String filename, final String title) throws IOException
{
@@ -109,12 +109,11 @@ public abstract class HTMLGenerator impl
         out.write(margin);
         out.write("<meta charset=\"" + ENCODING + "\"/>");
         out.newLine();
-        println("title", CharSequences.replace(title, "™", ""));
+        println("title", title);
         openTag("style type=\"text/css\" media=\"all\"");
         println("@import url(\"./reports.css\");");
         closeTags(head);
         openTag("body");
-        println("h1", title);
     }
 
     /**



Mime
View raw message