import numpy as np
import numpy.random
import matplotlib.pyplot as plt


listlat = []
listlng = []

f = open('../../beloHorizonte.dat','r')

while True:
	line = f.readline()
	if len(line) ==0:
	    break
	      
	array = line.split() 
	lat = float(array[2])
	lng = float(array[3])
	listlat.append(lat)
	listlng.append(lng)

x = np.array(listlat)
# x = x +1.0

y = np.array(listlng)
# y = y +1.0


heatmap, xedges, yedges = np.histogram2d(x, y, bins=50)
extent = [xedges[0], xedges[-1], yedges[0], yedges[-1]]
heatmap = heatmap[::-1,:] #espelhamento das coordenadas no eixo Y

plt.clf()

#plt.imshow(heatmap, extent=extent,cmap='YlOrRd')
plt.imshow(heatmap, extent=extent)
plt.colorbar()
plt.xlabel('Lng')
plt.ylabel('Lat')
plt.show() 
