JSON files listing locations in
Data is provided as JSON files in order to be used in all environments
This repo is just about the JSON files, so there is no build step involved in creating a new release, just update the changelog and the version number in the Bower file.
There are some consistency tests and they can be run with the command
npm test
. You might need to run npm install
before that if it's
the first time you are running tests on this repo
We don't have an explicit (yet) data model for the json objects stored in the JSON files. Whenever data-models is referenced in the documentaiton of the project, it referes to the informal-conventional data-model we are using for the JSON files in
Adding a country requires adding a country_name.json
file to the
json
folder (read the README.md
in there, too).
There's a node.js CLI tool called readable.js
in root. Run it with $ node readable.js [countryName]
, for example $ node readable.js guinea
.
To save the output to a text file, do $ node readable.js guinea > guinea.txt
There's a node.js CLI tool called toGeoJSON.js
in root. Run it with $ node toGeoJSON.js [countryName]
, for example $ node toGeoJSON.js
.
To save the output to a text file, do $ node toGeoJSON.js guinea > geojson.json
It provides an output conforming with the GeoJSON format, ready to be loaded in tools like geojson.io, were the locations can be visualized in the map if they have coordinates
the toURL.js
script will output a url ready to be consumed by geojson.io
example:
$ url=$(node toGeoJSON.js [countryName] | node toURL.js) && open -a Firefox $url
The folder ./history contains the history of the different tasks to add locations. Some of this tasks use the code in the ./lib folder.