模糊匹配坐标列表(Golang)

I'm trying to create a simple tool which will allow a user to specify two places around Seattle.

I'm working with the WSDOT traffic data set. An example of the output can be found here: https://gist.github.com/jaxxstorm/0ab818b300f65cf3a46cc01dbc35bf60

What I'd like to be able to do is specify two locations like:

Bellevue Seattle

and then lookup all traffic times for those locations.

I'm considering doing a reverse geocode like this answer but I want it to be "fuzzy" in that I don't want people to have to specify exact locations. I also suspect the processing time for this might be long as I'd have to loop through the list, and reverse lookup all the coordinates which could take a short while

Is there any better alternatives for processing this data in this way? I'm writing the tool in Go

You have two problems for each set of points (start and end):

  1. Convert locations to lat lon
  2. Fuzzy match lat,lon to this traffic data (which contains lat,lon)

The location to lat,lon conversion is pretty straightforward using a reverse geocoding api like the one available from google.

To match lat,lon fuzzily, you could either truncate lat lon and store that as a hash (so that you're storing approximate matches), then lookup data that way, or you could do a radius calc and pick results within that radius (this requires some math involving the radius of the earth which you can look up easily enough, it can be done in sql if your data is in a db for example).