// Test points for the Homolosine projection
//
// (C) 2020, Open Source Geospatial Foundation (OSGeo)
//
// The following test points were calculated with GeoTools itself, applying 
// the Mollweide and Sinusoidal projections. 
// 
//
// Luís Moreira de Sousa - March 2020
//
// --------------------------------------------------------------------------
// The instructions below show how the unit test could be run from the command line. They 
// are known to fail but are left here for reference. Unit tests should be run from an 
// IDE like Eclipse.
//
// 1. Move to the referencing subfolder
// $ cd ./modules/library/referencing
//
// 2. Obtain the Java class path with Maven
// $ mvn dependency:build-classpath -nsu
//
// 3. Execute the tests (replacing _CLASS_PATH_ with the output generated by Maven)
// $ java -cp target/classes:target/test-classes:_CLASS_PATH_ -ea org.geotools.referencing.ScriptRunner src/test/resources/org/geotools/referencing/test-data/scripts/Homolosine.txt
//
// A test is performed every time a "target pt" statement occurs. If the target point computed
// by Geotools is different from the target point declared in this script by an amount greater
// than the value specified in the last "test tolerance" statement, then a failure is reported.
// Inverse transforms are tested if java assertions are enabled.
// If some test fails, "print" statements can be added in this script for debugging purpose:
//
//    print crs            (prints the source and target CRS, and the transform between them)
//    print pts            (prints the source and target points, and their transformed points)


// CRS used for the test 
set _WGS84_  = GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563 ] ], PRIMEM["Greenwich",0.0], UNIT["degree",0.01745329251994328 ]]

////////////////////////////////////////////
// Homolosine

set _homolosine_ = PROJCS["Goode_Homolosine",_WGS84_,PROJECTION["Goode_Homolosine"],UNIT["m",1.0] ]


source crs = _WGS84_
target crs = _homolosine_

test tolerance = (0.01, 0.01)

source pt = (0, 0)
target pt = (0, 0)

source pt = (-10, 0)
target pt = (-1113194.9, 0)

source pt = (-170, 50)
target pt = (-16456381.3828, 5536683.8246)
                       
source pt = (-173, 40)
target pt = (-17357073.5246, 4452779.63173)

source pt = (-173.5, 58.7)
target pt = (-16016676.3535, 6414902.69412)
        
source pt = (-57.1, 39.6)
target pt = (-7452281.29459, 4408251.83541)

source pt = (-10.25, 22.4)
target pt = (-802945.021687, 2493556.59377)

source pt = (38.6, 45.3)
target pt = (4031915.70221, 5035970.98488)

source pt = (-178.2, -88.7)
target pt = (-17965404.8606, -8650934.81518)

source pt = (-121.44, -31.1)
target pt = (-14135609.5641, -3462036.16367)

source pt = (-99.6, -46)
target pt = (-9842168.41699, -5111588.14837)

source pt = (-25.4, -17.4)
target pt = (-3003765.50531, -1936959.1398)
             
source pt = (-14.7, -5.98)
target pt = (-1615376.47563, -665690.554944)
 
source pt = (78.2, -87.95)
target pt = (2894399.20721, -8623913.0394)

source pt = (97.56, -81.7)
target pt = (14356972.8639, -8299320.81875)

source pt = (168.22, -39.7)
target pt = (18001748.1949, -4419383.78449)

source pt = (-180, 8)
target pt = (-19950840.05, 890555.93)

// same as (-170, 50)
source pt = (190, 50) 
target pt = (-16456381.3828, 5536683.8246)

// same as (168.22, -39.7)
source pt = (-191.78, -39.7)
target pt = (18001748.1949, -4419383.78449)

source pt = (-181, 8)
target pt = (19764769.16, 890555.926)

source pt = (180, 8)
target pt = (19875005.298, 890555.926)

// -----------
source crs = _homolosine_
target crs = _WGS84_

test tolerance = (0.0001, 0.0001)

source pt = (0, 0)
target pt = (0, 0)

source pt = (-1113194.9, 0)
target pt = (-10, 0)

source pt = (-17357073.5246, 4452779.63173)
target pt = (-173, 40)

source pt = (-16456381.3828, 5536683.8246)
target pt = (-170, 50)

source pt = (-7452281.29459, 4408251.83541)
target pt = (-57.1, 39.6)

source pt = (14356972.8639, -8299320.81875)
target pt = (97.56, -81.7)  

source pt = (-17965404.8606, -8650934.81518)
target pt = (-178.2, -88.7)

