Github link:
https://github.com/benosteen/gheatmap
(adapted from the pylons application of http://code.google.com/p/gheat/)
Installation hints:
- Use a virtualenv ($ virtualenv ../env_app ; source ../env_app/bin/activate)
- $ python setup.py install
- edit development.ini and point the sqlite db link to the ‘production_lrg.db’
- $ paster serve development.ini
- go to http://localhost:5000 and you should see a map…
- Computing the overlay tiles takes a little power so be patient 😉
How does it work?
The ‘properties_lrg.db’ contains a series of points from the Zoopla property search API that Dave Challis queried. Data.gov.uk was queried to get a list of latitude and longitudes for the UK HE institutions and this was passed to the Zoopla search API, searching for properties within a 15 miles radius of each, with the keyword ‘student’ and specifying ‘rental only’ as part of the search. The price per person was worked out by taking the overall rental cost and dividing it by the number of bedrooms in the property.
The data was turned into KML by Dave using a series of python scripts and shown as points on a google maps, where the colour of a point shows the relative cost – red, being the highest and blue being the lowest:
I took a copy of the data csv and tried to alter the ‘gheat’ application, which rendered heatmaps and provided the right sort of API to work with the Google Maps overlay layer. Unfortunately, it doesn’t use the magnitude of a given point (the cost) out of the box, so I spent some time trying to alter the rendering code to take into account the cost of a given property, making the size of the ‘blob’ larger correspondingly.
vikinggoat
April 11, 2012
What sort of alterations to the gHeat code dide you make to have it function this way?
Do you still have the code laying about?
benosteen
July 22, 2012
It wasn’t that heavy – I think the main difference was that I altered the data (which were discrete occurrences of rental prices) to fake levels, based on the prices. It gave a serviceable visualisation at the time, but could’ve done better.
vikinggoat
April 12, 2012
I am new comer to implementing tilelayers like gHeat, do you know of any good code examples of implementing it? I will be using your modified version for the added functionality of value associatted with a location as opposed to just sheer location density.