sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1724963 - /sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
Date Sat, 16 Jan 2016 12:07:58 GMT
Author: desruisseaux
Date: Sat Jan 16 12:07:58 2016
New Revision: 1724963

URL: http://svn.apache.org/viewvc?rev=1724963&view=rev
Log:
Fix wrong EPSG codes for Geographic3D and Geocentric CRS.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java?rev=1724963&r1=1724962&r2=1724963&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
[UTF-8] Sat Jan 16 12:07:58 2016
@@ -59,6 +59,7 @@ import org.apache.sis.referencing.crs.De
 import org.apache.sis.referencing.crs.DefaultVerticalCRS;
 import org.apache.sis.referencing.crs.DefaultGeographicCRS;
 import org.apache.sis.referencing.crs.DefaultGeocentricCRS;
+import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.internal.referencing.provider.TransverseMercator;
 import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.internal.system.SystemListener;
@@ -580,7 +581,7 @@ public enum CommonCRS {
                     }
                     // Use same name and datum than the geographic CRS.
                     final GeographicCRS base = geographic();
-                    object = new DefaultGeographicCRS(IdentifiedObjects.getProperties(base),
base.getDatum(), cs);
+                    object = new DefaultGeographicCRS(properties(base, geo3D), base.getDatum(),
cs);
                     cachedGeo3D = object;
                 }
             }
@@ -638,7 +639,7 @@ public enum CommonCRS {
                     }
                     // Use same name and datum than the geographic CRS.
                     final GeographicCRS base = geographic();
-                    object = new DefaultGeocentricCRS(IdentifiedObjects.getProperties(base),
base.getDatum(), cs);
+                    object = new DefaultGeocentricCRS(properties(base, geocentric), base.getDatum(),
cs);
                     cachedGeocentric = object;
                 }
             }
@@ -1523,6 +1524,15 @@ public enum CommonCRS {
     }
 
     /**
+     * Returns the same properties than the given object, except for the identifier which
is set to the given code.
+     */
+    private static Map<String,?> properties(final IdentifiedObject template, final
short code) {
+        final Map<String,Object> properties = new HashMap<>(IdentifiedObjects.getProperties(template));
+        properties.put(GeographicCRS.IDENTIFIERS_KEY, new NamedIdentifier(Citations.EPSG,
String.valueOf(code)));
+        return properties;
+    }
+
+    /**
      * Returns the EPSG factory to use for creating CRS, or {@code null} if none.
      * If this method returns {@code null}, then the caller will silently fallback on hard-coded
values.
      */



Mime
View raw message