sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1673235 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/internal/referencing/provider/ main/java/org/apache/sis/referencing/operation/projection/ main/resources/META-INF/services/ test/java/org/apache/sis/interna...
Date Mon, 13 Apr 2015 16:19:15 GMT
Author: desruisseaux
Date: Mon Apr 13 16:19:15 2015
New Revision: 1673235

URL: http://svn.apache.org/r1673235
Log:
Referencing: added a provider for "Lambert Conformal (1SP)".
Not yet connected to the actual map projection formulas.

Added:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractLambert.java
      - copied, changed from r1672278, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java
  (with props)
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.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

Copied: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractLambert.java
(from r1672278, sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractLambert.java?p2=sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractLambert.java&p1=sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java&r1=1672278&r2=1673235&rev=1673235&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractLambert.java
[UTF-8] Mon Apr 13 16:19:15 2015
@@ -16,69 +16,54 @@
  */
 package org.apache.sis.internal.referencing.provider;
 
-import java.util.List;
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
-import org.opengis.parameter.GeneralParameterDescriptor;
-import org.opengis.referencing.operation.CylindricalProjection;
+import org.opengis.referencing.operation.ConicProjection;
 import org.apache.sis.parameter.Parameters;
-import org.apache.sis.referencing.operation.projection.Mercator;
 import org.apache.sis.referencing.operation.projection.NormalizedProjection;
 
 
 /**
- * Base class of providers for all Mercator projections, and for Mercator-like projections.
+ * Base class of providers for all Lambert Conical projections.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.6
  * @version 0.6
  * @module
  */
-public class AbstractMercator extends MapProjection {
+class AbstractLambert extends MapProjection {
     /**
      * For cross-version compatibility.
      */
-    private static final long serialVersionUID = 4478846770971053309L;
+    private static final long serialVersionUID = 4270971056061114243L;
 
     /**
      * The operation parameter descriptor for the <cite>False easting</cite>
(FE) parameter value.
      * Valid values range is unrestricted and default value is 0 metre.
      */
-    public static final ParameterDescriptor<Double> FALSE_EASTING = Equirectangular.FALSE_EASTING;
+    public static final ParameterDescriptor<Double> FALSE_EASTING = Mercator1SP.FALSE_EASTING;
 
     /**
      * The operation parameter descriptor for the <cite>False northing</cite>
(FN) parameter value.
      * Valid values range is unrestricted and default value is 0 metre.
      */
-    public static final ParameterDescriptor<Double> FALSE_NORTHING = Equirectangular.FALSE_NORTHING;
-
-    /**
-     * Returns the given descriptor as an array, excluding the two first elements which are
assumed
-     * to be the axis lengths.This method assumes that all elements in the given list are
instances
-     * of {@link ParameterDescriptor}.
-     *
-     * @throws ArrayStoreException if a {@code descriptors} element is not an instance of
{@link ParameterDescriptor}.
-     */
-    static ParameterDescriptor<?>[] toArray(List<GeneralParameterDescriptor>
descriptors) {
-        descriptors = descriptors.subList(2, descriptors.size());
-        return descriptors.toArray(new ParameterDescriptor<?>[descriptors.size()]);
 // Intentional array subtype.
-    }
+    public static final ParameterDescriptor<Double> FALSE_NORTHING = Mercator1SP.FALSE_NORTHING;
 
     /**
      * For subclass constructors only.
      */
-    AbstractMercator(final ParameterDescriptorGroup parameters) {
+    AbstractLambert(final ParameterDescriptorGroup parameters) {
         super(parameters);
     }
 
     /**
      * Returns the operation type for this map projection.
      *
-     * @return {@code CylindricalProjection.class}
+     * @return {@code ConicProjection.class}
      */
     @Override
-    public final Class<CylindricalProjection> getOperationType() {
-        return CylindricalProjection.class;
+    public final Class<ConicProjection> getOperationType() {
+        return ConicProjection.class;
     }
 
     /**
@@ -88,6 +73,6 @@ public class AbstractMercator extends Ma
      */
     @Override
     protected final NormalizedProjection createProjection(final Parameters parameters) {
-        return new Mercator(this, parameters);
+        return null; // TODO
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java?rev=1673235&r1=1673234&r2=1673235&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java
[UTF-8] Mon Apr 13 16:19:15 2015
@@ -34,7 +34,7 @@ import org.apache.sis.referencing.operat
  * @version 0.6
  * @module
  */
-public class AbstractMercator extends MapProjection {
+class AbstractMercator extends MapProjection {
     /**
      * For cross-version compatibility.
      */

Added: 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=1673235&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java
[UTF-8] Mon Apr 13 16:19:15 2015
@@ -0,0 +1,86 @@
+/*
+ * 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.parameter.ParameterBuilder;
+import org.apache.sis.metadata.iso.citation.Citations;
+
+
+/**
+ * The provider for <cite>"Lambert Conic Conformal (1SP)"</cite> projection (EPSG:9801).
+ *
+ * @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_1sp.html">Lambert
Conic Conformal 1SP on RemoteSensing.org</a>
+ */
+public final class LambertConformal1SP extends AbstractLambert {
+    /**
+     * For cross-version compatibility.
+     */
+    private static final long serialVersionUID = -4243116402872545772L;
+
+    /**
+     * The operation parameter descriptor for the <cite>Latitude of natural origin</cite>
(φ₀) parameter value.
+     * Valid values range is [-90 … 90]° and default value is 0°.
+     */
+    public static final ParameterDescriptor<Double> LATITUDE_OF_ORIGIN = Mercator1SP.LATITUDE_OF_ORIGIN;
+
+    /**
+     * The operation parameter descriptor for the <cite>Longitude of natural origin</cite>
(λ₀) parameter value.
+     * Valid values range is [-180 … 180]° and default value is 0°.
+     */
+    public static final ParameterDescriptor<Double> CENTRAL_MERIDIAN = Mercator1SP.CENTRAL_MERIDIAN;
+
+    /**
+     * 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.
+     */
+    static final ParameterDescriptorGroup PARAMETERS;
+    static {
+        final ParameterBuilder builder = builder();
+        PARAMETERS = builder
+            .addIdentifier(              "9801")
+            .addName(                    "Lambert Conic Conformal (1SP)")
+            .addName(Citations.OGC,      "Lambert_Conformal_Conic_1SP")
+            .addName(Citations.GEOTIFF,  "CT_LambertConfConic_1SP")
+            .addName(Citations.PROJ4,    "lcc")
+            .createGroupForMapProjection(
+                    LATITUDE_OF_ORIGIN,
+                    CENTRAL_MERIDIAN,
+                    SCALE_FACTOR,
+                    FALSE_EASTING,
+                    FALSE_NORTHING);
+    }
+
+    /**
+     * Constructs a new provider.
+     */
+    public LambertConformal1SP() {
+        super(PARAMETERS);
+    }
+}

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

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

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java?rev=1673235&r1=1673234&r2=1673235&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
[UTF-8] Mon Apr 13 16:19:15 2015
@@ -23,7 +23,6 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.operation.MathTransformFactory;
 import org.opengis.referencing.operation.OperationMethod;
 import org.opengis.referencing.operation.TransformException;
-import org.apache.sis.internal.referencing.provider.AbstractMercator;
 import org.apache.sis.internal.referencing.provider.Mercator1SP;
 import org.apache.sis.internal.referencing.provider.Mercator2SP;
 import org.apache.sis.internal.referencing.provider.MercatorSpherical;
@@ -134,8 +133,8 @@ public class Mercator extends Normalized
     private Mercator(final OperationMethod method, final Parameters parameters, final byte
type) {
         super(method, parameters,
                 (type == SPHERICAL) ? Mercator2SP     .STANDARD_PARALLEL        : null, 
   // See note below.
-                (type == REGIONAL ) ? RegionalMercator.EASTING_AT_FALSE_ORIGIN  : AbstractMercator.FALSE_EASTING,
-                (type == REGIONAL ) ? RegionalMercator.NORTHING_AT_FALSE_ORIGIN : AbstractMercator.FALSE_NORTHING);
+                (type == REGIONAL ) ? RegionalMercator.EASTING_AT_FALSE_ORIGIN  : Mercator1SP.FALSE_EASTING,
+                (type == REGIONAL ) ? RegionalMercator.NORTHING_AT_FALSE_ORIGIN : Mercator1SP.FALSE_NORTHING);
         /*
          * Note on above Mercator2SP.STANDARD_PARALLEL argument (used for computing radius
of conformal sphere):
          * according the EPSG guide we should rather use Mercator2SP.LATITUDE_OF_ORIGIN.
But the later is fixed

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=1673235&r1=1673234&r2=1673235&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 16:19:15 2015
@@ -9,3 +9,4 @@ org.apache.sis.internal.referencing.prov
 org.apache.sis.internal.referencing.provider.PseudoMercator
 org.apache.sis.internal.referencing.provider.RegionalMercator
 org.apache.sis.internal.referencing.provider.MillerCylindrical
+org.apache.sis.internal.referencing.provider.LambertConformal1SP

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=1673235&r1=1673234&r2=1673235&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 16:19:15 2015
@@ -59,7 +59,8 @@ public final strictfp class AllProviders
             MercatorSpherical.class,
             PseudoMercator.class,
             RegionalMercator.class,
-            MillerCylindrical.class
+            MillerCylindrical.class,
+            LambertConformal1SP.class
         };
     }
 



Mime
View raw message