[mapserver-users] Heatmap / choropleth from points attributes

Milo van der Linden milo at dogodigi.net
Wed Feb 23 10:28:31 EST 2011


Turning points into polygons (or voronois) is the "thinking like a GIS
professional" approach. This is valid, but not as good as it can get.
Basically, using imaging techniques would be a better approach.

Perhaps you can take this: http://www.sethoscope.net/heatmap/ as a starting
point? The author has created a nice python script to generate a heatmap.

2011/2/23 Josh Jordan <outerspaceman81 at yahoo.com>

> First, you have to turn your points into shapes, theres some algorithm that
> will turn points into polygons with borders midway between each point.
>  Then, you have to add classes to the mapfile.  Add one class per color.
>  You have to calculate the bounds and color for each class like this:
>
> CLASS
>     EXPRESSION(([POPULATION] gt 90457) AND ([POPULATION] le 108397))
>     STYLE
>       COLOR 10 20 50
>     END
> END
>
> If your CSV data isnt joined to the mapserver data, you have to calculate
> what shapes are in each bucket like this-
>
> CLASS
>     EXPRESSION(([NAME] = "Shape1") OR ([NAME] = "Shape2"))
>     STYLE
>       COLOR 10 20 50
>     END
> END
>
> --- On *Tue, 2/22/11, Daniel Cole <daniel at southernsolutionsms.com>* wrote:
>
>
> From: Daniel Cole <daniel at southernsolutionsms.com>
> Subject: [mapserver-users] Heatmap / choropleth from points attributes
> To: mapserver-users at lists.osgeo.org
> Date: Tuesday, February 22, 2011, 10:06 PM
>
> I am a new mapserver user and have spent countless hours over the last
> month reading, trying code, etc. before posting here for help.  I am trying
> to generate an image (non-interactive) on a webpage based off of attribute
> data in a points file.  For example, 20 different points equally distributed
> in a field contain data about the moister level of the soil.  I want to make
> the lowest levels blue and the highest levels yellow, or something like that
> with some gradients in between.  If possible I want it to have interpolated
> data between them to show the gradual change, but that isn't a must.   I
> also want to wrap it in a polygon that trims the edges.
>
> I found some python code that I thought might do the trick , but it seems
> lots of heat maps are based off of how many points exist in a certain area,
> and thats now what I am doing.
>
> My points contain numbers in the attributes, 5, 25, 92, 71, etc.   I feel
> like I am missing some easy way to do this right in front of me with gdal or
> something.  If someone has any direction or even demo code that would be
> greatly appreciated.
>
> Thanks,
>
> Daniel
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org<http://mc/compose?to=mapserver-users@lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110223/1c4c5a60/attachment.html


More information about the mapserver-users mailing list