all the cities
v3.1.0
Alle 138.398 Städte der Welt mit einer Bevölkerung von mindestens 1000 Einwohnern in einem großen JSON -Array, das bereit ist, in MongoDB für geoSpatialSearch
importiert zu werden.
Abgeleitet aus dem Paket mit Städten mit 1000 NPM, das wiederum von Geonames.org-Daten stammt.
Laden Sie den Knoten bei nodejs.org herunter und installieren Sie ihn, wenn Sie es noch nicht getan haben.
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
Keiner
MIT