Skip to main content
Spelling and grammar
Source Link
Toby Speight
  • 88.6k
  • 14
  • 104
  • 327

You need a spatial structure to speed up lookup for closest zip code. I willwould approach this problem in two steps:

  1. Create a point quad tree and add all known zip codes to it. Latitude and longitude can be as used as coordinates of the tree node and zip code as value.
  2. For every zip entry in your myFile, Queryquery the quad tree for closest zip code.

There are many implementationimplementations of quad tree available as python libraryPython libraries. You can pick one of them.

You need a spatial structure to speed up lookup for closest zip code. I will approach this problem in two steps

  1. Create a point quad tree and add all known zip codes to it. Latitude and longitude can be as used as coordinates of the tree node and zip code as value.
  2. For every zip entry in your myFile, Query the quad tree for closest zip code.

There are many implementation of quad tree available as python library. You can pick one of them.

You need a spatial structure to speed up lookup for closest zip code. I would approach this problem in two steps:

  1. Create a point quad tree and add all known zip codes to it. Latitude and longitude can be as used as coordinates of the tree node and zip code as value.
  2. For every zip entry in your myFile, query the quad tree for closest zip code.

There are many implementations of quad tree available as Python libraries. You can pick one of them.

Source Link
nkvns
  • 399
  • 2
  • 6

You need a spatial structure to speed up lookup for closest zip code. I will approach this problem in two steps

  1. Create a point quad tree and add all known zip codes to it. Latitude and longitude can be as used as coordinates of the tree node and zip code as value.
  2. For every zip entry in your myFile, Query the quad tree for closest zip code.

There are many implementation of quad tree available as python library. You can pick one of them.