Dear list,

a recent thread on user list was about SQLite and math functions support [1]

The specific problem was well investigated, but the second part of message (having math support for SQLITE as GRASS default) could be interesting for future developments. IMHO

2013/9/26 Markus Neteler <neteler at osgeo.org>

Including SQLite math functions in the standard binary GRASS GIS

distribuition could be a long term solution? I think this is the choice

SpatialLite did since 2.3 version.

You mean

http://www.gaia-gis.it/gaia-sins/spatialite-sql-3.0.0.html#math

hence

http://www.sqlite.org/contrib

→ "extension-functions.c (50.96 KB) contributed by Liam Healy on

2010-02-06 15:45:07

Provide mathematical and string extension functions for SQL queries

using the loadable extensions mechanism. Math: acos, asin, atan, atn2,

atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin,

tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt,

square, ceil, floor, pi. String: replicate, charindex, leftstr,

rightstr, ltrim, rtrim, trim, replace, reverse, proper, padl, padr,

padc, strfilter. Aggregate: stdev, variance, mode, median,

lower_quartile, upper_quartile.

"

If you refer to this file, then it is more related to (your) SQLite

installation rather than GRASS itself since GRASS just calls SQLite.

best,

Markus

as math library is loaded by SQLite

SELECT load_extension(‘./libsqlitefunctions.so’);

but it’s not included in SQLite itself (consistently with SQLite “lightness” strategy),

could be this library managed as an optional library when compiling GRASS GIS

es: --with-sqlite-math

and then loaded by default (if available) when creating vector support db?

As SQLite is the default db, using this option when compiling GRASS for binary packages, standard users could have a more powerful “field editor” using v.db.update.

Please, consider that for many (power)users in Windows using MinGW is really something arcane…

Do you think this approach might work?

Best regards

Enrico Gallo

[1] http://lists.osgeo.org/pipermail/grass-user/2013-September/068987.html