For the purposes of this example, assume ES.txt from Geonames is used (Spain).
Copy ES.txt to a relative path data/geonames.
- Set
COUNTRY_CODEto the file name's country code e.g"ES" - Set the ALLOWED_TIMEZONE if you want to filter to just one time zone, otherwise set to
"N/A"or"" - Set the MIN_LATITUDE to a minimum number e.g.
-36if you want, otherwise"N/A"or"" - Run
node format_places_csv_to_json
This will create ES.json in the data/geonames directory.
These actions are carried out in the grid directory.
- Set
FILEto the path to the new JSON file e.g."../data/geonames/ES.json" - Set
REFto something meaningful e.g.ESto determine the name of the output file Warning: if you use the sameREFtwice, the first file will be overwritten. - Set
NXandNYto the number of squares you want in the grid along each axis - Run
node create_grid. This will create a JSON file withREFin the name
- Set
DATA_FILEto the location of your Geonames data JSON e.g."../data/geonames/ES.json" - Set
GRID_FILEto the location of your new grid file e.g."grids/ES.json" - Set
FIG_SIZEto the dimensions for your map - this will take a bit of trial and error. Start with a square and adjust from there - Run
py test.py - If you don't like the grid, you can adjust
create_grid.jsand re-run these steps
Warning: Be careful with this as it will alter your data JSON. If you think a data JSON is compromised, delete it, as it can always be reproduced from the original Geonames file.
- Set
DATA_FILEto the location of your Geonames data JSON e.g."../data/geonames/ES.json" - Set
GRID_FILEto the location of your new grid file e.g."grids/ES.json" - Run
node apply_grid
- Go to the folder
create_background - Update
DATA_PATHincreate3.jsto the location of the data file e.g."../data/geonames/ES.json" - Run
node create3WARNING: This will overwrite the contents of_background.csv - Copy the new/updated file
_background.csvinto thebackgroundfolder - Rename the file there to something more meaningful e.g.
ES.csv
- Ensure
discoveries/graphsis empty and any previous contents have been copied elsewhere if still needed.
- Set
README_INFOto something informative e.g."Spain" - Set
DATA_PATHto the location of the Geonames JSON e.g."data/geonames/ES.json" - Set
BACKGROUND_PATHto the location of the background CSV e.g."background/ES.csv"
- Set the heuristics as desired
- Set FIG_SIZE - if you carefully played with it in
grid/test.pyyou may wish to re-use those numbers - however those may have been distorted somewhat by the grid points
- Run
py discover.py - Graphs should start to appear in
discoveries/graphs - If the graphs appear too limited in scope, you may want to loosen up one or more of the heuristics settings