maps

Initial Set up

Steps for updating maps for routine tracker releases

Non IDE set up / external process

Responsibilities of this repo (hint: maybe we separate this out to other repos soon)

IDE set up

Run the processing code

Manually test the maps and data downloads

Creating a new testing map repo that pulls from official remote

Sharing a preview of the map with others

Warning: you’ll have to have the testing repo cloned to your machine and perhaps already open in an IDE window. You should also have set up two remotes repos, one called official that is linked to the official repo and the other that is linked to the testing repo. (see above section on Steps to creating a new testing map repo that pulls from official remote for how to do that, note you DO NOT need to create a new testing repo for this, just clone the testing repo instead of the maps one)

On the official repo IDE window, push the branch you have with the new data to the official remote repo, do not merge into the live branch called “gitpages-production”. Then go to your IDE window where you have the testing repo cloned and set up. Pull from your branch name on official remote repo, accept all merges from official remote since they will override anything going on there, and then push to the test remote repo. Note that currently the test remote repo branch connected to its own gitpages is called “testmaplive”. Now you can share the updated map preview via the testing repo’s gitpages link.

Here are the steps on my machine: git push origin yourbranchname [in official repo IDE window] git pull official yourbranchname [in test repo IDE window] accept merges git push origin testmaplive [in test repo IDE window]

About the maps repo from EarthGenome

GEM Tracker Maps are served entirely staticly, with no build process. Each tracker only requires a JSON based configuration file, and a data file (mostly hosted in digital ocean as geojson files).

Create a new tracker

Clone the repo. Create a new directory under /trackers/. Place the data for the tracker there. Create a symlink to index.html: while in the new directory, ln -s ../../src/index.html. Create a config.js. Commit to GitHub.

Configure a tracker

First, there are sitewide configurations with site-config.js. Any parameter can be configured site wide. Documentation on the typical site wide parameters is in that file.

The config.js for coal-plant has documentation on the parameters typically set for a tracker.

Update tracker data

Create a new branch. Place new data file in the appropriate tracker directory. Test and do quality checks locally by running python -m http.server 8000 at the root of the directory. When ready, make a pull request to the main repository. And accept the pull request to make the update.

Building vector tiles

Currently only used for GIPT map. Adjusted in the tracker/map’s config file with the flag “tile” instead of “csv” or “json”

Detailed GEM Specific Instructions for creating and updating GIPT tiles

Install csv2geojson and tippecanoe

% csv2geojson --numeric-fields "Capacity (MW)" Global\ Integrated\ Power\ data\ 2024-02-14.xlsx\ -\ Sheet1.csv > integrated.geojson

% tippecanoe -e integrated-2024-02-14.dir --no-tile-compression -r1 -pk -pf --force -l integrated < integrated.geojson

Copy local files to digital ocean spaces recursively and set public aws s3 cp --endpoint-url https://nyc3.digitaloceanspaces.com PATH/TO/DIR/TILES/FROM/TIPPECANOE s3://$BUCKETEER_BUCKET_NAME/NAME_OF_FOLDER_IN_DIGITAL_OCEAN/NAME_OF_SUB_FOLDER_IN_DIGITAL_OCEAN --recursive --acl public-read

Hosting

This can be hosted directly from GitPages.

If hosting on another webserver, the entire repo should be available from a directory on the webserver.

Official Maps can be found at this repo:

Live branch is gitpages-production

Test Data Repo

Maps spun up for PM review before pushed to live can be found in this repo:

Live branch is testmaplive

Test Features Repo

Libraries Used

New Features Planned