SpatiaLite support now in trunk

177 views
Skip to first unread message

DenesL

unread,
Apr 1, 2012, 7:20:51 PM4/1/12
to web...@googlegroups.com

SpatiaLite support using new DB adapter now in trunk:

db=DAL('spatialite://...')

NOTES:

After installation of the required SpatiaLite libraries Windows users *must* rename libspatialite-2.dll as libspatialite.dll for it to be picked-up by web2py.

Support under Linux and Mac has not been tested yet, please report any problems.

Only the geometry type is available under SpatiaLite, although there are some functions that work on geography data they are different from the other spatial/GIS implementations already supported in web2py (namely PostGIS and MSSQL) and therefore they are not currently defined in the new SpatiaLite adapter.

For examples see the original post (with the exception of geography as noted above):
https://groups.google.com/forum/?fromgroups#!topic/web2py-usuarios/Iak2CzmqFkQ

Denes




Massimo Di Pierro

unread,
Apr 1, 2012, 9:56:19 PM4/1/12
to web...@googlegroups.com
why the renaming? Any way we can make it automatic?

DenesL

unread,
Apr 2, 2012, 11:39:19 AM4/2/12
to web...@googlegroups.com

Each OS has to load a different extension:

Windows: libspatialite-2.dll
Linux: libspatialite.so                                
Mac OS X: libspatialite.dylib

This, I think, can be simplified by just having: 
                        
    self.execute(r'SELECT load_extension("libspatialite");')

but I need others to test in Linux and Mac environments.

Otherwise we would have to check which OS are we running and load the corresponding extension.
Reply all
Reply to author
Forward
0 new messages