<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="NO-BOK" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">BTW. On my Linux box v.out.ascii in GRASS 7 (SQLite backend) dumped 724,798 points in 8.2 seconds to stdout…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"> grass-user-bounces@lists.osgeo.org
[mailto:grass-user-bounces@lists.osgeo.org] <b>On Behalf Of </b>Blumentrath, Stefan<br>
<b>Sent:</b> 30. juli 2015 14:47<br>
<b>To:</b> patrick s.<br>
<b>Cc:</b> GRASS user list<br>
<b>Subject:</b> Re: [GRASS-user] v.to.rast<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">OK, that sounds unreasonably slow. Maybe a bug… (or is this only due dbf backend?)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">You could try v.out.ogr (instead of v.out.ascii) and write to CSV?! You can then use the CSV in r.in.xyz…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">If you only need point counts (and not the sum of some values) you could use v.to.db to generate a list with x/y coordinates
you could pipe to r.in.xyz and count the points there.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Or (as an ugly work around) you could convert the raster map you already created from your points back to vector (area)
and then use v.vect.stats and then convert the result to raster…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Stefan<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"> patrick s. [<a href="mailto:patrick_gis@gmx.net">mailto:patrick_gis@gmx.net</a>]
<br>
<b>Sent:</b> 30. juli 2015 14:27<br>
<b>To:</b> Blumentrath, Stefan; Markus Neteler<br>
<b>Cc:</b> GRASS user list<br>
<b>Subject:</b> Re: [GRASS-user] v.to.rast<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Thanks Stefan<br>
<br>
It seems first of all v.out.ascii is slow. Following your proposaI, the tmp-file has only 5300 observations after 9min15s. As I have 650.000 points this export will need approx. 18h! Can I speed this up somehow? (Database-driver is dbf)
<br>
<br>
Patrick<br>
<br>
P.S. g.region -up & v.info are given below.<br>
<br>
<br>
##g.region -up<br>
projection: 99 (Swiss. Obl. Mercator)<br>
zone: 0<br>
datum: ch1903<br>
ellipsoid: bessel<br>
north: 1297000<br>
south: 1074200<br>
west: 2484400<br>
east: 2834800<br>
nsres: 25<br>
ewres: 25<br>
rows: 8912<br>
cols: 14016<br>
cells: 124910592<br>
<br>
##v.info<br>
Number of points: 647957 Number of centroids: 0 |<br>
| Number of lines: 0 Number of boundaries: 0 |<br>
| Number of areas: 0 Number of islands: 0 |<br>
| |<br>
| Map is 3D: No |<br>
| Number of dblinks: 1 |<br>
| |<br>
| Projection: Swiss. Obl. Mercator |<br>
| |<br>
| N: 1294822 S: 1075554 |<br>
| E: 2831184 W: 2486245 <o:p></o:p></p>
<div>
<p class="MsoNormal">On 30.07.2015 13:59, Blumentrath, Stefan wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi Patrick,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">From my experience r.in.xyz is very fast.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">How many points are you processing (v.info pt) and what are your region settings (g.region –up)?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">In order to find out where time is spend yo could split upt the process into two steps:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">v.out.ascii input=pt output=./tmp column=VAL</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">r.in.xyz input=./tmp z=4 output=pt method=sum</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Stefan</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">
<a href="mailto:grass-user-bounces@lists.osgeo.org">grass-user-bounces@lists.osgeo.org</a> [<a href="mailto:grass-user-bounces@lists.osgeo.org">mailto:grass-user-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>patrick s.<br>
<b>Sent:</b> 30. juli 2015 10:18<br>
<b>To:</b> Markus Neteler<br>
<b>Cc:</b> GRASS user list<br>
<b>Subject:</b> Re: [GRASS-user] v.to.rast</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Markus<br>
<br>
I tested the approach you proposed, but seems to be very slow for large datasets: I am processing ~1000.000 points of observation on a 25m-Grid across Switzerland, where only few cells have multiple points inside. While
<i>v.to.rast</i> takes a few minutes for conversion, the combination "<i>v.out.ascii input=pt output=- column=VAL | r.in.xyz input=- z=4 output=pt method=sum</i>" has been running for multiple hours and is still in progress.
<br>
<br>
Is there any alternative to run this conversion? I need it to run neighborhood analyses as kernel density with population field, i.e.
<i>r.neighbors in=pt out=pt_dens -c size=300 meth=sum</i>. Maybe there is an approach to directly use the vector data and avoid conversion- something as
<i>v.neighbors meth=sum</i>? <br>
<br>
Thanks for you help,<br>
Patrick<br>
<br>
</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On 24.07.2015 04:13, Markus Neteler wrote:</span><o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">On Thu, Jul 23, 2015 at 11:00 AM, patrick s. </span><a href="mailto:patrick_gis@gmx.net"><span lang="EN-US"><patrick_gis@gmx.net></span></a><span lang="EN-US"> wrote:</span><o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">Dear all</span><o:p></o:p></pre>
<pre><span lang="EN-US"> </span><o:p></o:p></pre>
<pre><span lang="EN-US">I am puzzled on the behavior of v.to.rast. When several points fall into one</span><o:p></o:p></pre>
<pre><span lang="EN-US">gridcell, the raster seems to get one value but not the sum of these. Is</span><o:p></o:p></pre>
<pre><span lang="EN-US">there a way to sum these up instead?</span><o:p></o:p></pre>
</blockquote>
<pre><span lang="EN-US"> </span><o:p></o:p></pre>
<pre><span lang="EN-US">Yes. I have added a related example here:</span><o:p></o:p></pre>
<pre><span lang="EN-US"> </span><o:p></o:p></pre>
<pre><a href="http://grass.osgeo.org/grass70/manuals/v.to.rast.html#convert-vector-points-to-raster-with-raster-cell-binning"><span lang="EN-US">http://grass.osgeo.org/grass70/manuals/v.to.rast.html#convert-vector-points-to-raster-with-raster-cell-binning</span></a><o:p></o:p></pre>
<pre><span lang="EN-US"> </span><o:p></o:p></pre>
<pre><span lang="EN-US">(while it does not really fit to that manual page it is expected</span><o:p></o:p></pre>
<pre><span lang="EN-US">there. Perhaps we need to really enhance v.to.rast to do such a job</span><o:p></o:p></pre>
<pre>right away).<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>HTH<o:p></o:p></pre>
<pre>Markus<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"> <o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>