<table cellspacing="0" cellpadding="0" border="0" ><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'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'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: http://gmt.soest.hawaii.edu/gmt/doc/gmt/pdf/GMT_Docs.pdf<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'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'd like some help going down this path, contact me off list.<br><br>Cheers,<br><br>&nbsp; Brent Wood<br><br><br><br><br>--- On <b>Thu, 2/24/11, Puneet Kishor <i>&lt;punk.kish@gmail.com&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;punk.kish@gmail.com&gt;<br>Subject: Re: [mapserver-users] Heatmap / choropleth from points attributes<br>To: "Milo van der Linden" &lt;milo@dogodigi.net&gt;<br>Cc: mapserver-users@lists.osgeo.org<br>Date: Thursday, February 24, 2011, 6:23 AM<br><br><div class="plainMail">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 "thinking like a GIS<br>&gt; professional" 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 ymailto="mailto:outerspaceman81@yahoo.com" href="/mc/compose?to=outerspaceman81@yahoo.com">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;&nbsp; Then, you have to add classes to the mapfile.&nbsp; Add one class per color.<br>&gt; &gt;&nbsp; You have to calculate the bounds and color for each class like this:<br>&gt; &gt;<br>&gt; &gt; CLASS<br>&gt; &gt;&nbsp; &nbsp;&nbsp;&nbsp;EXPRESSION(([POPULATION] gt 90457) AND ([POPULATION] le 108397))<br>&gt; &gt;&nbsp; &nbsp;&nbsp;&nbsp;STYLE<br>&gt; &gt;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;COLOR 10 20 50<br>&gt; &gt;&nbsp;
 &nbsp;&nbsp;&nbsp;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;&nbsp; &nbsp;&nbsp;&nbsp;EXPRESSION(([NAME] = "Shape1") OR ([NAME] = "Shape2"))<br>&gt; &gt;&nbsp; &nbsp;&nbsp;&nbsp;STYLE<br>&gt; &gt;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;COLOR 10 20 50<br>&gt; &gt;&nbsp; &nbsp;&nbsp;&nbsp;END<br>&gt; &gt; END<br>&gt; &gt;<br>&gt; &gt; --- On *Tue, 2/22/11, Daniel Cole &lt;<a ymailto="mailto:daniel@southernsolutionsms.com" href="/mc/compose?to=daniel@southernsolutionsms.com">daniel@southernsolutionsms.com</a>&gt;* wrote:<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; From: Daniel Cole &lt;<a ymailto="mailto:daniel@southernsolutionsms.com" href="/mc/compose?to=daniel@southernsolutionsms.com">daniel@southernsolutionsms.com</a>&gt;<br>&gt; &gt; Subject: [mapserver-users] Heatmap / choropleth from
 points attributes<br>&gt; &gt; To: <a ymailto="mailto:mapserver-users@lists.osgeo.org" href="/mc/compose?to=mapserver-users@lists.osgeo.org">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.&nbsp; 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.&nbsp; For example, 20 different points equally distributed<br>&gt; &gt; in a field contain data about the moister level of the soil.&nbsp; 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.&nbsp; If possible I want it to have interpolated<br>&gt; &gt; data between them to show the gradual change, but that isn't a
 must.&nbsp;&nbsp;&nbsp;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.&nbsp;&nbsp;&nbsp;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.&nbsp; 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 ymailto="mailto:mapserver-users@lists.osgeo.org"
 href="/mc/compose?to=mapserver-users@lists.osgeo.org">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 ymailto="mailto:mapserver-users@lists.osgeo.org" href="/mc/compose?to=mapserver-users@lists.osgeo.org">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 ymailto="mailto:mapserver-users@lists.osgeo.org" href="/mc/compose?to=mapserver-users@lists.osgeo.org">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 ymailto="mailto:mapserver-users@lists.osgeo.org" href="/mc/compose?to=mapserver-users@lists.osgeo.org">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></blockquote></td></tr></table>