Example: Storing a Surface in Manifold Spatial DBMS

This example uses Microsoft SQL Server Express 2005 as a default example of a non-spatial DBMS to which spatial DBMS capabilities can be added by using Manifold. Such usage is referred to as Manifold Spatial DBMS since Manifold is used to manage the storage.

 

This example assumes the SQL Server Express 2005 DBMS has been installed using defaults as set forth in the SQL Server Express Edition topic and that a data source has been created in the Data Source dialog to connect to that SQL Server Express database as set forth in the Data Source dialog topic.

 

As advised in the Spatial DBMS topic, users are strongly encouraged to install the Manifold Spatial Extender for SQL Server when using SQL Server 2005 as a spatial DBMS. Procedures using with the spatial extender installed or not are identical, but use of the Manifold spatial extender will improve performance of spatial indices.

 

Manifold Enterprise Edition is required to export a surface into a non-spatial DBMS in a way that grants spatial DBMS capabilities. Thereafter, any Manifold edition can utilize those spatial DBMS capabilities for surfaces stored using Enterprise Edition. In addition, Manifold Database Administrator Edition provides very useful and convenient features that may be employed by administrators to configure DBMS storage to make life easier for ordinary users using other Manifold editions.

 

Exporting a surface is essentially identical to exporting an image as shown in the Example: Storing an Image in Manifold Spatial DBMS topic in that surfaces are stored within databases as though they were images, but with a Height channel. The difference between surfaces and images arises upon import, when the Height channel is imported to recreate the surface. At the present time, surfaces cannot be linked from a database.

 

Export a surface to SQL Server Express 2005

 

In this example we use Manifold Enterprise Edition to export a sample surface to SQL Server Express 2005:

 

images\eg_export_dbms_surf_01.gif

 

We open a project with the surface to be exported.

 

images\eg_export_dbms_surf_02.gif

 

If we open the surface we see it shows the Montara Mountain sample elevation data set. The surface has been colored with a palette using the View - Display Options dialog.

 

To export the surface to a database we right click on the surface in the project pane and choose Export.

 

images\eg_export_dbms_surf_03.gif

 

In the Export Surface dialog we choose Data Sources in the Save as type box.

 

images\eg_export_dbms_surf_04.gif

 

In the Data Source dialog we click on the entry for SQL Server and then press OK.

 

[This screen shot assumes we have previously created an entry for our SQL Server connection as set forth in the Data Sources dialog topic and have named it Local SQL Server Express.

 

We can see that this particular Manifold installation also has a connection configured to an Oracle Express data source.]

 

images\eg_export_dbms_surf_05.gif

 

In the Export Surface dialog we accept defaults and press OK. The surface will be uploaded into the DBMS using standard Manifold spatial DBMS surface storage technology for raster data sets (images and surfaces). As with images, Manifold stores surfaces as tiles so that subsections of surfaces can be retrieved very rapidly. The default Tile size recommended by Manifold may be adjusted up or down, but usually is the best choice.

 

The option to Create Pyramids creates pre-computed, intermediate views, called pyramids, which enable faster display of very large surfaces when zoomed out. Compression using the default Deflate option is a good idea because the computational cost of decompression is negligible and there is no surface quality lost, yet having a smaller amount of data in the database not only saves disk space but it helps the DBMS perform faster.

 

Import a surface from SQL Server Express 2005

 

Now that we have a surface in SQL Server we can import it into Manifold using any Manifold edition. The following sequence, for example, can be used in Manifold Personal Edition or any other Manifold edition.

 

We open a project and launch Database Console. Within Database Console we choose the SQL Server Express installation from the Data Source dialog if it is not already loaded into the Data Source box. We press the Refresh button to see the contents of the DBMS server.

 

Important: In this example, we have continued using the same SQL Server Express installation employed in the Example: Storing a Drawing in Manifold Spatial DBMS topic and in the Example: Storing an Image in Manifold Spatial DBMS topic. At the end of those examples we used Administrator Console to configure a friendly name for the drawing or the image that was stored. When Database Console connects to a DBMS that contains friendly names it automatically turns on with the Component View button enabled, so that only friendly names are shown and database object names that might be confusing to inexpert users are hidden.

 

images\eg_export_dbms_surf_06.gif

 

Uploading a surface into a DBMS uploads it without a friendly name until we configure a friendly name using Administrator Console. To see the surface that was just uploaded we will have to turn Component View off to see everything in the database.

 

images\eg_export_dbms_surf_07.gif

 

The surface will appear using a Manifold image icon, because it exists within the DBMS as a raster data set, the same as images. To import the surface into our project we must first click on the + icon to the left of the image icon to expand the entry so that the different channels of the image can be seen. We can then click on the Heights channel to highlight it and then we press the Import button in the Database Console toolbar.

 

images\eg_export_dbms_surf_08.gif

 

The result is that a new surface appears in the project.

 

Note that unlike the case of importing or linking a drawing as seen in the Example of storing drawings to a DBMS, no Import / Link Options dialog appears when importing a surface to allow specifying a subset of the surface for the area of interest.

 

images\eg_export_dbms_surf_09.gif

 

If we click this surface open we see it is indeed the surface exported in the previous part of this example, albeit with no formatting specified. It has been imported complete with all projection information as it was when exported.

 

Notes

 

If we have Database Administrator Edition we can configure surfaces stored in databases with friendly names just as we can with drawings and images. See the Example: Storing an Image in Manifold Spatial DBMS topic for an example of configuring friendly names.

 

New users may wonder about the need to switch off Component View to see the newly-uploaded surface before a friendly name has been specified with Administrator Console. Would that not be an inconvenience to most users?

 

As a practical matter, no. When Manifold users have Administrator Console available it is used to assign friendly names when drawings, surfaces or surfaces are uploaded into a database. In that case, the Component View button will always be on and users will always see the contents of their databases using friendly names. Friendly names are such a convenience that most users, even experts, strongly prefer them to raw, database names for items within a database.

 

In contrast, if a Database Administrator Edition license has not been acquired then no friendly names will be in use, the Component View button will always be off and users will always see the contents of their databases using the naming style used by that database. Many users will not mind that if their budgets do not allow for a Database Administrator Edition license.

 

See also the notes on SQL Server Express as an example DBMS at the end of the Example topic on exporting drawings.

 

See Also

 

Geometry in Tables

Manifold Spatial DBMS Facilities

Spatial DBMS

Spatial DBMS Facilities

 

Example: Storing a Drawing in Manifold Spatial DBMS

Example: Storing an Image in Manifold Spatial DBMS

 

Data Storage Strategies

Database Installations

Database Administrator Edition

Linked Drawings

Manifold Spatial Extender for SQL Server

Oracle Spatial Facilities

Project Pane - Open Data Source

Queries and Geoms

Spatial Extensions

SQL Server Spatial DBMS Facilities

Tools - Administrator Console

Tools - Database Console