all the cities
v3.1.0
최소 1000 명 이상의 인구를 보유한 세계의 138,398 개 도시는 geoSpatialSearch
위해 MongoDB에서 수입 될 준비가 된 큰 JSON 어레이에 있습니다.
도시에서 10000 NPM 패키지에서 파생 된 것은 geonames.org 데이터에서 나왔습니다.
Nodejs.org에서 Node를 다운로드하여 아직 설치하지 않은 경우 설치하십시오.
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