[GRASS-user] Need Help with speeding up v.import and reducing/removing null values from v.rast.stat results

Moritz Lennert mlennert at club.worldonline.be
Fri Mar 23 02:51:41 PDT 2018


On 22/03/18 22:40, Mehrdad Varedi wrote:
> Hi Everyone,
> 
> I am trying to import few layers with nearly 700,000 buffer areas around 
> the same number of points. Fr each layer t takes more than 4-5 hours and 
> most of the time, it just stops in the middle of the process.
> Any idea that which kind of layers can be imported with a faster speed? 
> I need o load 4-5 of such layers and it is now 5 days that I am busy 
> with building a buffer or importing the results.
> 
> Actually I tried v.buffer and it took more than a day until I stopped 
> the procedure, although I could create the layer with Fixed distance 
> buffer function in QGIS in 10 minutes.
> Any idea to accelerate the process of v.buffer ot v.import in GRASS?

I would guess that the difference comes from the difference in output 
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.

The same is true both for buffer creation and for import.

> 
> Also I want to calculate statistics in each of the buffers and have the 
> same issue with
> v.rast.stats function

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.

> 
> Another issue with this function is a lot of NAs in the result. No hole 
> exists in the raster files and it should be something with snapping I 
> guess which results in removal of many points.

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 ?

Moritz




More information about the grass-user mailing list