Skip to content

Instantly share code, notes, and snippets.

@morganherlocker
Last active August 29, 2015 13:56
Show Gist options
  • Save morganherlocker/8867604 to your computer and use it in GitHub Desktop.
Save morganherlocker/8867604 to your computer and use it in GitHub Desktop.
Geocolor Choloropleth with simplestyle-spec Styling

sc_poverty_unstyled.geojson contains South Carolina's counties, with a poverty index. To create a choloropleth viewable in a gist, we can use geocolor.

var fs = require('fs'),
    geocolor = require('geocolor')

var geo = JSON.parse(fs.readFileSync(__dirname+'/in/sc_pov.geojson'))

geo = geocolor(geo, 'poverty', 'quantile', 7, ['blue', 'red'])

fs.writeFileSync(__dirname+'/out/sc_pov_choloropleth.geojson', JSON.stringify(geo))
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment