heatmap icon indicating copy to clipboard operation
heatmap copied to clipboard

Area bounding box issue

Open asalzberg82 opened this issue 12 years ago • 1 comments

Hi,

great heatmap program and have it working nicely. I have a set of points scattered over DC and everything works great when I don't specify area=((minx,miny),(maxx,maxy)).

What I get when I do use the area = piece is that the y coord (latitute) is scrunched and I cant really seem to fix it. I have tried messing with the size parameter at the same time. Is the solution to convert all my input coordinates to a projected system first? The coordinates in my csv are all wgs 84 geo coordinates - so i thought to specify the min/max coordinates in the same way.

Sample output without area restriction (image1) and with (image2) attached, plus code.

any help appreciated. Again - great that you produced this and very helpful. Code (with area restriction) below - same code used without area produces image1.


import heatmap # http://jjguy.com/heatmap/
import csv

hm = heatmap.Heatmap()
if __name__ == "__main__":
    pts = []
    for point in csv.reader(open("coordinates.csv")):
        pts.append((float(point[0]), float(point[1])))
    print "Processing %d points..." % len(pts)
    hm.heatmap(pts,dotsize=110,opacity=500,scheme='fire', area=((-77.11656,38.80644),(-76.909515,38.89307))).save("image2.png")

image1 image2

asalzberg82 avatar Jan 19 '13 14:01 asalzberg82

Are you using 2.2.0 or the more-recently pushed 2.2.1? Y3pp3r found/fixed a bug in the area parameter that causes similar behavior:

https://github.com/jjguy/heatmap/commit/920ea2c3b918aa297b6f2f5ef79e47cbb934f2e9

jjguy avatar Jan 22 '13 15:01 jjguy