Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generate a kml heatmap from a csv input
require 'csv'
HEADER = '<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="">
<name>Puzzled Pint Heat Map</name>
FOOTER = ' </Document>
out ='pdx2.kml', 'w')
out << HEADER
CSV.foreach("pdx.csv") do |row|
name = row[0]
addr = row[1]
lat = row[2]
long = row[3]
value = 400 * row[4].to_i / 90
zvalue = 50 * 90 / row[4].to_i
out << " <Placemark>
out << FOOTER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment