Manifold Spatial Extender for SQL Server

Manifold Spatial Extender for SQL Server is an extension module for SQL Server which provides spatial index functionality for Manifold System.
Manifold Spatial Extender is supported on all versions of SQL Server starting with SQL Server 2005. Using Manifold Spatial Extender on SQL Server 2005 Express requires SQL Server 2005 Express SP2.
Manifold Spatial Extender operates via the use of the common language runtime (CLR) integration feature of SQL Server, which is off by default. To enable CLR integration, use the clr enabled option of the sp_configure stored procedure:
SP_CONFIGURE 'CLR ENABLED', 1
GO
RECONFIGURE
GO

Installing and Uninstalling Manifold Spatial Extender using the Setup Utility

To install Manifold Spatial Extender:
  1. Launch the setup utility.
  2. Specify the server name. Use "SERVER" to connect to the default instance of SQL Server on the machine named "SERVER". Use "SERVER\INSTANCE" to connect to a named instance of SQL Server on the machine named "SERVER". Use "(LOCAL)" or "(LOCAL)\INSTANCE" to connect to the default or named instance of SQL Server on the local machine.
  3. Specify the login name and password. To connect using Windows integrated security, leave both fields blank.
  4. Specify the database name.
  5. Click the Connect button. The utility will connect to the instance of SQL Server you specified and will check the presence of Manifold Spatial Extender as well as the status of the CLR integration feature.
  6. Specify the path to the Manifold.SqlServer.Spatial.dll assembly as it is seen on the server machine.
  7. Click the Install button. The utility will attempt to install Manifold Spatial Extender and report results.
To uninstall Manifold Spatial Extender:
  1. Launch the setup utility.
  2. Connect to the desired instance of SQL Server as described above.
  3. Click the Uninstall button. The utility will attempt to uninstall Manifold Spatial Extender and report results.

Installing and Uninstalling Manifold Spatial Extender Manually

To install Manifold Spatial Extender:
  1. Connect to the desired instance of SQL Server using Manifold System's Database Console or using the SQLCMD utility, eg:
    SQLCMD -S (local) -E
  2. Run the following command to install the Manifold.SqlServer.Spatial.dll assembly, supply full path to the assembly:
    CREATE ASSEMBLY [ManifoldSqlServerSpatial] FROM 'path\Manifold.SqlServer.Spatial.dll' WITH PERMISSION_SET = SAFE;
    GO
  3. Run the following commands to install procedures and functions exposed by the assembly:
    CREATE PROCEDURE MFD_SpatialIndexCreate(@schema nvarchar(255), @tableDrawing nvarchar(255)) AS EXTERNAL NAME ManifoldSqlServerSpatial.[Manifold.SqlServer.Spatial.SpatialIndex].SpatialIndexCreate;
    GO

    CREATE PROCEDURE MFD_SpatialIndexRemove(@schema nvarchar(255), @tableDrawing nvarchar(255)) AS EXTERNAL NAME ManifoldSqlServerSpatial.[Manifold.SqlServer.Spatial.SpatialIndex].SpatialIndexRemove;
    GO

    CREATE PROCEDURE MFD_SpatialIndexContains(@schema nvarchar(255), @tableDrawing nvarchar(255), @xmin float(53), @ymin float(53), @xmax float(53), @ymax float(53)) AS EXTERNAL NAME ManifoldSqlServerSpatial.[Manifold.SqlServer.Spatial.SpatialIndex].SpatialIndexContains;
    GO

    CREATE PROCEDURE MFD_SpatialIndexTouches(@schema nvarchar(255), @tableDrawing nvarchar(255), @xmin float(53), @ymin float(53), @xmax float(53), @ymax float(53)) AS EXTERNAL NAME ManifoldSqlServerSpatial.[Manifold.SqlServer.Spatial.SpatialIndex].SpatialIndexTouches;
    GO

    CREATE FUNCTION MFD_SpatialIndexBounds(@schema nvarchar(255), @tableDrawing nvarchar(255)) RETURNS TABLE (XMIN float, YMIN float, XMAX float, YMAX float) AS EXTERNAL NAME ManifoldSqlServerSpatial.[Manifold.SqlServer.Spatial.SpatialIndex].SpatialIndexBounds;
    GO

    CREATE FUNCTION MFD_SpatialIndexFind(@touches bit, @schema nvarchar(255), @tableDrawing nvarchar(255), @xmin float(53), @ymin float(53), @xmax float(53), @ymax float(53)) RETURNS TABLE (ID int) AS EXTERNAL NAME ManifoldSqlServerSpatial.[Manifold.SqlServer.Spatial.SpatialIndex].SpatialIndexFind;
    GO

    CREATE PROCEDURE MFD_SpatialIndexOnDelete(@schema nvarchar(255), @tableDrawing nvarchar(255), @id int) AS EXTERNAL NAME ManifoldSqlServerSpatial.[Manifold.SqlServer.Spatial.SpatialIndex].SpatialIndexOnDelete;
    GO

    CREATE PROCEDURE MFD_SpatialIndexOnInsert(@schema nvarchar(255), @tableDrawing nvarchar(255)) AS EXTERNAL NAME ManifoldSqlServerSpatial.[Manifold.SqlServer.Spatial.SpatialIndex].SpatialIndexOnInsert;
    GO

    CREATE PROCEDURE MFD_SpatialIndexOnUpdate(@schema nvarchar(255), @tableDrawing nvarchar(255), @id int) AS EXTERNAL NAME ManifoldSqlServerSpatial.[Manifold.SqlServer.Spatial.SpatialIndex].SpatialIndexOnUpdate;
    GO
To uninstall Manifold Spatial Extender:
  1. Connect to the desired instance of SQL Server using Manifold System's Database Console or using the SQLCMD utility, eg:
    SQLCMD -S (local) -E
  2. Run the following commands to uninstall procedures and functions exposed by the Manifold.SqlServer.Spatial.dll assembly (assumes that the procedures and functions have been installed in the "dbo" schema):
    DROP PROCEDURE [dbo].[MFD_SpatialIndexOnUpdate]
    GO

    DROP PROCEDURE [dbo].[MFD_SpatialIndexOnInsert]
    GO

    DROP PROCEDURE [dbo].[MFD_SpatialIndexOnDelete]
    GO

    DROP FUNCTION [dbo].[MFD_SpatialIndexFind]
    GO

    DROP FUNCTION [dbo].[MFD_SpatialIndexBounds]
    GO

    DROP PROCEDURE [dbo].[MFD_SpatialIndexTouches]
    GO

    DROP PROCEDURE [dbo].[MFD_SpatialIndexContains]
    GO

    DROP PROCEDURE [dbo].[MFD_SpatialIndexRemove]
    GO

    DROP PROCEDURE [dbo].[MFD_SpatialIndexCreate]
    GO
  3. Run the following command to uninstall the assembly:
    DROP ASSEMBLY [ManifoldSqlServerSpatial]
    GO