|
From: Raif S. N. <ra...@fo...> - 2007-03-14 01:27:19
|
hello all,
i'm trying to run the following test case with the trunk codebase, maven
2.0.5 and java 1.5.0_11:
public class TestGeodeticCalculator extends TestCase
{
public void testGeodeticCalculator() throws Exception
{
final CoordinateReferenceSystem crs =3D CRS.decode("EPSG:4326");
final GeodeticCalculator gc =3D new GeodeticCalculator(crs);
gc.setStartingGeographicPoint(-180.0, 0.0);
gc.setDestinationGeographicPoint(+180.0, 0.0);
final double d1 =3D gc.getOrthodromicDistance();
System.out.println("*** Earth circumference (1) =3D " + d1);
gc.setDestinationGeographicPoint(0.0, 0.0);
final double d21 =3D gc.getOrthodromicDistance(); // this is line #23
gc.setDestinationGeographicPoint(+180.0, 0.0);
final double d22 =3D gc.getOrthodromicDistance();
System.out.println("*** Earth circumference (2) =3D " + (d21 + d22));
}
}
the output, when running maven with the above single test, looks like
so:
=2D------------------------------------------------------
T E S T S
=2D------------------------------------------------------
Running ...TestGeodeticCalculator
*** Earth circumference (1) =3D 0.0
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.194 sec <=
<< FAILURE!
Results :
Tests in error:=20
testGeodeticCalculator(...TestGeodeticCalculator)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
the surefire-report for the same test shows:
=2D------------------------------------------------------------------------=
=2D-----
Test set: au.com.forge.mapIntelligence.ogc.TestGeodeticCalculator
=2D------------------------------------------------------------------------=
=2D-----
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.194 sec <=
<< FAILURE!
testGeodeticCalculator(...TestGeodeticCalculator) Time elapsed: 1.161 sec =
<<< ERROR!
java.lang.AssertionError: Coordinate Reference System: WGS 84 =
=20
Ellipsoid: WGS 84 =20
Source point: 180=EF=BF=BD00.0'W 00=EF=BF=BD00.0'N
Target point: 00=EF=BF=BD00.0'E 00=EF=BF=BD00.0'N=20
Azimuth: 00=EF=BF=BD00.0' =20
Orthodromic distance: 20004016.5 m =20
at org.geotools.referencing.GeodeticCalculator.getOrthodromicDistance(Geod=
eticCalculator.java:785)
at ...TestGeodeticCalculator.testGeodeticCalculator(TestGeodeticCalculator=
=2Ejava:23)
1/ i wasn't expecting '0' as the result but rather something close to
40,000K. what am i doing wrong?
2/ why is there an assertion failure on computing the distance between
those two points?
TIA + cheers;
rsn
|