private List<LatLng> sampleLine(LatLng from, LatLng to, double samplingDistance) { List<LatLng> result = new ArrayList<LatLng>(); double heading = GeoTools.getHeadingFromCoordinates(from, to); double totalLength = GeoTools.getDistance(from, to); double distance = 0; while (distance < totalLength) { result.add(GeoTools.newCoordFromBearingAndDistance(from, heading, distance)); distance += samplingDistance; } return result; }