sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1807914 - /sis/release-test/maven/src/main/java/org/apache/sis/test/referencing/CoordinateOperationComparator.java
Date Sat, 09 Sep 2017 14:59:25 GMT
Author: desruisseaux
Date: Sat Sep  9 14:59:25 2017
New Revision: 1807914

URL: http://svn.apache.org/viewvc?rev=1807914&view=rev
Log:
Add a test cas for a planet having the same eccentricity than Jupiter, but scaled at Earth
size for comparison purpose.

Modified:
    sis/release-test/maven/src/main/java/org/apache/sis/test/referencing/CoordinateOperationComparator.java

Modified: sis/release-test/maven/src/main/java/org/apache/sis/test/referencing/CoordinateOperationComparator.java
URL: http://svn.apache.org/viewvc/sis/release-test/maven/src/main/java/org/apache/sis/test/referencing/CoordinateOperationComparator.java?rev=1807914&r1=1807913&r2=1807914&view=diff
==============================================================================
--- sis/release-test/maven/src/main/java/org/apache/sis/test/referencing/CoordinateOperationComparator.java
(original)
+++ sis/release-test/maven/src/main/java/org/apache/sis/test/referencing/CoordinateOperationComparator.java
Sat Sep  9 14:59:25 2017
@@ -24,22 +24,23 @@ import org.opengis.geometry.Envelope;
 import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.crs.GeographicCRS;
+import org.opengis.referencing.crs.ProjectedCRS;
 import org.opengis.referencing.operation.*;
 import org.opengis.util.FactoryException;
 import org.apache.sis.geometry.Envelopes;
 import org.apache.sis.geometry.GeneralEnvelope;
-import org.apache.sis.math.Statistics;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
 import org.apache.sis.metadata.iso.extent.Extents;
-import org.apache.sis.internal.util.StandardDateFormat;
 import org.apache.sis.referencing.CRS;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.crs.AbstractCRS;
 import org.apache.sis.referencing.cs.AxesConvention;
-import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.internal.metadata.ReferencingServices;
+import org.apache.sis.internal.util.StandardDateFormat;
+import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.io.TableAppender;
+import org.apache.sis.math.Statistics;
 import org.apache.sis.storage.gdal.Proj4;
 
 
@@ -70,20 +71,53 @@ public final class CoordinateOperationCo
             throws FactoryException, TransformException, IOException
     {
         switch (n) {
-             case  1: return new CoordinateOperationComparator("Cylindrical Equal Area (Spherical)",
4053, 3410);
-             case  2: return new CoordinateOperationComparator("Cylindrical Equal Area",
            4326, 6933);
-             case  3: return new CoordinateOperationComparator("Pseudo-Mercator",       
            4326, 3857);
-             case  4: return new CoordinateOperationComparator("Mercator",              
            4326, 3395);
-             case  5: return new CoordinateOperationComparator("Lambert Conic Conformal",
           4269, 3978);
-             case  6: return new CoordinateOperationComparator("Polar stereographic",   
            4326, 3031);
-             case  7: return new CoordinateOperationComparator("Albert Equal Area",     
            4269, 5070);
-             case  8: return new CoordinateOperationComparator("Mercator 41 to Mercator",
           3994, 3395);
-             case  9: return new CoordinateOperationComparator("Tokyo to JGD2000",      
            4301, 4612);
-             case 10: return new CoordinateOperationComparator("Tokyo to JGD2000 in UTM zone
54",    3095, 3100);
-             case 11: return new CoordinateOperationComparator("OSGB 1936 to ED50 (UKOOA)",
         4277, 4230);
-             case 12: return new CoordinateOperationComparator("Martinique 1938 to RGAF09",
         4625, 5489);
-             case 13: return new CoordinateOperationComparator("Stereographic to stereographic",
    2986, 7082);
-             default: return null;
+            case  1: return new CoordinateOperationComparator("Cylindrical Equal Area (Spherical)",
4053, 3410);
+            case  2: return new CoordinateOperationComparator("Cylindrical Equal Area", 
           4326, 6933);
+            case  3: return new CoordinateOperationComparator("Pseudo-Mercator",        
           4326, 3857);
+            case  4: return new CoordinateOperationComparator("Mercator",               
           4326, 3395);
+            case  5: return new CoordinateOperationComparator("Lambert Conic Conformal",
           4269, 3978);
+            case  6: return new CoordinateOperationComparator("Polar stereographic",    
           4326, 3031);
+            case  7: return new CoordinateOperationComparator("Albert Equal Area",      
           4269, 5070);
+            case  8: return new CoordinateOperationComparator("Mercator 41 to Mercator",
           3994, 3395);
+            case  9: return new CoordinateOperationComparator("Tokyo to JGD2000",       
           4301, 4612);
+            case 10: return new CoordinateOperationComparator("Tokyo to JGD2000 in UTM zone
54",    3095, 3100);
+            case 11: return new CoordinateOperationComparator("OSGB 1936 to ED50 (UKOOA)",
         4277, 4230);
+            case 12: return new CoordinateOperationComparator("Martinique 1938 to RGAF09",
         4625, 5489);
+            case 13: return new CoordinateOperationComparator("Stereographic to stereographic",
    2986, 7082);
+            case 14: {
+                /*
+                 * Use the same eccentricity than Jupiter, but scaled to Earth size in order
to
+                 * have distance measurement in the same order of magnitude than other tests.
+                 * The inverse flattening factor is about 15.4144 (compared to 298.26 for
Earth).
+                 * Such planet would have a polar radius of 5964 km instead of 6357 km.
+                 *
+                 * Reference: https://nssdc.gsfc.nasa.gov/planetary/factsheet/jupiterfact.html
+                 */
+                final ProjectedCRS targetCRS = (ProjectedCRS) CRS.fromWKT(
+                        "ProjectedCRS[“Lambert Equal Area on high eccentricity planet”,\n"
+
+                        "  BaseGeodCRS[“High eccentricity planet”,\n" +
+                        "    Datum[“High eccentricity datum”,\n" +
+                        "      Ellipsoid[“Jupiter eccentricity scaled to Earth size”,
6378100.0, 15.414402759810256]],\n" +
+                        "    Unit[“degree”, 0.017453292519943295]],\n" +
+                        "  Conversion[“High eccentricity planet to Lambert Equal Area”,\n"
+
+                        "    Method[“Lambert Cylindrical Equal Area”],\n" +
+                        "    Parameter[“Latitude of 1st standard parallel”, 30]],\n"
+
+                        "  CS[Cartesian, 2],\n" +
+                        "    Axis[“Easting (E)”, east],\n" +
+                        "    Axis[“Northing (N)”, north],\n" +
+                        "    Unit[“metre”, 1],\n" +
+                        "  Scope[“Test only.”],\n" +
+                        "  BBox[-86, -180, 86, 180]]");
+
+                final GeographicCRS sourceCRS = (GeographicCRS) AbstractCRS.castOrCopy(targetCRS.getBaseCRS())
+                        .forConvention(AxesConvention.NORMALIZED);
+
+                return new CoordinateOperationComparator("Jupiter eccentricity scaled to
Earth size",
+                        new String[] {"Apache SIS", "Proj.4"},
+                        targetCRS.getConversionFromBase(),
+                        Proj4.createOperation(sourceCRS, targetCRS, true));
+            }
+            default: return null;
         }
     }
 



Mime
View raw message