[GRASS-user] Redefining computational region for vector overlay

Hernán De Angelis dhdeangelis at comhem.se
Sun May 13 08:48:41 PDT 2018


Thanks for your answer and link, Moritz.

Of course, slow or fast are relative terms. May be I wasn't clear 
enough. Let's me explain better:

The core of my processing is simple:

1. extract point from point map (v.extract)

2. create buffer (v.buffer)

3. clip polygon map with buffered point (v.clip)

4. calculate areas (v.to.db)

This takes only 8 minutes. So we can agree to call it "fast".

The problem is: I have to do this for 60 points, in 5 different buffer 
sizes, for 14 sets of polygon maps, that is 4200 times.

At this rate, this process will take 4200 x 8 minutes = 33600 minutes, 
or about 23 days and 8 hours.

That's why my question was if there was setting I might activate to 
reduce computation time like, for example, limiting the computational 
region to the area under the buffer. In the meantime since I posted my 
question I read more carefully the v.clip manual and see that there is a 
switch (-r) to use in a defined region. This is what I am using now.

I will have a look at your script, but for what I see it does not seem 
critically different from my working routine. I believe I may explore 
another path, namely converting the polygons to a raster of suitably 
small pixel size and calculating the areas using r.stats instead. may be 
that's significantly faster.

Regards and thanks for the help!

/H.




On 2018-05-13 17:05, Moritz Lennert wrote:
> Le Sun, 13 May 2018 13:21:51 +0200,
> Hernán De Angelis <dhdeangelis at comhem.se> a écrit :
>
>> Hello GRASS users!
>>
>> I am working to make a certain vector process faster and more
>> effective and would like to ask you for some advice on how to proceed.
>>
>> I have a vector map containing points and a collection of vector maps
>> containing polygons. My task is to calculate the area covered by
>> these polygons en each polygon map but only under buffers of certain
>> sizes around each of the points. I understand how to do this. My
>> problem is how to do it faster and more effectively.
>>
>> Each polygon map contains around 2 million of them. The point map has
>> only ~60 points. Both cover the entire country (Sweden). The buffer
>> zones extend only a relatively small area around each point (up to
>> some tens of km). Selecting points and generating buffers around them
>> is easy and fast. The problem appears in the overlay operation. The
>> vast majority of polygons are not involved in the computations but
>> both v.clip and v.overlay seem to need to process them all. This
>> takes a long time.
>>
>> I wish there could be a way of limiting the number of features
>> involved in the computation to the size of each buffer zone in order
>> to cut down the processing time. I understand (and confirmed
>> empirically!) that setting the computational region does not work for
>> vector operations in GRASS (except for v.in.region). I therefore
>> wonder what can be done in this respect.
>>
>> I am not new to GRASS but have not used it for heavy duty tasks in a
>> long time, my skills have become rusty! Any hint will be greatly
>> appreciated!
> I'm a bit surprised that v.overlay is so slow for you. In the the
> little alternative (faster) script in [1] I got quite fast results
> using v.overlay with other modules. Maybe it can help you identify a
> faster way.
>
> Moritz
>
> [1] https://trac.osgeo.org/grass/ticket/3361.
>



More information about the grass-user mailing list