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 = CRS.decode("EPSG:4326");
final GeodeticCalculator gc = new GeodeticCalculator(crs);
gc.setStartingGeographicPoint(-180.0, 0.0);
gc.setDestinationGeographicPoint(+180.0, 0.0);
final double d1 = gc.getOrthodromicDistance();
System.out.println("*** Earth circumference (1) = " + d1);
gc.setDestinationGeographicPoint(0.0, 0.0);
final double d21 = gc.getOrthodromicDistance(); // this is line #23
gc.setDestinationGeographicPoint(+180.0, 0.0);
final double d22 = gc.getOrthodromicDistance();
System.out.println("*** Earth circumference (2) = " + (d21 + d22));
}
}
the output, when running maven with the above single test, looks like
so:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running ...TestGeodeticCalculator
*** Earth circumference (1) = 0.0
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.194 sec <<<
FAILURE!
Results :
Tests in error:
testGeodeticCalculator(...TestGeodeticCalculator)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
the surefire-report for the same test shows:
-------------------------------------------------------------------------------
Test set: au.com.forge.mapIntelligence.ogc.TestGeodeticCalculator
-------------------------------------------------------------------------------
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
Ellipsoid: WGS 84
Source point: 180�00.0'W 00�00.0'N
Target point: 00�00.0'E 00�00.0'N
Azimuth: 00�00.0'
Orthodromic distance: 20004016.5 m
at
org.geotools.referencing.GeodeticCalculator.getOrthodromicDistance(GeodeticCalculator.java:785)
at
...TestGeodeticCalculator.testGeodeticCalculator(TestGeodeticCalculator.java: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
pgpHwwj1hR2oz.pgp
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
