From 0cd733eb7700a5b5a8678df026d6e01b6aba39ca Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Thu, 26 Mar 2015 11:25:56 -0700 Subject: [PATCH 1/2] Document how to choose high-zoom dot sizes --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 8f6f949c..e606065b 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,30 @@ Example cat tiger/tl_2014_*_roads.json | tippecanoe -o tiger.mbtiles -l roads -n "All TIGER roads, one zoom" -z12 -Z12 -d14 -x LINEARID -x RTTYP +Point styling +------------- + +To provide a consistent density gradient as you zoom, the Mapbox Studio style needs to be +coordinated with the base zoom level and dot-dropping rate. You can use this shell script to +calculate the appropriate marker-width at high zoom levels to match the fraction of dots +that were dropped at low zoom levels. + + awk 'BEGIN { + dotsize = 2; # up to you to decide + basezoom = 14; # tippecanoe -z 14 + rate = 2.5; # tippecanoe -r 2.5 + + print " marker-line-width: 0;"; + print " marker-ignore-placement: true;"; + print " marker-allow-overlap: true;"; + print " marker-width: " dotsize ";"; + for (i = basezoom + 1; i <= 22; i++) { + print " [zoom >= " i "] { marker-width: " (dotsize * exp(log(sqrt(rate)) * (i - basezoom))) "; }"; + } + + exit(0); + }' + Geometric simplifications ------------------------- From 1f8581c76c314e55798b11516399809f9d6c1826 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Thu, 26 Mar 2015 11:28:06 -0700 Subject: [PATCH 2/2] More doc text --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e606065b..f98991d6 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,9 @@ coordinated with the base zoom level and dot-dropping rate. You can use this she calculate the appropriate marker-width at high zoom levels to match the fraction of dots that were dropped at low zoom levels. +If you used -z to change the base zoom level or -r to change the +dot-dropping rate, replace them in the basezoom and rate below. + awk 'BEGIN { dotsize = 2; # up to you to decide basezoom = 14; # tippecanoe -z 14