I installed r53983. The v.kernel execution that took almost a day now executes in 25.5 minutes. Thank you!<div><br></div><div>Aren<br><br><div class="gmail_quote">On Fri, Nov 23, 2012 at 12:51 PM, Markus Metz <span dir="ltr"><<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Nov 23, 2012 at 5:35 PM, Aren Cambre <<a href="mailto:aren@arencambre.com">aren@arencambre.com</a>> wrote:<br>
> Thanks!<br>
><br>
> I am not familiar with GRASS's release customs. Will this become part of a<br>
> binary release soon, or should I just pull down the latest release in the<br>
> 6.4.2 trunk? I'm assuming this has been merged into the trunk...<br>
<br>
</div>It should be available as a binary for Windows by tomorrow in the<br>
nightly builds [0].<br>
<br>
Markus M<br>
<br>
[0] <a href="http://wingrass.fsv.cvut.cz/grass64/" target="_blank">http://wingrass.fsv.cvut.cz/grass64/</a><br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Aren<br>
><br>
><br>
> On Fri, Nov 23, 2012 at 7:32 AM, Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>><br>
> wrote:<br>
>><br>
>> On Fri, Nov 23, 2012 at 2:07 PM, Aren Cambre <<a href="mailto:aren@arencambre.com">aren@arencambre.com</a>> wrote:<br>
>> > Isn't taking about 10,000% too much time considered a bug? :-)<br>
>><br>
>> Hmm, yes. v.kernel is fixed in devbr6 and relbr6 with r53982 and<br>
>> r53983, respectively.<br>
>><br>
>> Markus M<br>
>><br>
>> ><br>
>> > On Nov 23, 2012 5:11 AM, "Markus Metz" <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> On Fri, Nov 23, 2012 at 4:14 AM, Aren Cambre <<a href="mailto:aren@arencambre.com">aren@arencambre.com</a>><br>
>> >> wrote:<br>
>> >> > I'm able to reproduce reliably here. I'll email you details<br>
>> >> > privately.<br>
>> >><br>
>> >> Thanks. I can confirm that v.kernel takes a long time in GRASS 6 with<br>
>> >> the settings provided by you. It does not crash, however.<br>
>> >><br>
>> >> I can speed up v.kernel in GRASS 6 to complete in 10 minutes instead<br>
>> >> of 16+ hours, but I am not sure if this fix can/will go into GRASS 6.4<br>
>> >> because by now only bugs should be fixed.<br>
>> >><br>
>> >> Markus M<br>
>> >><br>
>> >> ><br>
>> >> > Aren<br>
>> >> ><br>
>> >> ><br>
>> >> > On Thu, Nov 22, 2012 at 9:02 AM, Markus Metz<br>
>> >> > <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>><br>
>> >> > wrote:<br>
>> >> >><br>
>> >> >> On Sat, Nov 17, 2012 at 4:06 PM, Aren Cambre <<a href="mailto:aren@arencambre.com">aren@arencambre.com</a>><br>
>> >> >> wrote:<br>
>> >> >> > I have a dataset of just over 700,000 incidents that happened in<br>
>> >> >> > square-ish<br>
>> >> >> > Texas county that's about 30 miles on each side.<br>
>> >> >> ><br>
>> >> >> > Here's the parameters reported by v.kernel as it's executing:<br>
>> >> >> ><br>
>> >> >> > STDDEV: 1000.000000<br>
>> >> >> > RES: 111.419043 ROWS: 458 COLS: 447<br>
>> >> >> ><br>
>> >> >> > Writing output raster map using smooth parameter=1000.000000.<br>
>> >> >> ><br>
>> >> >> > Normalising factor=6482635.018778.<br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> > I am running this on a Windows 7 x64 machine with 8 GB RAM and an<br>
>> >> >> > Intel<br>
>> >> >> > Core<br>
>> >> >> > i7 Q720 1.6 GHz with 4 physical cores. I notice that it's not<br>
>> >> >> > multithreaded,<br>
>> >> >> > only using 1 core.<br>
>> >> >> ><br>
>> >> >> > It takes about 16 hours to complete. Is this correct? I'd like to<br>
>> >> >> > use<br>
>> >> >> > this<br>
>> >> >> > on a dataset with closer to 5 million records, and I'm really<br>
>> >> >> > concerned<br>
>> >> >> > how<br>
>> >> >> > long it may take.<br>
>> >> >><br>
>> >> >> The time required by v.kernel is a function of the number of cells<br>
>> >> >> and<br>
>> >> >> the input parameter stddeviation. The larger any of these values is,<br>
>> >> >> the more time v.kernel will need. Nevertheless, I think that the 16+<br>
>> >> >> hours are not correct. I tested with a vector with 3 million points<br>
>> >> >> for a grid with 2700 rows and 1087 columns, magnitudes larger than<br>
>> >> >> the<br>
>> >> >> grid used by you. v.kernel completes in just over one minute.<br>
>> >> >><br>
>> >> >> ><br>
>> >> >> > I posted my question about the 16+ hours at<br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> > <a href="http://gis.stackexchange.com/questions/41058/how-do-i-compute-v-kernel-maps-in-less-than-16-hours/" target="_blank">http://gis.stackexchange.com/questions/41058/how-do-i-compute-v-kernel-maps-in-less-than-16-hours/</a>.<br>
>> >> >> > Bill Huber, who si apparently knowledgeable about kernel density<br>
>> >> >> > calculations in general, posted a response, and he felt like a<br>
>> >> >> > kernel<br>
>> >> >> > density map shouldn't take much time at all. But digging more<br>
>> >> >> > deeply,<br>
>> >> >> > turns<br>
>> >> >> > out he had come up with a kernel density calculation method over a<br>
>> >> >> > decade<br>
>> >> >> > ago using Fourier transforms. See<br>
>> >> >> > <a href="http://www.directionsmag.com/features/convolution/129753" target="_blank">http://www.directionsmag.com/features/convolution/129753</a> and the<br>
>> >> >> > next<br>
>> >> >> > two<br>
>> >> >> > articles linked to it (they are short articles). Apparently this<br>
>> >> >> > transforms<br>
>> >> >> > it from an O(n^2) problem to an O(n ln n) complexity problem.<br>
>> >> >><br>
>> >> >> The approach of Bill Huber is raster-based, not vector based, making<br>
>> >> >> some things easier, at the cost of precision. The coordinate<br>
>> >> >> precision, however, is only needed for kernel functions other than<br>
>> >> >> uniform. In GRASS, you could get something like a raster-based<br>
>> >> >> density<br>
>> >> >> map by<br>
>> >> >><br>
>> >> >> - exporting the points with v.out.ascii<br>
>> >> >> - re-importing the points with r.in.xyz method=n to get the number<br>
>> >> >> of<br>
>> >> >> points per cell<br>
>> >> >> - running a neighborhood analysis using a circular window with<br>
>> >> >> r.neighbors method=sum -c<br>
>> >> >><br>
>> >> >> Optionally you could use the gauss option of r.neighbors to get an<br>
>> >> >> equivalent to v.kernel kernel=gaussian<br>
>> >> >><br>
>> >> >> HTH,<br>
>> >> >><br>
>> >> >> Markus M<br>
>> >> >><br>
>> >> >> ><br>
>> >> >> > I inspected v.kernel's main.c<br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> > (<a href="http://trac.osgeo.org/grass/browser/grass/trunk/vector/v.kernel/main.c" target="_blank">http://trac.osgeo.org/grass/browser/grass/trunk/vector/v.kernel/main.c</a>),<br>
>> >> >> > and looks like v.kernel uses an output-centric method (using<br>
>> >> >> > Bill's<br>
>> >> >> > wording)<br>
>> >> >> > of calculating the output, which seems like O(n^2) complexity.<br>
>> >> >> ><br>
>> >> >> > So I guess what I'm getting at is it appears to me that the<br>
>> >> >> > algorithm<br>
>> >> >> > behind<br>
>> >> >> > GRASS GIS's v.kernel is straightforward but is a greedy algorithm<br>
>> >> >> > (<a href="http://en.wikipedia.org/wiki/Greedy_algorithm" target="_blank">http://en.wikipedia.org/wiki/Greedy_algorithm</a>), which is fine,<br>
>> >> >> > but<br>
>> >> >> > it<br>
>> >> >> > make<br>
>> >> >> > take a while to execute. Is this true?<br>
>> >> >> ><br>
>> >> >> > Is there not spatial indexing I could add to the dataset? I've<br>
>> >> >> > done<br>
>> >> >> > various<br>
>> >> >> > Google searches on that and can't come up with anything clear.<br>
>> >> >> ><br>
>> >> >> > Aren<br>
>> >> >> ><br>
>> >> >> > _______________________________________________<br>
>> >> >> > grass-user mailing list<br>
>> >> >> > <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
>> >> >> > <a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
>> >> >> ><br>
>> >> ><br>
>> >> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>