// Test points for the Aitoff projection
//
// (C) 2016, Open Source Geospatial Foundation (OSGeo)
//
// The following test points were calculated with libproj4 utility "cs2cs" 
// cs2cs -v +datum=WGS84 +proj=lonlat +to +datum=WGS84 +proj=aitoff
//
// Andrea Aime - March 2 2011
//
// --------------------------------------------------------------------------
// How to run this script:
//
//    chdir org/geotools/referencing/test-data/scripts
//    java -ea org.geotools.referencing.ScriptRunner Cassini.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["WGS84",  DATUM["WGS84",  SPHEROID["WGS84",  6378137.0, 298.257223563]], PRIMEM["Greenwich", 0.0], UNIT["degree",0.017453292519943295], AXIS["Longitude",EAST], AXIS["Latitude",NORTH]]

////////////////////////////////////////////
// Cassini

set _cassini_ = PROJCS["Cassini_Soldner", _WGS84_, PROJECTION["Cassini_Soldner"], UNIT["m", 1.0], AXIS["Easting", EAST], AXIS["Northing", NORTH]]

source crs = _WGS84_
target crs = _cassini_
test tolerance = (0.01, 0.01)

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

source pt = (10, 10)
target pt = (1096227.78, 1122674.06)

source pt = (30, 30)
target pt = (2864143.03, 3729508.72)

source pt = (-180, 90)
target pt = (0.00, 10001965.73)

source pt = (180, 90)
target pt = (0.00, 10001965.73)

source pt = (-180, 0)
target pt = (-20037508.34, 0.00)

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

source crs = _cassini_
target crs = _WGS84_
test tolerance = (0.01, 0.01)

source pt = (1000000, 1000000)
target pt = (9.093582, 8.930397)

source pt = (1000000, -1000000)
target pt = (9.093582, -8.930397)

source pt = (-1000000, 1000000)
target pt = (-9.093582, 8.930397)

source pt = (5000000, 5000000)
target pt = (56.928312, 31.084013)

source pt = (5000000, -5000000)
target pt = (56.928312, -31.084013)

source pt = (-5000000, 5000000)
target pt = (-56.928312, 31.084013)

source pt = (-5000000, -5000000)
target pt = (-56.928312, -31.084013)