params.parameter("false_northing") .setValue( 900000.0 );
transform = mtFactory.createParameterizedTransform(params);
if (VERBOSE) {
System.out.println(transform);
}
doTransform(new DirectPosition2D(120.0, -3.0),
new DirectPosition2D(5009726.58, 569150.82), transform);
//spherical test (Snyder p. 266)
params.parameter("semi_major") .setValue( 1.0);
params.parameter("semi_minor") .setValue( 1.0);
params.parameter("central_meridian").setValue(-180.0);
params.parameter("scale_factor") .setValue( 1.0);
params.parameter("false_easting") .setValue( 0.0);
params.parameter("false_northing") .setValue( 0.0);
transform = mtFactory.createParameterizedTransform(params);
if (VERBOSE) {
System.out.println(transform);
}
doTransform(new DirectPosition2D(-75.0, 35.0),
new DirectPosition2D(1.8325957, 0.6528366), transform);
//spherical test 2 (original units for target were feet)
params.parameter("semi_major") .setValue(6370997.0);
params.parameter("semi_minor") .setValue(6370997.0);
params.parameter("central_meridian").setValue( 0.0);
params.parameter("scale_factor") .setValue( 1.0);
params.parameter("false_easting") .setValue( 0.0);
params.parameter("false_northing") .setValue( 0.0);
transform = mtFactory.createParameterizedTransform(params);
if (VERBOSE) {
System.out.println(transform);
}
doTransform(new DirectPosition2D(-123.1, 49.2166666666),
new DirectPosition2D(-13688089.02443480, 6304639.84599441), transform);
//ellipsoidal with latitude of origin not zero, (simone)
params.parameter("semi_major") .setValue(6378137.0);
params.parameter("semi_minor") .setValue(6356752.314245);
params.parameter("latitude_of_origin").setValue( 38.0);
params.parameter("central_meridian") .setValue( 3.03);
params.parameter("scale_factor") .setValue( 1.0);
params.parameter("false_easting") .setValue( 0.0);
params.parameter("false_northing") .setValue( 0.0);
transform = mtFactory.createParameterizedTransform(params);
if (VERBOSE) {
System.out.println(transform);
}
doTransform(new DirectPosition2D(4.999999999999999,26.996561536844165),
new DirectPosition2D(173029.94823812644, 2448819.342941506), transform);
///////////////////////////////////////
// Mercator_2SP tests //
///////////////////////////////////////
if (VERBOSE) {
printParameters("Mercator_2SP");
}
//epsg p25. Note FE and FN are wrong in guide 7. Correct in epsg database v6.3.
params = mtFactory.getDefaultParameters("Mercator_2SP");
params.parameter("semi_major") .setValue(6378245.000);
params.parameter("semi_minor") .setValue(6356863.019);
params.parameter("central_meridian") .setValue( 51.0);
params.parameter("standard_parallel_1").setValue( 42.0);
params.parameter("false_easting") .setValue( 0.0);
params.parameter("false_northing") .setValue( 0.0);
transform = mtFactory.createParameterizedTransform(params);
if (VERBOSE) {
System.out.println(transform);
}
doTransform(new DirectPosition2D(53.0, 53.0),
new DirectPosition2D(165704.29, 5171848.07), transform);
//a spherical case (me)
params = mtFactory.getDefaultParameters("Mercator_2SP");
params.parameter("semi_major") .setValue( 6370997.0);
params.parameter("semi_minor") .setValue( 6370997.0);
params.parameter("central_meridian") .setValue( 180.0);
params.parameter("standard_parallel_1").setValue( 60.0);
params.parameter("false_easting") .setValue( -500000.0);
params.parameter("false_northing") .setValue(-1000000.0);
transform = mtFactory.createParameterizedTransform(params);
if (VERBOSE) {
System.out.println(transform);
}
doTransform(new DirectPosition2D(-123.1, 49.2166666666),
new DirectPosition2D(2663494.1734, 2152319.9230), transform);
}