Skip to content

v2: Update Methods #8

@crhallberg

Description

@crhallberg
  • 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)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions