Created
December 21, 2016 15:08
-
-
Save nygeog/3073ab2a71d4775f0d1eabd456db0f1a to your computer and use it in GitHub Desktop.
Classify for Cartodb Torque for Graduated Symbols with SQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For Pandas see: https://gist.github.com/nygeog/03e806283c1923fb39ff538477155060