Skip to content
Prev 781 / 1559 Next

RSQLite load extension

sqldf in the sqldf package automatically loads spatialite if its in
its path.   That feature has only been tested on Windows but it works
at least there.  Here is the source code that is used in sqldf -- the
spatialite feature has only been tested on Windows and I have omitted
the part here  that checks whether spatialite is actually present or
not:

   m <- dbDriver("SQLite")
   connection <- dbConnect(m, dbname = dbname, loadable.extensions = TRUE)
   s <- sprintf("select load_extension('%s')", dll)
   dbGetQuery(connection, s)

References:
example of using spatialite from sqldf:
http://code.google.com/p/sqldf/#Example_14._Use_of_spatialite_library_functions

important bug to be aware of in spatialite 2.3.1:
https://groups.google.com/group/spatialite-users/msg/182f1f629c922607

sqldf home page:
http://sqldf.googlecode.com

On Sat, Feb 20, 2010 at 11:20 PM, Alex Mandel
<tech_dev at wildintellect.com> wrote: