So much good information.  Thank you all so much for these responses.  I will take the later part of this week digging through all of the suggestions and trying the methods.  I guess what I am trying to do seems to be more choropleth than heatmap, due to the fact that I don&#39;t want any areas without color, I want it to be interpolated off of the nearest point. I am sure I will be back on here asking more about this, but for the time being I have been given some great code and directions.  Thanks again Tamas, Brent, and all of the others.  What a great bunch of help.  <div>
<br></div><div>Thanks,</div><div><br></div><div>Daniel</div><div><br></div><div>
<br><br><div class="gmail_quote">On Wed, Feb 23, 2011 at 12:41 PM,  <span dir="ltr">&lt;<a href="mailto:pcreso@pcreso.com">pcreso@pcreso.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">Hi Daniel,<br><br>Points to voronoi for mapping is surely a chloropleth more than a heatmap? Colouring polygons by value? A heat map is generally done by rendering a surface generated from point data.<br>
<br>From the original question I&#39;m not sure if simply plotting coloured points on the map is required, or some sort of aggregation of the point data by polygon.<br><br>I _think_ the intent is to take sets of points, each within a polygon (field), generate a surface within each polygon based on the point values, then render each surface to form a heatmap (the rendered map thus comprising a set of polygons, each of which is represented by its own heat map) ???<br>
<br><br>For a more elegant GIS based approach, I&#39;d use GMT to render a static map for a web page, which was the intent behind original question. Mapserver is more for dynamic/interactive web
 mapping.<br><br>See: <a href="http://gmt.soest.hawaii.edu/gmt/doc/gmt/pdf/GMT_Docs.pdf" target="_blank">http://gmt.soest.hawaii.edu/gmt/doc/gmt/pdf/GMT_Docs.pdf</a><br><br>For different ways of showing the values of points on a map see the examples on pages 120, 121, 138, 141, 144, etc. And there are many others with a tool this powerful (&amp; complex) including generating &amp; plotting surfaces derived from point data (for heat maps)<br>
