Python script to covert GeoTiff .CLR file to a Carto style for CartoDB
✓ Published0🌍 Public
Aandrewxhill
Last edited Aug 24, 2012
Created on Aug 24, 2012
This script converts a GeoTiff .CLR color palette file into a CartoCSS style for CartoDB. It reads each line of the .CLR file, extracts a raster cell value and its corresponding RGB color, and generates a rule that assigns that polygon-fill color to matching values in a specified column. The resulting CartoDB.carto.css file uses a default orange fill with white outlines for unmatched values. The code relies on Python’s sys.argv for command-line arguments and standard file I/O, with no external visualization libraries.
AI-generated description