Load the SQLite ST_Geometry library

The ST_Geometry library must reside on the same machine as your SQLite client (such as SQLite3.exe), and you must designate the location of and load the ST_Geometry library so the SQLite client can access the SQL functions. You can set the library location in the client's PATH (Windows) or LIBPATH (Linux) system environment variable then load the library, or you can specify the path when you load ST_Geometry library.

Steps:
  1. Log in to the machine where the SQLite client is installed.
  2. If you don't want to specify the path for every client session, set the PATH (Windows) or LIBPATH (Linux) variable to the location of the ST_Geometry library.

    For example, if the stgeometry_sqlite.dll is in c:\mylibs, set the PATH variable to c:\mylibs\stgeometry_sqlite.dll.

  3. Open an SQL editor and connect to your SQLite database.
  4. Load the ST_Geometry library.

    In the first two examples, SELECT statements load the ST_Geometry on Windows and Linux machines where the environment variable is set for the library path.

    --Load the ST_Geometry library on Windows.
    SELECT load_extension('stgeometry_sqlite.dll','SDE_SQL_funcs_init');
    
    --Load the ST_Geometry library on Linux.
    SELECT load_extension('libstgeometry_sqlite.so', 'SDE_SQL_funcs_init');
    

    In these examples, the SELECT statements load the libraries while specifying the paths to the library.

    --Load the ST_Geometry library on Windows.
    SELECT load_extension(
     'c:\Program Files (x86)\ArcGIS\Desktop10.2\DatabaseSupport\SQLite\Windows32\stgeometry_sqlite.dll',
     'SDE_SQL_funcs_init'
    );
    
    --Load the ST_Geometry library on Linux.
    SELECT load_extension(
     '/arcgis/server/usr/DatabaseSupport/SQLite/Linux64/libstgeometry_sqlite.so',
     'SDE_SQL_funcs_init'
    );
    

Related Topics

6/19/2015