Как узнать расстояние между координатами?

Вы уверены, что все строки имеют не менее 2 столбцов? Вы можете попробовать что-то вроде, просто чтобы проверить?:

sc.textFile("file.csv") \
    .map(lambda line: line.split(",")) \
    .filter(lambda line: len(line)>1) \
    .map(lambda line: (line[0],line[1])) \
    .collect()

В качестве альтернативы вы можете распечатать виновника (если есть):

sc.textFile("file.csv") \
    .map(lambda line: line.split(",")) \
    .filter(lambda line: len(line)<=1) \
    .collect()
40
задан rmaddy 23 October 2015 в 14:28
поделиться

1 ответ

import UIKit
import CoreLocation

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        var currentLocation = CLLocation(latitude: 23.1929, longitude: 72.6156)
        var DestinationLocation = CLLocation(latitude: 23.0504, longitude: 72.4991)
        var distance = currentLocation.distance(from: DestinationLocation) / 1000
        print(String(format: "The distance to my buddy is %.01fkm", distance))
    }
}
0
ответ дан 26 November 2019 в 22:22
поделиться
Другие вопросы по тегам:

Похожие вопросы: