How to efficiently calculate distance between GPS points in one dataset and GPS points in another data set using data.table
问题 I am facing a coding (optimization) problem in R. I have a long data set with GPS coordinates (lon, lat, timestamp) and for every row I need to check whether the location is near a bus stop. I have a .csv file with all the bus stops (in the Netherlands). The GPS coordinates file is millions of entries long, but could be split if necessary. The bus stop dataset is around 5500 entries long. Using the code and tips given on, inter alia, these pages: 1) How to efficiently calculate distance