Skip to content

Instantly share code, notes, and snippets.

@chrisseaton
Created April 24, 2018 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisseaton/b48bb9199e5df5ca174fa60d05f6fc4c to your computer and use it in GitHub Desktop.
Save chrisseaton/b48bb9199e5df5ca174fa60d05f6fc4c to your computer and use it in GitHub Desktop.
import org.apache.sis.distance.DistanceUtils;
public class Distance {
public static void main(String[] args) {
final double aLat = Double.parseDouble(args[0]);
final double aLong = Double.parseDouble(args[1]);
final double bLat = Double.parseDouble(args[2]);
final double bLong = Double.parseDouble(args[3]);
System.out.printf("%f km%n", DistanceUtils.getHaversineDistance(aLat, aLong, bLat, bLong));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment