zeke / all-the-cities Goto Github PK
View Code? Open in Web Editor NEW๐ All the 138,398 cities of the world with a population of at least 1000 inhabitants, in a big JSON array.
Home Page: http://npm.im/all-the-cities
License: MIT License
๐ All the 138,398 cities of the world with a population of at least 1000 inhabitants, in a big JSON array.
Home Page: http://npm.im/all-the-cities
License: MIT License
Hi, it would be helpful if you would like to add the field of timezone, eg. Asia/Jakarta
to the json exported.
Guangzhou has about 14 millions inhabitants (http://worldpopulationreview.com/world-cities/guangzhou-population/). However according to this library, it's only 3152825 (above 3 millions).
For example
t.ok(cities[0].name, 'cities have a lat')
Shouldn't this be
t.ok(cities[0].lat, 'cities have a lat')
Same for cities[0].country
and cities[0].lon
.
Hi!
Do you want add feature "findCitiesByCountry" with cache ?
I am trying to figure out how to get cities 500 in a pbf format.
Could you point me to the right direction, please,
Thanks
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.
Hi,
Currently, the library doesn't return the state of the city and to some cases, there are cities duplicated in the same country, but it is correct because are a different state.
How can I get the state of the city, this enchantment is scheduled to next version or I need to use another library to complement the information.
Case need another library, could you me indicate one?
Thanks a lot,
https://en.wikipedia.org/wiki/Surat
Is there a workaround for this?
With the function below I get list of cities in a certain country which includes lon and lat.
module.exports.getAreas = function (country) {
const citiesArray = cities.filter(city => {
return city.country.match(country)
});
return _.sortBy(citiesArray, o => o.name)
};
I want a way to use lat and lon to guess the city from this lib. Something like this:
module.exports.findArea = function (lon, lat) {
return ........
};
I know its not the purpose of the lab, Any advice on how I can do it?
Hi Zeke,
I created this repo based on your repo and included a new version of cities-with-1000 and it worked at the time for me.
I want to restart the process by creating a better version of cities with 1000 and would need your help if you're around, let me know?
Best.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.