<div dir="ltr">Thank you very much Stefan and Moritz for your attention and replies.<div>I found that you both exactly understand where is the problem. Let me be more specific about my primary issue.</div><div><br></div><div> - v.buffer and v.import (v.in.ogr) - They freez.</div><div>I found that my problem was reported in a post: <a href="https://trac.osgeo.org/grass/ticket/2185" class="gmail-trac-id" style="font-family:Arial,Verdana,"Bitstream Vera Sans",Helvetica,sans-serif;font-weight:bold;letter-spacing:-0.018em;text-decoration-line:none;color:inherit;border-bottom:1px dotted rgb(187,187,187);font-size:23.2px;vertical-align:middle;margin:0px 0.4em 0px 0px">#2185</a><span style="color:rgb(136,68,68);font-family:Arial,Verdana,"Bitstream Vera Sans",Helvetica,sans-serif;font-size:16px;font-weight:bold;letter-spacing:-0.018em"> </span><span class="gmail-trac-status" style="color:rgb(136,68,68);font-family:Arial,Verdana,"Bitstream Vera Sans",Helvetica,sans-serif;font-size:16px;font-weight:bold;letter-spacing:-0.018em;vertical-align:middle"><a href="https://trac.osgeo.org/grass/query?status=new" style="text-decoration-line:none;color:inherit;border-bottom:1px dotted rgb(187,187,187)">new</a> </span><span class="gmail-trac-type" style="font-family:Arial,Verdana,"Bitstream Vera Sans",Helvetica,sans-serif;font-size:16px;font-weight:bold;letter-spacing:-0.018em;color:rgb(153,85,85);vertical-align:middle"><a href="https://trac.osgeo.org/grass/query?status=!closed&type=defect" style="text-decoration-line:none;color:inherit;border-bottom:1px dotted rgb(187,187,187)">defect <span style="color:rgb(0,0,0);font-size:19px;letter-spacing:-0.018em">Painfully Slow 'v.in.ogr' Vector Import </span><br></a></span>Here is the link: <a href="https://trac.osgeo.org/grass/ticket/2185#no1">https://trac.osgeo.org/grass/ticket/2185#no1</a></div><div><br></div><div>Now two questions: </div><div><br></div><div> 1 - Two patches has been offered in this post that apparently has solved the problem. I really don't know how to use patches and when they should be executed or compiled. Would you please refer me to some resources to educate myself to how to use the patches, where to get the compiler, etc.<br></div><div><br></div><div> 2 - Are these patches applied already in GRASS 7.4.0?</div><div><br></div><div> - <b>Some background about the data I have:</b></div><div><br></div><div>As I said there are 700,000 points , the distance between the points are 3 meters. I create buffers with the size of 3, 7, 20, and 50 meters around each point. Then will use v.rast.stats to calculate statistics on rasters with the resolution of 1 square meter.</div><div> </div><div>I could import the buffer layers created in QGIS using fixed distance buffer function and import them for the 3 and 7 meter buffer layers. then v.rast.stats could complete the calculations after 2 hours for the 3 meter buffer and after 4.5 hours for the 7 meter layer.</div><div><br></div><div>v.import for the 20 meter buffer was frozen on "Breaking Boundaries ... " step. I have provided the log of messages that I get. all of the steps is done in few minutes and it stuck on the "Breaking Boundaries ..." for more than 12 hours for the 20 meter buffer. ( I am sure it would be the same for the 50 meter buffer)</div><div><br></div><div><br></div><div><div>(Thu Mar 22 22:41:46 2018) </div><div>v.import input=E:\Projects-Analysis\London\Data\Output\P3ntsOnMains\Buffers\LondonBuffers layer=Buffer20_P3intsOnMains output=Buffer20_P3intsOnMains --overwrite</div><div>Check if OGR layer <Buffer20_P3intsOnMains> contains polygons...</div><div>WARNING: Vector map <Buffer20_P3intsOnMains> already exists and will be overwritten</div><div>WARNING: Table <Buffer20_P3intsOnMains> linked to vector map <Buffer20_P3intsOnMains> does not exist</div><div>Creating attribute table for layer <Buffer20_P3intsOnMains>...</div><div>Column name <cat> renamed to <cat_></div><div>Importing 706628 features (OGR layer <Buffer20_P3intsOnMains>)...</div><div>-----------------------------------------------------</div><div>Registering primitives...</div><div>706628 primitives registered</div><div>14839188 vertices registered</div><div>Number of nodes: 681288</div><div>Number of primitives: 706628</div><div>Number of points: 0</div><div>Number of lines: 0</div><div>Number of boundaries: 706628</div><div>Number of centroids: 0</div><div>Number of areas: -</div><div>Number of isles: -</div><div>-----------------------------------------------------</div><div>Cleaning polygons</div><div>-----------------------------------------------------</div><div>Breaking polygons...</div><div>Breaking polygons (pass 1: select break points)...</div><div>Breaking polygons (pass 2: break at selected points)...</div><div>-----------------------------------------------------</div><div>Removing duplicates...</div><div>-----------------------------------------------------</div><div>Breaking boundaries...</div></div><div><br></div><div><br></div><div><br></div><div>In another try when the distance between my points were 12 meters, everything was working relatively fast and with no problem. increasing the density of points (3 meter distance) has resulted in a very long delay, so much that I think it is in an infinite loop. </div><div><br></div><div>I appreciate for your help and looking forward hearing from you.</div><div><br></div><div>Kind regards,</div><div><br></div><div>Mehrdad</div><div><br></div><div><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>Mehrdad Varedi, <a href="http://M.A.Sc" target="_blank">M.A.Sc</a>.<br></div></div>Cell: +1 (519)722-7057<br></div></div></div>
<br><div class="gmail_quote">On Fri, Mar 23, 2018 at 9:15 AM, Stefan Blumentrath <span dir="ltr"><<a href="mailto:Stefan.Blumentrath@nina.no" target="_blank">Stefan.Blumentrath@nina.no</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hei Mehrdad,<br>
<br>
If your buffers are overlapping, topology will become an issue, as Moritz pointed out.<br>
Johannes Radinger once wrote a workaround for a specific use case that might be of help. See [1]. No idea if it would be possible to come up with something more generic for v.rast.stats…<br>
<br>
In v.rast.stas NAs occur most likely due to vector areas that are not rasterized, which usually happens when polygons are relatively small / narrow compared to resolution of the raster map.<br>
<br>
However, during community sprint these days in Bonn, Martin Landa added centroids to the rasterization algorithm (v.to.rast) that v.rast.stats uses, than can help to reduce the number of NAs.<br>
<br>
Also during community sprint, I created a patch for v.rast.stats [2] that aims at improving the performance of the module by allowing multiple raster input (it needs testing).<br>
<br>
There are possible further improvements, but these require some more discussion with the other devs regarding implementation.<br>
<br>
Cheers<br>
Stefan<br>
<br>
1: <a href="https://lists.osgeo.org/pipermail/grass-user/2017-June/076670.html" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>pipermail/grass-user/2017-<wbr>June/076670.html</a><br>
2: <a href="https://trac.osgeo.org/grass/ticket/3523" rel="noreferrer" target="_blank">https://trac.osgeo.org/grass/<wbr>ticket/3523</a><br>
<div><div class="h5"><br>
-----Original Message-----<br>
From: grass-user <<a href="mailto:grass-user-bounces@lists.osgeo.org">grass-user-bounces@lists.<wbr>osgeo.org</a>> On Behalf Of Moritz Lennert<br>
Sent: fredag 23. mars 2018 10.52<br>
To: Mehrdad Varedi <<a href="mailto:varedi@waterlix.com">varedi@waterlix.com</a>>; <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
Subject: Re: [GRASS-user] Need Help with speeding up v.import and reducing/removing null values from v.rast.stat results<br>
<br>
On 22/03/18 22:40, Mehrdad Varedi wrote:<br>
> Hi Everyone,<br>
><br>
> I am trying to import few layers with nearly 700,000 buffer areas<br>
> around the same number of points. Fr each layer t takes more than 4-5<br>
> hours and most of the time, it just stops in the middle of the process.<br>
> Any idea that which kind of layers can be imported with a faster speed?<br>
> I need o load 4-5 of such layers and it is now 5 days that I am busy<br>
> with building a buffer or importing the results.<br>
><br>
> Actually I tried v.buffer and it took more than a day until I stopped<br>
> the procedure, although I could create the layer with Fixed distance<br>
> buffer function in QGIS in 10 minutes.<br>
> Any idea to accelerate the process of v.buffer ot v.import in GRASS?<br>
<br>
I would guess that the difference comes from the difference in output<br>
format: QGIS will just create non-topological, overlapping buffers (unless you ask it to create unique buffers) while GRASS has to take care of all the topological issues in order to create a topologically clean vector map.<br>
<br>
The same is true both for buffer creation and for import.<br>
<br>
><br>
> Also I want to calculate statistics in each of the buffers and have<br>
> the same issue with v.rast.stats function<br>
<br>
You might get faster results rasterizing your buffers and using r.univar with the zones= parameter. You can then import the resulting text file into your database and link it to the vector map, as long as you make sure that the pixel values in the zone map correspond to the cat values of the vector map.<br>
<br>
><br>
> Another issue with this function is a lot of NAs in the result. No<br>
> hole exists in the raster files and it should be something with<br>
> snapping I guess which results in removal of many points.<br>
<br>
You would have to be a bit more precise about what exactly you are doing and what exactly the results are. Are you talking about points or polygons ?<br>
<br>
Moritz<br>
<br>
<br>
</div></div>______________________________<wbr>_________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/grass-user</a><br>
</blockquote></div><br></div></div>