all the cities
v3.1.0
少なくとも1000人の住民の人口を持つ世界の138,398の都市はすべて、 geoSpatialSearch
のためにMongodbに輸入する準備ができている大きなJSONアレイにあります。
1000 npmの都市の都市から派生したパッケージは、geonames.orgのデータから生まれました。
Nodejs.orgでノードをダウンロードして、まだインストールしていない場合はインストールしてください。
npm install all-the-cities --save
const cities = require ( 'all-the-cities' ) ;
cities . filter ( city => city . name . match ( 'Albuquerque' ) ) ;
/*
[{
cityId: '5454711',
name: 'Albuquerque',
country: 'US',
altCountry: '',
muni: '',
muniSub: '',
featureClass: 'P',
featureCode: 'PPLA2',
adminCode: 'NM',
population: 545852,
loc: {
type: 'Point',
coordinates: [-106.65114, 35.084]
}
}, {
cityId: '5476960',
name: 'Los Ranchos de Albuquerque',
country: 'US',
altCountry: '',
muni: '',
muniSub: '',
featureClass: 'P',
featureCode: 'PPL',
adminCode: 'NM',
population: 6024,
loc: {
type: 'Point',
coordinates: [-106.6428, 35.16199]
}
}]
*/
id - Id of the city ( same in openWeatherMap )
name
altName
country
featureCode
adminCode
population
loc: { type : 'Point' , coordinates : [ 0 , 0 ] }
for * * GEO JSON data ** , a particular format is needed in MongoDB Schema as written in loc field above
npm install
npm test
なし
mit