We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Looking for advices (heat-map creation) !
Page Index Toggle Pages: 1
Looking for advices (heat-map creation) ! (Read 1731 times)
Looking for advices (heat-map creation) !
Mar 6th, 2008, 10:21am
 
Hello,

I'm new to Processing and I like it so far ! I'm seeking some advice here.

I have a series of "weighted plots" (x,y,weight) from which I'd like to create a heat-map with processing, on top of a map (similar to http://www.heatmapapi.com or http://www.labsmedia.com/clickheat/index.html).

Here is what I think I'll be doing:
- create a transparent image (8 bits shades of gray)
- for each plot, blend (multiply) a alpha-gradient disc on the transparent image
- once all plots are blended, colorize the image (translate the shades of gray to a palette)
- add a background map taken from google maps.

As I'm very new to Processing, I'd be interested in other users opinion: is there an easier or more elegant way to create something like heat maps ?

any hint welcome!

best regards,

Thibaut Barrère / LoGeek
--
http://blog.logeek.fr - learning content for developers
http://evolvingworker.com - tools for a better day
Re: Looking for advices (heat-map creation) !
Reply #1 - Mar 6th, 2008, 7:09pm
 
Maps like this are done like this: for every pixel in the image calculate the average distance to all sample points of your dataset. Then use this distance as a lookup index in a gradient map to get the colour for this pixel.

Here's an example made with an ancient version of Processing. It's a totally different context, but utilizes the exact same principle:

http://toxi.co.uk/p5/blobsInterlace/

Hope that helps!
Page Index Toggle Pages: 1