all the cities
v3.1.0
Все 138 398 городов мира с населением не менее 1000 жителей, в большом массиве JSON, который готов к импорту в MongoDB для geoSpatialSearch
.
Получен из пакета NPM Cities с 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
Никто
Грань