zeke / all-the-cities

🌆 All the 138,398 cities of the world with a population of at least 1000 inhabitants, in a big JSON array.
http://npm.im/all-the-cities
MIT License
281 stars 42 forks source link

More compact data #2

Closed mourner closed 7 years ago

mourner commented 7 years ago

cities.json is 33.6MB, which is a bit on the heavy side for an NPM module, and takes about a second to load in Node.

Both size and init time could be significantly reduced by using a compact binary format, such as Protocol Buffers, combined with a fast decoder such as https://github.com/mapbox/pbf.

@zeke are you up for that? The only drawback is making the module work in browsers will get slightly trickier, but on the other hand it's not very viable currently with that size.

zeke commented 7 years ago

@mourner totally up for that!

zeke commented 7 years ago

only drawback is making the module work in browsers will get slightly trickier

That's fine. I didn't really picture the browser as a target for this module.