CartoCSS port of Toner
CartoCSS Makefile PLpgSQL JavaScript
Latest commit 4594138 Jul 14, 2016 @mojodna mojodna Sync layers
Permalink
Failed to load latest commit information.
fonts Rough first pass at Terrain-style labeling with Toner data Jul 18, 2014
icons Rough first pass at Terrain-style labeling with Toner data Jul 18, 2014
images svgs, which don't work Jul 25, 2014
merged_labels fix Buenos Aries spelling for real this time please Jul 8, 2014
shp-local Point to a container-local version of nullisland.shp Sep 8, 2014
shp Mark volume (prevent -v?), provide a default command Dec 9, 2014
sql/functions Load Shapefiles into Postgres (matching terrain) Jul 15, 2016
.dockerignore Simplify by using NE as a data volume Aug 25, 2014
.gitignore packer provisions base and rendering AMIs Jul 17, 2014
DEPLOY.md Updated deployment instructions Jan 7, 2015
Dockerfile Mark /app/shp as a volume Nov 24, 2014
INSTALL_ubuntu.md Ubuntu installation docs from @smathermather Jan 8, 2015
LICENSE Add ISC license Aug 27, 2014
Makefile Quiet NE downloads Jul 15, 2016
README.md Development docs Jan 7, 2015
circle.yml Re-convert, but don't re-download Dec 10, 2014
imposm3_mapping.json base generalized tables on other generalized tables Jul 3, 2014
labels.mss label tweak Sep 6, 2014
map.mss Load Shapefiles into Postgres (matching terrain) Jul 15, 2016
package.json Upgrade dependencies Jul 14, 2016
server.js Upgrade dependencies Jul 14, 2016
tessera.json x and y were pointless, include retina Sep 8, 2014
toner-background.mss Replace download_natural_earth_data with make Nov 15, 2014
toner-background.yml Sync layers Jul 15, 2016
toner-base.mss Replace download_natural_earth_data with make Nov 15, 2014
toner-base.yml Sync layers Jul 15, 2016
toner-buildings.mss toner-buildings Jul 14, 2014
toner-buildings.yml Sync layers Jul 15, 2016
toner-hybrid.mss Replace download_natural_earth_data with make Nov 15, 2014
toner-hybrid.yml Sync layers Jul 15, 2016
toner-labels.mss toner-background, toner-labels, and toner-lines Jul 10, 2014
toner-labels.yml Sync layers Jul 15, 2016
toner-lines.mss toner-background, toner-labels, and toner-lines Jul 10, 2014
toner-lines.yml Sync layers Jul 15, 2016
toner-lite.mss fix toner-lite low zoom country border color - not quite there but be… Aug 11, 2014
toner-lite.yml Sync layers Jul 15, 2016
toner.mss Replace download_natural_earth_data with make Nov 15, 2014
toner.yml Drop to PNG8 Jul 15, 2016
toner_world.png More links and image in README Aug 28, 2014
verify.js Include path and body Aug 13, 2014

README.md

Toner

"Toner" is the name of Stamen's black and white map tiles. It was originally designed for the Dotspotting project by Geraldine Sarmiento, although many others have been involved since.

The original Toner was developed as part of Stamen's Citytracking initiative, funded by the Knight Foundation. The old repository can be found here, for historical interest.

Toner screenshot

Developing

Prerequisites

  • PostgreSQL
  • PostGIS
  • Node.js
  • GDAL
  • TileMill 1@master (this includes the latest Mapnik): github.com/mapbox/tilemill
  • Imposm 3, which includes dependencies of its own: go, leveldb, and protobuf.

On OS X, installation with Homebrew looks like this:

brew install postgis gdal node go leveldb protobuf

# follow instructions to start postgresql

mkdir -p /tmp/imposm
cd /tmp/imposm
export GOPATH=`pwd`
git clone https://github.com/omniscale/imposm3 src/imposm3
go get imposm3
go install imposm3

# bin/imposm3 is your new binary; either add $GOPATH/bin to your PATH or copy
# it to /usr/local/bin (or similar)

Toner Itself

  • Clone this repo
  • Run make link to sym-link the project into your TileMill project directory
  • Run make db/shared to fetch and transform Natural Earth and OSM coastline data
  • Run make db/ca (or similar; see PLACES in the Makefile for a list of registered extracts and expand it as desired).
  • Run make to generate the project.mml file. (Alternatively, make toner-background, toner-buildings, toner-hybrid, toner-lines, toner-labels, or toner-lite to work on the variant styles)
  • Start TileMill by running npm start from the TileMill repo
  • Open http://localhost:20009/#/project/toner

make db/<place> will write to the database specified in .env (with a default value of postgres:///toner). If you experience trouble connecting, try adding credentials, e.g. postgres://user:password@localhost/toner (it will use $USER with no password otherwise). Barring that, check your pg_hba.conf to ensure that access is configured correctly.

(We primarily develop on OS X where PostgreSQL from Homebrew works out of the box.)

NOTE: Changes to project settings (i.e. not stylesheets) in TileMill will not persist the changes. To make changes, edit the relevant .yml file and re-run make [variant] to re-generate the project.mml that TileMill reads.

Deployment

See DEPLOY.md for instructions.

FAQ

What's the deal with the Makefile? Why is it so complicated?

Magic, mostly. It probably can (and should) be simplified! Consider this another, in-progress "make for data" approach (which actually uses make).

The goal here is to provide an idempotent process for bootstrapping the project that uses as few additional dependencies as possible. make is the age-old solution to this problem, although it takes a more file-focused approach. Put another way, it attempts to efficiently encapsulate otherwise complicated and error-prone operations.

The Makefile here attempts to replicate make's behavior relative to rebuilding files with database tables. In other words, if a Postgres relation already exists, it will be left as-is. If it doesn't exist (has been dropped or hasn't been created), it will be created on-demand.

Why do I have to install pgexplode?

libpq (which underlies PostgreSQL's command-line tools) supports a number of environment variables which can be used to avoid repetition (and avoid errors). However, each component of the connection information is separate, and is more easily and concisely encoded in a URI (i.e. DATABASE_URL). pgexplode is aware of libpq's environment variables and will expand DATABASE_URLs components (which is simpler than managing multiple values and constructing a URL for imposm3 and other tools).