[GRASS-dev] Separate sqlite database files for vector maps

Markus Metz markus.metz.giswork at gmail.com
Sat Sep 10 08:33:55 PDT 2016


On Fri, Sep 9, 2016 at 11:06 PM, Sören Gebbert
<soerengebbert at googlemail.com> wrote:
> Dear devs,
> i would like to implement sqlite database support as separated file for each
> vector map. Similar to the dbf approach but with sqlite. Other databases are
> no option in my case.
> The reasons for this approach are the following:
>
> * The temporal vector algebra would hugely benefit from separated sqlite
> vector map files, since it can compute in parallel, no race condition or
> serial processing of database requests is required
> * Vector maps can easily be moved between locations with full database
> content, no data loss. Simply the vector map directory must be archived
> * Merging of mapsets is much easier, since the vector map sqlite databases
> don't need to be merged, only copied
>
> This approach would be implemented in addition to all other existing
> approaches.
>
> However, i don't know were to start with this, any hints or suggestions?

This is implemented in G6.3, maybe also early versions of G6.4, but
has been removed at some stage, no idea why.
Have a look at lib/vector/Vlib/field.c, there at the fns
Vect_subst_var()
and
Vect_get_dblink()

Essentially, all that is needed is a corresponding entry in $LOCATION_NAME/VAR:
instead of
DB_DRIVER: sqlite
DB_DATABASE: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db

try
DB_DATABASE: $GISDBASE/$LOCATION_NAME/$MAPSET/vector/$MAP/sqlite/sqlite.db

HTH,

Markus M


More information about the grass-dev mailing list