Skip to content

Instantly share code, notes, and snippets.

Shape Plugin: wrong file code : -8454144 encountered during parsing of layer 'countries' in Layer at line 27

Issue #2: My color scheme isn’t that great. How do I make it better?

Making your color scheme systematic is probably the best way to get a good-looking palette. It's not pure science - so dont just plug in numbers, but structured relationships between colors definitely makes for a more pleasing map. You can use any number color functions available to CartoCSS. For categorized features, I like using spin(), for getting different hues but maintaining the exact same lightness and saturation.

As for data steps there a number of statistical + geographic approaches (jenks is popular, and QGIS will calculate this for you), but I think for non-scientific maps like these, it's really just about what represents the data most effectively at a glance - which is to say trial and error.

I used a quasi-log scale for my NYC building-size map, which you can checkout here: https://github.com/mapbox/reinv

@ian29
ian29 / user-query.xml
Last active December 26, 2015 05:49
overpass-turbo.eu query that display last nodes / ways touched by a given user
<!--
This query looks for nodes and ways last
edited by the given user.
Zoom to the area where you want to see the
user's edits and hit "Run" to see those
edits visualized on the map.
-->
~ (git::master) ▶ node -v
v0.10.21
~ (git::master) ▶ nvm install v0.8.26
v0.8.26 is already installed.
~ (git::master) ▶ nvm use v0.8.26
Now using node v0.8.26
~ (git::master) ▶ node -v
v0.10.21
@ian29
ian29 / gist:7533439
Created November 18, 2013 19:05
this file is actually the devil
> sqlite3 qs-adm1.sqlite "select count(*) from data"
> 666
item quantity acquired?
avocados 12
bacon 4 saturday
bagels 3 doz. sunday morning
baguettes 2 sunday morning
butter 1
cake 1 saturday/sunday
cheddar 1 saturday
cider 2 saturday/sunday
@ian29
ian29 / -
Created January 15, 2014 17:06
> [email protected] install /Users/i/tools/watchbot/node_modules/ursa
> node-gyp configure build && node install.js
CXX(target) Release/obj.target/ursaNative/src/ursaNative.o
npm install > ursa-fail.log
clang: error: invalid version number in '-mmacosx-version-min=10.9:/usr/local/bin:/usr/local/bin:/usr/local/bin:/Users/i/.rvm/bin:/usr/local/bin:/Users/i/.nvm/v0.8.26/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/i/.rvm/bin:/Users/i/.rvm/bin:/Users/i/.rvm/bin:/Users/i/.rvm/bin:/Users/i/.rvm/bin:/Users/i/.rvm/bin'
make: *** [Release/obj.target/ursaNative/src/ursaNative.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/Cellar/node/0.10.22/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/usr/local/Cellar/node/0.10.22/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
Get:1 http://us-east-1.ec2.archive.ubuntu.com precise Release.gpg [198 B]
Get:2 http://us-east-1.ec2.archive.ubuntu.com precise-updates Release.gpg [198 B]
Get:3 http://security.ubuntu.com precise-security Release.gpg [198 B]
Get:4 http://security.ubuntu.com precise-security Release [49.6 kB]
Get:5 http://us-east-1.ec2.archive.ubuntu.com precise Release [49.6 kB]
Get:6 http://us-east-1.ec2.archive.ubuntu.com precise-updates Release [49.6 kB]
Get:7 http://us-east-1.ec2.archive.ubuntu.com precise/main Sources [934 kB]
Get:8 http://security.ubuntu.com precise-security/main Sources [95.7 kB]
Get:9 http://security.ubuntu.com precise-security/universe Sources [30.5 kB]
Get:10 http://us-east-1.ec2.archive.ubuntu.com precise/universe Sources [5019 kB]
Get:1 http://us-east-1.ec2.archive.ubuntu.com precise Release.gpg [198 B]
Get:2 http://us-east-1.ec2.archive.ubuntu.com precise-updates Release.gpg [198 B]
Get:3 http://security.ubuntu.com precise-security Release.gpg [198 B]
Get:4 http://security.ubuntu.com precise-security Release [49.6 kB]
Get:5 http://us-east-1.ec2.archive.ubuntu.com precise Release [49.6 kB]
Get:6 http://us-east-1.ec2.archive.ubuntu.com precise-updates Release [49.6 kB]
Get:7 http://us-east-1.ec2.archive.ubuntu.com precise/main Sources [934 kB]
Get:8 http://security.ubuntu.com precise-security/main Sources [95.7 kB]
Get:9 http://security.ubuntu.com precise-security/universe Sources [30.5 kB]
Get:10 http://us-east-1.ec2.archive.ubuntu.com precise/universe Sources [5019 kB]