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

Sören Gebbert soerengebbert at googlemail.com
Sat Sep 10 14:24:49 PDT 2016


Mi Markus,

[snip]

>
> 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,
>

This helped a lot, thank you. Simply running:
db.connect driver=sqlite
database='$GISDBASE/$LOCATION_NAME/$MAPSET/vector/$MAP/sqlite.db'

will do the job. This can be run right after mapset creation.

And it works nicely. It seems that most of the v.db.* commands work with
vector map specific database files. The db.* commands seemed work as well,
if the database path is provided at the command line.

I skipped the sqlite directory in the vector map path ($MAP/sqlite/sqlite.db
-> $MAP/sqlite.db), since this directory must be created when a new vector
is opened, hence the vector-open-new functions must be modified to support
a separate sqlite directory. With the simple solution the directory fsync()
behavior of sqlite will force now all vector map specific files to be
flushed to disc. This may be a performance problem.

This solution may be sufficient for my needs, no modification needed in the
code ... except, v.info should show the database path of a vector map if
extended metadata is required.


Many thanks for your help
Best regards
Soeren


>
> Markus M
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20160910/49ecc3ba/attachment.html>


More information about the grass-dev mailing list