I have a dataset of historical routes (lists of lat/lon points) from AIS data. I now have a test route (8 lat/lon points) and I want to find the 10 closest routes in the historical database. How can I do this efficiently?
I could loop through all the routes in the historical dataset, and for each candidate route calculate the best match for the test to that candidate. Best match would be calculated by pairing the first point of the test route to the candidate route and sum distances for the next 7 point, then pairing the first point of the test route to the second point of the candidate and sum, and continue. This is horribly inefficient, and I have 100,000 historical routes to go through.
So, I am thinking about some sort of spatial indexing or binning approach, so I do not have to consider most of the data. Many of the historical route are long though, and go through large areas, so can't really make independent sections.
Is there a known algorithm that solves this?