Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emilioriosvz/geolocation-db-generator
This script creates a geolocation DB in Mongo 🌎 🌍 🌏
https://github.com/emilioriosvz/geolocation-db-generator
Last synced: about 5 hours ago
JSON representation
This script creates a geolocation DB in Mongo 🌎 🌍 🌏
- Host: GitHub
- URL: https://github.com/emilioriosvz/geolocation-db-generator
- Owner: emilioriosvz
- Created: 2018-03-30T14:34:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-21T11:03:08.000Z (almost 4 years ago)
- Last Synced: 2024-03-15T01:40:39.265Z (8 months ago)
- Language: JavaScript
- Size: 71.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
# Create database of locations 🌎 🌍 🌏
## Overview
This script will create a database in `Mongo` with locations using this [data](http://download.geonames.org/export/dump).
By default this script doesn't save all locations (also include mountains, lakes, hotels ...), just save the areas that can be considered a settlement. That info is [here](http://www.geonames.org/export/codes.html).### Before start
Install dependencies```
npm install
```### Running the script
To run the script, run:```
node app [options] <...>Options:
-V, --version output the version number
-c, --countries list of ISO country code (ISO 3166-1 alpha-2) comma separated (without spaces)
-a, --allCountries All available countries
-C, --codes list of location codes. By default this script just save the areas that can be considered a settlement
-A, --allCodes All available location codes
-m, --mongo [value] Mongo host, by default mongodb://localhost:27017/world-locations
-h, --help output usage information
```List of valid ISO 3166-1 alpha-2 codes [here](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#AD)