Introduction

This is a fast and free heat mapping tool.

Background

I had the need for a flexible and scalable heat mapping application. A quick Google search lead me to gheat. While playing with the application, I found it slow and not flexible enough to suit my needs. There was no way to quickly and easily add points and the tile generating was slow. So, I decided to attempt a port to C# and here I am now.

Using the Code

For simplicity, I have already written all of the code to get anyone started right out of the box.

UI (In VB)

I have made a session wrapper to store the points for each session. They are accessed through "SessionHandler.PointManager".

The Guts (In C#)

Internally, the library Gheat.Net is about 99% identical to the python version. It supports the same color schemes, dots, file structure, and points files. The organization is slightly different in an attempt to streamline and make it more efficient. All of the tiles are generated as needed, but all empty tiles are cached and done so per color scheme, per zoom. Other caching was done for the color scheme and dots, so any additions will not be picked up unless the site is restarted. There is no config file but it is necessary to specify the directory where the dots and color schemes are. This MUST be done prior to any other GHeat code execution, so for web apps it must be done on Application_Start.

Thanks

Mercator projection thanks to Great Maps. I would have included the source, but it was extremely large so I just compiled a DLL and included it with the project. I did modify the source slightly to allow for weighted points. The modified file is now included as a separate download. Maybe I will one day explain how that works.

History

21st June, 2010: Initial post

9th September, 2014: Added Points.cs and PointLatLng.cs from Great Maps

I am currently using a newer version of GMap.NET.Core.dll, but I would like to implement your heatmaps into my project. I can't include both DLLs in my project, because that leads to a bunch of overlapping class names. If I had your source code that you used to compile the GMap.NET.Core.dll, I could implement it into the most recent version of GMap in my project.

If you could post that source somewhere (or just zip it up and put it as a part of this project), I would really appreciate it!

I was a bit puzzled when I first saw the demo at work on my own pc. The heatmap was not showing.

Just to let other users know, the problem was in LoadPointsFromFile which expects the decimal point to be a dot(.). My country is Denmark and we use comma (,) as the decimal point. The quick fix was to replace the commas in points.txt with semicolon and then replace the points with commas. Finally I changed

item = line.Split(',');

to

item = line.Split(';');

in LoadPointsFromFile. Then the heatmap displayed nicely. I guess the problem can be solved in a more general way but for now this will do.

Now I am looking forward to use GHeat in my own application and hoping to get a nice and useful result Thanks for your good work and for making it available to the rest of us!

Thanks for posting the information, I have no experience with standards outside the US so it wasn't natural for me to build this in or was it part of the original Gheat project. We all appreciate you sharing this with the community.

I am using the GHeat with an ASP.net handler that basically passes the map.aspx page an xml file that I parse and for each element I am using the AddPoint method. The problem I am having is that the overlay is not changing when the data changes, the heatmap is not altering as per the new set of data.

How can I get the heatmap to refresh and recreated each time the data changes.

I have cleared out all session data, and even regenerated a new Session ID. I can see that in Trace my Session is changed and when I remove the PointManager from the Session, it shows as removed. However when I run the page again I still get the heatmap for the old data. I have also tried this with the example Gheatweb loading from the points file and when I remove points for the file the heatmap doesnt change.

Then I have no answer for you. I would have to trouble shoot it with your code changes and I don't have the time for that. My suggestion would be to put break points were you add the points and where the tiles are generated and determine why the new points are not showing up on the tiles.

I guess from your answer you are having a bad day, not very polite now was it . I will see if I can figure this out and if I do find out the answer as to why the asp.net web version is not working I will let you know.