<br>You write a script to build the map, much as in the p141 example, which shows how GMT can create a complex legend automatically as well, and run the script whenever a new or updated map is required.<br><br>The GMT list (IMHO) is a helpful &amp; supportive as any mailing list I&#39;ve encountered, even this one!!<br>
<br>A script which iterates through each field (set of points) generating each constrained surface and inserting it to a grid, then rendering the entire grid for your map output would do this pretty easily.<br><br>See the GMT docs for the commands <span style="font-style:italic">surface</span> for one way to generate each field of points as a grid, <span style="font-style:italic">grdmath</span> for how to merge these into one grid, &amp; <span style="font-style:italic">grdimage</span> for how to generate the map from these gridded data. Or you could just render each field separately with grid points outside the field polygon set to NAN &amp; rendered transparent.<br>
<br>Or throw all the points into a surface, render this as a single heat map &amp; overlay the fields as transparent polygons (optionally labelled) with perhaps the regions between polygons masked if appropriate?<br><br>Lots of ways of generating such maps :-)<br>
<br>If you&#39;d like some help going down this path, contact me off list.<br><br>Cheers,<br><br>  Brent Wood<br><br><br><br><br>--- On <b>Thu, 2/24/11, Puneet Kishor <i>&lt;<a href="mailto:punk.kish@gmail.com" target="_blank">punk.kish@gmail.com</a>&gt;</i></b> wrote:<br>
<blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px"><br>From: Puneet Kishor &lt;<a href="mailto:punk.kish@gmail.com" target="_blank">punk.kish@gmail.com</a>&gt;<br>Subject: Re: [mapserver-users] Heatmap / choropleth from points attributes<br>
To: &quot;Milo van der Linden&quot; &lt;<a href="mailto:milo@dogodigi.net" target="_blank">milo@dogodigi.net</a>&gt;<br>Cc: <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
Date: Thursday, February 24, 2011, 6:23 AM<div><div></div><div class="h5"><br><br><div>On Wed, Feb 23, 2011 at 04:28:31PM +0100, Milo van der Linden wrote:<br>&gt; Turning points into polygons (or voronois) is the &quot;thinking like a GIS<br>
&gt; professional&quot; approach. This is valid, but not as good as it can get.<br>&gt; Basically, using imaging techniques would be a better approach.<br><br>Very well put.<br><br>&gt; <br>&gt; Perhaps you can take this: <a href="http://www.sethoscope.net/heatmap/" target="_blank">http://www.sethoscope.net/heatmap/</a> as a starting<br>
&gt; point? The author has created a nice python script to generate a heatmap.<br><br>And here is a Perl-based approach<br>[<a href="http://blog.imtrevor.com/2009/07/16/generating-heat-maps-using-perl/" target="_blank">http://blog.imtrevor.com/2009/07/16/generating-heat-maps-using-perl/</a>]<br>
<br><br>&gt; <br>&gt; 2011/2/23 Josh Jordan &lt;<a href="http://mc/compose?to=outerspaceman81@yahoo.com" target="_blank">outerspaceman81@yahoo.com</a>&gt;<br>&gt; <br>&gt; &gt; First, you have to turn your points into shapes, theres some algorithm that<br>
&gt; &gt; will turn points into polygons with borders midway between each point.<br>&gt; &gt;  Then, you have to add classes to the mapfile.  Add one class per color.<br>&gt; &gt;  You have to calculate the bounds and color for each class like this:<br>
&gt; &gt;<br>&gt; &gt; CLASS<br>&gt; &gt;     EXPRESSION(([POPULATION] gt 90457) AND ([POPULATION] le 108397))<br>&gt; &gt;     STYLE<br>&gt; &gt;       COLOR 10 20 50<br>&gt; &gt; 
    END<br>&gt; &gt; END<br>&gt; &gt;<br>&gt; &gt; If your CSV data isnt joined to the mapserver data, you have to calculate<br>&gt; &gt; what shapes are in each bucket like this-<br>&gt; &gt;<br>&gt; &gt; CLASS<br>&gt; &gt;     EXPRESSION(([NAME] = &quot;Shape1&quot;) OR ([NAME] = &quot;Shape2&quot;))<br>
&gt; &gt;     STYLE<br>&gt; &gt;       COLOR 10 20 50<br>&gt; &gt;     END<br>&gt; &gt; END<br>&gt; &gt;<br>&gt; &gt; --- On *Tue, 2/22/11, Daniel Cole &lt;<a href="http://mc/compose?to=daniel@southernsolutionsms.com" target="_blank">daniel@southernsolutionsms.com</a>&gt;* wrote:<br>
&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; From: Daniel Cole &lt;<a href="http://mc/compose?to=daniel@southernsolutionsms.com" target="_blank">daniel@southernsolutionsms.com</a>&gt;<br>&gt; &gt; Subject: [mapserver-users] Heatmap / choropleth from
 points attributes<br>&gt; &gt; To: <a href="http://mc/compose?to=mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>&gt; &gt; Date: Tuesday, February 22, 2011, 10:06 PM<br>&gt; &gt;<br>
&gt; &gt; I am a new mapserver user and have spent countless hours over the last<br>&gt; &gt; month reading, trying code, etc. before posting here for help.  I am trying<br>&gt; &gt; to generate an image (non-interactive) on a webpage based off of attribute<br>
&gt; &gt; data in a points file.  For example, 20 different points equally distributed<br>&gt; &gt; in a field contain data about the moister level of the soil.  I want to make<br>&gt; &gt; the lowest levels blue and the highest levels yellow, or something like that<br>
&gt; &gt; with some gradients in between.  If possible I want it to have interpolated<br>&gt; &gt; data between them to show the gradual change, but that isn&#39;t a
 must.   I<br>&gt; &gt; also want to wrap it in a polygon that trims the edges.<br>&gt; &gt;<br>&gt; &gt; I found some python code that I thought might do the trick , but it seems<br>&gt; &gt; lots of heat maps are based off of how many points exist in a certain area,<br>
&gt; &gt; and thats now what I am doing.<br>&gt; &gt;<br>&gt; &gt; My points contain numbers in the attributes, 5, 25, 92, 71, etc.   I feel<br>&gt; &gt; like I am missing some easy way to do this right in front of me with gdal or<br>
&gt; &gt; something.  If someone has any direction or even demo code that would be<br>&gt; &gt; greatly appreciated.<br>&gt; &gt;<br>&gt; &gt; Thanks,<br>&gt; &gt;<br>&gt; &gt; Daniel<br>&gt; &gt;<br>&gt; &gt; -----Inline Attachment Follows-----<br>
&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; mapserver-users mailing list<br>&gt; &gt; <a href="http://mc/compose?to=mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a>&lt;<a href="http://mc/compose?to=mapserver-users@lists.osgeo.org" target="_blank">http://mc/compose?to=mapserver-users@lists.osgeo.org</a>&gt;<br>
&gt; &gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>
&gt; &gt; mapserver-users mailing list<br>&gt; &gt; <a href="http://mc/compose?to=mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>&gt; &gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt; &gt;<br>&gt; &gt;<br><br>&gt; _______________________________________________<br>&gt; mapserver-users mailing
 list<br>&gt; <a href="http://mc/compose?to=mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>_______________________________________________<br>mapserver-users mailing list<br><a href="http://mc/compose?to=mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</div></div></div></blockquote></td></tr></tbody></table></blockquote></div><br></div>