[GRASS-dev] Re: v.in.ogr [Fwd: Re: [GRASS5] v.in.ascii]

Markus Neteler neteler at itc.it
Fri May 19 10:24:42 EDT 2006


Helena,
(cc to grass-dev, private msg part removed)

it is definitely related to the topology, but I don't know
if *identical* to the v.in.ascii problem. I will try to test
that next week.

Maybe a list member has an idea?

Markus

On Fri, May 19, 2006 at 09:44:08AM -0400, Helena Mitasova wrote:
> Markus,
> is the v.in.ogr swaping problem related in any way to the v.in.ascii 
> problem (see my discussion with Radim below).
> Would Radim's suggestions below help to solve it?
> 
> Helena
> 
> -------- Original Message --------
> Subject: 	Re: [GRASS5] v.in.ascii
> Date: 	Mon, 22 Aug 2005 11:08:42 +0200
> From: 	Radim Blazek <radim.blazek at gmail.com>
> To: 	Helena Mitasova <hmitaso at unity.ncsu.edu>
> CC: 	grass5 developers list <grass5 at grass.itc.it>
> References: 	<20050801082802.GN8595 at thuille.itc.it> 
> <20050802085033.GA27707 at thuille.itc.it> <42F79F09.6080303 at noaa.gov> 
> <42FA2976.2060704 at unity.ncsu.edu> 
> <340505ef05081601295cad878b at mail.gmail.com> <430218B8.80604 at unity.ncsu.edu>
> 
> 
> 
> On 8/16/05, Helena Mitasova <hmitaso at unity.ncsu.edu> wrote:
> >Radim Blazek wrote:
> >> Please read my previous mails about that, IT IS implemented,
> >> and IT DOES NOT call free() by default because it is faster
> >> and IT CAN free the memory if it is necessary. I wrote that 2-3
> >> times already.
> >
> >I meant at the module level, as a user how can I tell v.in.ascii or
> >v.build or any other module that builds topology to free the memory
> >when needed? From your emails it seemed to me
> >that this option needs to be added to the relevant modules, but I might
> >have misunderstood it,
> >
> >Helena
> 
> Spatial index occupies a lot of memory but it is necessary for 
> topology building. Also, it takes long time to release the memory
> occupied by spatial index (dig_spidx_free) . 
> 
> The function building topology (Vect_build) is usually called 
> at the end of module (before Vect_close) so it is faster to call
> exit() and operating system releases all the memory much faster.
> By default the memory is not released.
> 
> It is possible to call Vect_set_release_support() before Vect_close()
> to force  to release the memory, but it takes long time on large files.
> 
> Currently most of the modules do not release spatial index and work 
> like this:
> main
> {
>     Vect_open_new()
>     //writing new vector
> 
>     Vect_build()
>     Vect_close()  // memory is not released
> }
> 
> you can add Vect_set_release_support():
> 
> main
> {
>     Vect_open_new()
>     // writing new vector
> 
>     Vect_build()
>     Vect_set_release_support()
>     Vect_close()  // memory is released
> }
> 
> but it only takes longer time. 
> 
> It make sense to release spatial index if it is used only at the beginning
> of a module or in permanently running programs like QGIS.
> For example:
> 
> main
> {
>     Vect_open_old()
>     // select features using spatial index, e.g.  Vect_select_lines_by_box()
>     Vect_set_release_support()
>     Vect_close()  // memory is released
> 
>     // do some processing which needs memory
> }
> 
> 
> Radim




More information about the grass-dev mailing list