Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2: Update Methods #8

Open
5 tasks
crhallberg opened this issue Feb 3, 2023 · 0 comments
Open
5 tasks

v2: Update Methods #8

crhallberg opened this issue Feb 3, 2023 · 0 comments
Assignees
Milestone

Comments

@crhallberg
Copy link
Owner

crhallberg commented Feb 3, 2023

  • k-d tree position search
  • minify tree structure data (Alton tree?)
  • remove zip-sectioned array
  • Add Typescript jsdocs
  • Build types definition Suggestion - Add types #10

Right now, we are using two naïve functions for look ups and other options are available.

By Location

We are chunking the latitude and longitude into integer "zones", which approximates the functionality of a rigid QuadTree. A QuadTree would be better to cover edge cases like when the lat is 37.1 and the closest is 36.9. Even better would be a kd-tree to search the space. Both could be pre-calculated in equal space to the current zoned array.

By ZipCode

For the zip 12345, I'm storing the data in places[1][2][3][4][5]. This does not improve performance or file size, I think it was so we can load the data by chunk rather than all at once. A prefix tree might do better with we want to chuck the data. If not, a straight HashMap would probably be best (places["12345"]).

I might also remove this.

Versioning

I think semantic versioning with the last data update would work nicely:

`{major}.{minor}.{patch}+{metadata}’

2.0.0+20230216 (data update)

@crhallberg crhallberg self-assigned this Feb 3, 2023
@crhallberg crhallberg added this to the v2 milestone Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant