lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 28.11.2013 14:31, Jose wrote:
A Lua binding for readosm seems the most flexible approach (readosm is from
spatialite, mentioned in previous answer)

and then write this example in Lua (to compare to the C one)

IMHO, It is worth to help this nice guy (Sandro Furieri, the author of spatialite) to discover Lua and LuaJIT :-)

He currently writes insane amounts of C code to bind important libraries to SQLite as functions and even more expensive as virtual tables.

For example: libxml2. He currently exposes VirtualXPath virtual table:

intended to be used with statements in form:

select *
  from xpath_opera
    where xpath_expr = '/opera[@author = "Puccini"]/@title'

which is OK, but for the people paying rents with datapocessing it is well known, that there regularly arises the need of one more table: VirtualXPath2 for:

select attr_xpath('./@title') title, attr_xpath('count(./part)') parts
  from xpath_opera
    where node_xpath_expr = '/opera[@author = "Puccini"]'

which would cost Sandro even more than the former.

I have added to my "some good day" TODO :-(, to propose patch for spatialite reimplementing libxml2 vtables via LuaJIT.

Kind Regards,