|
From: Michael B. <mic...@gm...> - 2009-06-02 02:25:24
|
Hi Abel, > Hello michael. I can a problem with GeodeticCalculator. I don’t know two > point, I know distance. When calculate two coordinate whit the distance? > You need: 1. starting location 2. distance 3. azimuth (= bearing = angle) Here's an example... GeodeticCalculator calc = new GeodeticCalculator( myCRS ); // you can do this... double longitude = ... // in decimal degrees double latitude = ... // calc.setStartingGeographicPoint( longitude, latitude ); // or this... DirectPosition startPos = ... calc.setStartingPosition( startPos ); // then set the distance and bearing from the start point double distance = ... double dir = ... // bearing in decimal degrees (-180 : 180) calc.setDirection( dir, distance ); // now get the destination DirectPosition destination = calc.getDestinationPosition(); You'll need to put the above code in a try - catch block for TransformException. Hope this helps. Let us know how you go. Michael |