amccollum / pyheat Goto Github PK
View Code? Open in Web Editor NEWPython Heatmap Library
Python Heatmap Library
Am I correct to understand that pyheat only works with python 2.6 because PIL only works with python 2.6 http://www.pythonware.com/products/pil/ ? is there a more current alternative to use with python 2.7?
If I for example zoom to lvl 10 or deeper, pyheat seems to have Problems with rendering across tiles.
I uploaded a picture where you can easily see my problem. Its the Exampledata shipped with the download. I did no changes except the zoom and the lat/lon values. There are also no errors print in console..
<script src='http://img811.imageshack.us/shareable/?i=pyheaterror.png&p=tl' type='text/javascript'></script>[URL=http://img811.imageshack.us/i/pyheaterror.png/][IMG]http://img811.imageshack.us/img811/5034/pyheaterror.png[/IMG][/URL]Can anyone reproduce it?
The new Update provokes an GLError. I guess it's an PyOpenGL Version issue.
Stack Trace:
27/Sep/2010:11:28:07 HTTP INFO Serving HTTP on http://0.0.0.0:8080/
::1 - - [27/Sep/2010:11:28:11] "GET /map HTTP/1.1" 200 1577 "" "Mozilla/5.0 (Win
dows; U; Windows NT 6.0; de; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET C
LR 3.5.30729; .NET4.0C)"
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Programme\Python25\lib\threading.py", line 486, in *bootstrap_inner
self.run()
File "C:\Users\xxx\Desktop\pyheat\examples\heatlayer.py", line 25, in run
self.outputs.put(self.do_task(_args, _kwargs))
File "C:\Users\hengefeld\Desktop\pyheat\examples\heatlayer.py", line 43, in do_task
tile = pyheat.HeatTile(zoom, tx, ty)
File "C:\Program Files\python25\Lib\site-packages\pyheat\heattile.py", line 16, in __init
super(HeatTile, self).init(*self.get_px_bounds())
File "C:\Program Files\python25\Lib\site-packages\pyheat\heatmap.py", line 56, in init
self.prepare(abs(right - left), abs(top - bottom))
File "C:\Program Files\python25\Lib\site-packages\pyheat\heatmap.py", line 90, in prepare
glHint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, GL_FASTEST)
File "c:\programme\python25\lib\site-packages\PyOpenGL-3.0.1-py2.5-win32.egg\OpenGL\error.py", line 208, in glCheckError baseOperation = baseOperation,
GLError: GLError(
err = 1280,
description = 'Invalid Enumerant.',
baseOperation = glHint,
cArguments = (
GL_CLIP_VOLUME_CLIPPING_HINT_EXT,
GL_FASTEST,
)
)
So I'm using following Versions: PyOpenGL-3.0.1 with py2.5
As given in the docs:
http://pyopengl.sourceforge.net/documentation/manual/glHint.3G.html
there seems to be no allowed option like "GL_CLIP_VOLUME_CLIPPING_HINT_EXT"
Any Ideas what's missing?
The method substracts the padding from self.top and adds it in self.bottom, but it should be the other way. According to google maps documentation (https://developers.google.com/maps/documentation/javascript/maptypes#WorldCoordinates), Y coordinates go from north to south (ie: increasing going to north).
This causes, that padding actually make the box smaller, instead of larger, in the y axis. The result is a gap in top and bottom borders of every tile.
Actual code:
def get_ll_bounds(self, padding=0.0):
(n, w) = self.px2ll(self.left - padding, self.bottom + padding)
(s, e) = self.px2ll(self.right + padding, self.top - padding)
return (s, n, w, e)
Proposed fix (note the signs in px2ll second argument):
def get_ll_bounds(self, padding=0.0):
(n, w) = self.px2ll(self.left - padding, self.bottom - padding)
(s, e) = self.px2ll(self.right + padding, self.top + padding)
return (s, n, w, e)
Tile clipping fix seems to work great until you start to zoom in past level 12 or so, then it seems to forget the surrounding tiles a bit?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.