import heatmap
from PIL import Image

if __name__ == "__main__":    
    pts = []
    
    f = open('../../beloHorizonte.dat','r')

    while True:
	line = f.readline()
	if len(line) ==0:
	    break
	      
	array = line.split() 
	pts.append((float(array[2]), float(array[3]) ))
        
    print "Processing %d points..." % len(pts)
    
    
    bh = Image.open('MAPAbeloHorizonte.png')
    x,y = bh.size
    
    hm = heatmap.Heatmap()
    #img = hm.heatmap(pts,area=[(-19.8435,-44.0168),(-19.9569,-43.9036)],dotsize=15) 
    img = hm.heatmap(pts,area=[(-19.8435,-44.0168),(-19.9569,-43.9036)],dotsize=15,scheme='pbj') 
    
    
    img = img.rotate(270) 
    img = img.resize((x,y))
    
    img.save("BH-heatmap.png")
