How to use an external database - Septima/spatialsuite-s4 GitHub Wiki

Why use an external database?

  • Spatial Map versions prior to 2.7 don't include an embedded database. You must create an external database for the s4 index.
  • Your index is too big for the embedded database. An external database will hold indices of any size
  • You may use either postgres og sql server

POSTGRES

1: Create an s4 schema in your database (postgres script is included in /db/pg/create-schema.sql)
2: Update cbinfo.xml.
Assuming that your database is located at localhost and that username/password is s4 include the following parameters in cbinfo.xml:

<!-- =================================== -->
<!-- S4 Index parameters                 -->
<!-- =================================== -->
<param name="module.s4.index.externdb.type">postgis</param>
<param name="module.s4.index.externdb.connect">HOST:PORT/s4</param>
<param name="module.s4.index.externdb.user">s4</param>
<param name="module.s4.index.externdb.pwd">s4</param>
<param name="module.s4.index.externdb.srid">[cbinfo.mapserver.epsg]</param>

3: Restart your site

SQL SERVER

1: Create an s4 database
2: Run the script included in /db/sqlserver/createTables.sql
3: Create an s4 user and give this user read/write access to the database (Example script is included in /db/sqlserver/createUser.sql)
2: Update cbinfo.xml.
Assuming that your database is located at localhost and that username/password is s4 include the following parameters in cbinfo.xml:

<!-- =================================== -->
<!-- S4 Index parameters                 -->
<!-- =================================== -->
<param name="module.s4.index.externdb.type">mssql</param>
<param name="module.s4.index.externdb.connect">HOST\INSTANCE;Database=s4;</param>
<param name="module.s4.index.externdb.user">s4</param>
<param name="module.s4.index.externdb.pwd">s4</param>
<param name="module.s4.index.externdb.srid">[cbinfo.mapserver.epsg]</param>

3: Restart your site

⚠️ **GitHub.com Fallback** ⚠️