[Gdal-dev] Parzen Window Kernel Density Filter

Bill Binko bill at binko.net
Sat Jan 28 03:41:31 EST 2006


Hi everyone,

So, I've looked at the various solutions for kernel density mapping, and 
I think I know the approach I'd like to take.  I'd appreciate some 
feedback and a sanity check before I write any code.

I've found several references that describe the Parzen Window Kernel 
Density method, with the simplest being this 1D version:

http://en.wikipedia.org/wiki/Parzen_window

I've considered using R (or GRASS) to generate a raster image of my vector 
point data.  Both have methods to do this (I believe the GRASS code 
actually uses R though).  However, my point data covers the entire state 
of florida, so to have any resolution of value, the result of this method 
would be massive.

Also, one of the key things I've learned about this method is the fact
that the choice of variance (aka kernel or window) makes a huge difference
in the usefulness of the output.  It seems to me (I Am Not A Statistician
or even a GIS expert for that matter), but for best use I would like to
have the variance dependant on the scale of the map.  In other words, as
you zoom into the map, the kernel should shrink so that you could see more
detail regarding the area you're looking at.

So!  I would like to write a filter that takes a vector point set (OGR 
Data Source, probably), a display window, and some parameters such as 
resolution, color range values, etc. and produces a raster output through 
GDAL. 

I would like to invoke this through mapserver (PHP/Mapscript) and have it 
look like a layer that can be turned on/off etc.

I realize this is ambitious, but I think its very doable, and worthwhile.  
If there is desire, I would be happy to release it to others who are 
interested (either through GDAL, or other means).

So, here are my questions:

1) Is this sane?  I know there are alternatives, but they all (so far)  
seem to involve calling out to tools that are not highly suitable for 
real-time web-based mapping.
2) Are there examples of filters that sit between GDAL and OGR like this:

Browser->PHP/Mapscript->Mapserver->GDAL->EXAMPLE FILTER->OGR

and finally, one technical question that I've got on my mind:

3) How much would I need to buffer around the viewable area?  I've been 
thinking about it, I don't think I need to use all of the points in the 
dataset, only the viewable area + a buffer for the impact of those points 
just outside of the area.  I am thinking that I will only need to buffer 
by, say, 4 times the variance (kernel size) since anything farther than 
that won't cause much impact... does that sound right?

Thanks in advance.

Bill




More information about the Gdal-dev mailing list