I'm developing an open source system for creating heat maps using php.

Inputs: a set of points with longitude, latitude and a "heat" value.

Outputs: a set of tiles for Google Maps at different zoom levels.

Coal Plants Example:
http://www.energyjustice.net/map/server-test/tile-example.html


I break up the US into grid squares.  My typical grid square is 0.5
degrees longitude by 0.5 degrees latitude.


For each grid square, I calculate the distance between it and all of
the points where we're measuring "heat".  The heat is equal to
the_heat_of_the_point /(distance*distance).

In my case I'm doing coal plants.  So it is MW/ (distance*distance).

This part of the code takes the most cpu power. If I do 0.05 degrees
latitude by 0.05 degrees longitude, I have 620,000 grid squares for
the US  (lower 48 states) and it takes my computer 30 minutes to
calculate the distance between each grid square and 500 power plants.
I'd like to do 0.01 degrees, but that'd take 25 times longer.

I could do counties instead of grid squares, but I wanted higher
resolution.

I insert the resulting heat values into a mysql table.

Then I have a second script to calculate the tiles.  The fun part was
figuring out Google's projection and dealing with grid squares that
are in the middle of two or more tiles.  Creating the tiles is
relatively fast (1 minute).


Is anyone interested in testing it out and improving it?
What should be done to get this into a system where other developers
would use it?

I'm especially interested in ways of speeding up the distance
calculations. I tried creating a trig lookup table to avoid using the
trig functions, but that meant I had to do rounding - and the php
round() function seemed to be as slow as cos or sin.


I posted some of my code (which needs cleaning up - what is a good way
to post php code?):
http://www.campusactivism.org/blog/node/329

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to