Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nygeog/3073ab2a71d4775f0d1eabd456db0f1a to your computer and use it in GitHub Desktop.
Save nygeog/3073ab2a71d4775f0d1eabd456db0f1a to your computer and use it in GitHub Desktop.
Classify for Cartodb Torque for Graduated Symbols with SQL
ALTER TABLE table_name ADD COLUMN torque_class INTEGER;
UPDATE table_name SET torque_class = ROUND(((input_col - (SELECT MIN(input_col) FROM table_name)) / (( (SELECT MAX(input_col) FROM table_name) - (SELECT MIN(input_col) FROM table_name))) * 255))
@nygeog
Copy link
Author

nygeog commented Dec 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment