A reimplementation of the now-defunct TIGER / OSM "Battlegrid" map using tile-reduce and OSM QA Tiles.
This project consumes TIGER roads vector tiles, the United States OpenStreetMap QA Tiles extract, and matches them. The resulting GeoJSON output represents segments that exist in TIGER but don't exist in OpenStreetMap. This output could be useful in finding areas of the map that haven't been mapped yet. It could also indicate TIGER data that is erroneous (because OSM has been more recently updated).
-
Download the source data as a couple mbtiles files:
mkdir -p /mnt/osmqa curl -L https://hot-qa-tiles.s3.amazonaws.com/latest.country/united_states_of_america.mbtiles.gz | gzip -dc > /mnt/osmqa/united_states_of_america.mbtiles curl -L https://s3.amazonaws.com/data.openstreetmap.us/tiger2023_expanded_roads.mbtiles > /mnt/osmqa/tiger2023_tiles.mbtiles
-
Get the source code if you haven't already:
cd /tmp curl -L https://github.com/iandees/tiger-battlegrid/archive/master.tar.gz | tar zxf - cd tiger-battlegrid-master/
-
Install tippecanoe:
sudo apt-get install -y build-essential libsqlite3-dev zlib1g-dev cd /tmp curl -L https://github.com/mapbox/tippecanoe/archive/1.34.3.tar.gz | tar zxf - cd tippecanoe-1.34.3/ make -j$(nproc) sudo make install
-
Install NVM, Node, and NPM:
curl -L https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash source ~/.profile nvm install 10 nvm use 10
-
Fix Ubuntu/npm/node-sqlite3 problems:
npm install --global node-gyp@latest npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js
-
Install Node dependencies for tiger-battlegrid:
cd /tmp/tiger-battlegrid-master/ npm install
-
Run the matching process and pipe it through Tippecanoe to generate an mbtiles dataset:
mkdir /mnt/osmqa/tmp node index.js | \ tippecanoe \ --no-line-simplification \ --buffer=0 \ --read-parallel \ --temporary-directory=/mnt/osmqa/tmp \ --maximum-zoom=12 \ -o /mnt/osmqa/missing_tiger.mbtiles
-
Install Mapbox command line tools
sudo apt-get install -y python3-pip pip3 install --user mapboxcli
-
Create a new access token with all "uploads" permissions. Save the access token (you won't see it again) locally. Treat it like a password and don't share it with anyone.
-
Store the access token for the Mapbox command line interface.
export MAPBOX_ACCESS_TOKEN=<secret_token>
-
Upload the tileset to Mapbox.
~/.local/bin/mapbox upload tiger2023-delta /mnt/osmqa/missing_tiger.mbtiles
-
Upload the TIGER roads data to Mapbox as well.
~/.local/bin/mapbox upload tiger2023-roads /mnt/osmqa/tiger2023_tiles.mbtiles
- In Mapbox Studio, click the New Style button, then click Upload Style and drop the
style.json
file from this repo on the upload area.