Import and export spatial data

You can use Db2® Spatial Extender to exchange spatial data between your database and external data sources. More precisely, you can import spatial data from external sources by transferring it to your database in files, called data exchange files. You also can export spatial data from your database to data exchange files, from which external sources can acquire it. This section suggests some of the reasons for importing and exporting spatial data, and describes the nature of the data exchange files that Db2 Spatial Extender supports.

Reasons for importing and exporting spatial data

By importing spatial data, you can obtain a great deal of spatial information that is already available in the industry. By exporting it, you can make it available in a standard file format to existing applications. Consider these scenarios:
  • Your database contains spatial data that represents your sales offices, customers, and other business concerns. You want to supplement this data with spatial data that represents your organization's cultural environment-cities, streets, points of interest, and so on. The data that you want is available from a map vendor. You can use Db2 Spatial Extender to import it from a data exchange file that the vendor supplies.
  • You want to migrate spatial data from an Oracle system to your Db2 environment. You proceed by using an Oracle utility to write the data to a data exchange file. You then use Db2 Spatial Extender to import the data from this file to the database that you have enabled for spatial operations.
  • You are not connected to your spatially enabled database and want to use a geobrowser to show visual presentations of spatial information to customers. The browser needs only files to work from; it does not need to be connected to a database. You could use Db2 Spatial Extender to export the data to a data exchange file, and then use a browser to render the data in visual form.

Shape files

Db2 Spatial Extender supports shape files for data exchange. The term shape file actually refers to a collection of files with the same file name but different file extensions. The collection can include up to four files. They are:
  • A file that contains spatial data in shape format, a de facto industry-standard format developed by ESRI. Such data is often called shape data. The extension of a file containing shape data is .shp.
  • A file that contains business data that pertains to locations defined by shape data. This file's extension is .dbf.
  • A file that contains an index to shape data. This file's extension is .shx.
  • A file that contains a specification of the coordinate system on which the data in a .shp file is based. This file's extension is .prj.

Shape files are often used for importing data that originates in file systems, and for exporting data to files within file systems.

When you use Db2 Spatial Extender to import shape data, you receive at least one .shp file. In most cases, you receive one or more of the other three kinds of shape files as well.