Teradata and ArcGIS
You can connect from ArcGIS to a Teradata data warehouse to perform complex spatial analysis on subsets of your data.
Spatial data is stored in Teradata using the Teradata ST_Geometry type. ST_Geometry is part of the default Teradata data warehouse installation.
To connect from ArcGIS to a Teradata database, you must install the Teradata GSS client, ICU library, and ODBC driver on the ArcGIS client machine. See Setting up a connection to Teradata for information.
See the Teradata Data Warehouse Appliance requirements for ArcGIS for a list of which versions of the Teradata data warehouse and client libraries are supported.
Working with data
In most cases, you will have very large amounts of data stored in Teradata. To perform analyses from ArcGIS, you would use a subset that contains only the data you are interested in analyzing. You can define that subset in a query layer definition or you can create a database view that returns only the data subset.
If you want to use query layer definitions, create the definition files in ArcMap. Click File > Add Data > Add Query Layer to open the New Query Layer dialog box, connect to your database, then type the SQL statement to define the data subset.
Do not drag data directly from your database connection in the Catalog window in ArcMap to the map if you have not already defined a subset of data. Extremely large datasets, as are normally stored in a data warehouse appliance, would take an inordinate amount of time to display on the map.
If you want to use database views, you can use the Create Database View geoprocessing tool or SQL to define the data subsets you want to analyze.
Guidelines for using data from Teradata in ArcGIS
The following is a list of guidelines for using Teradata with ArcGIS:
- The spatial columns in your tables must
be named shape or aliased to shape in a view.
The underlying storage for the Teradata ST_Geometry type is CLOB; therefore, the name or alias of the column (shape) is the only way ArcGIS can identify that the column stores spatial data.
- You must use the tessellation functions provided by Teradata to create and maintain a spatial index on a Teradata ST_Geometry column.
The tessellation spatial index is intended to be used in association with a predefined area of interest. Therefore, the tessellation index cannot be used by ArcGIS spatial operations, such as zoom in, zoom out, and pan, which are based on dynamic inputs. However, the tessellation index can be used in a query layer, if the SQL statement used to define the query layer explicitly uses the tessellation index to query a subset of data based on an area of interest.
- ArcGIS requires a unique identification field to render features in a map. When you add a spatial table to the map, you are prompted to specify this unique ID field.
ArcGIS tools do not insert new values into the unique ID fields in a database; rather, they rely on the database to insert values to the field. Since Teradata does not have a data type or built-in mechanism to populate values in an ID field, ArcGIS tools that create new rows in a database table cannot be used with Teradata.
- As a Teradata user, you know that Teradata ST_Geometry only supports two-dimensional spatial data; therefore, you cannot paste spatial data that contains z- or m-coordinates into Teradata.
- If you use ArcGIS to add a feature class to your Teradata database and the spatial reference you specify for the feature class is not in the Teradata system table, ArcGIS will add a record to the Teradata SPATIAL_REF_SYS table and, consequently, the GEOMETRY_COLUMNS table.
This allows you to use more spatial references than are provided by default with Teradata. However, upgrades to major Teradata releases may drop these tables and re-create them with only default values in them.
Before you upgrade, you should always make a backup of your database. Be sure that this includes the records in these tables so you can restore them if necessary after a Teradata upgrade. You can follow this general procedure to back up and restore the SPATIAL_REF_SYS and GEOMETRY_COLUMNS records during a database upgrade operation:
- Create a backup of your database.
- Connect to a database in which you will make copies of the SPATIAL_REF_SYS and GEOMETRY_COLUMNS tables.
In this example, the database is named mybackupdb.
database mybackupdb;
- Create backup copies of your tables.
In this example, your source tables are in the sysspatial database.
CREATE TABLE mybackupdb.spatial_ref_sys AS sysspatial.spatial_ref_sys WITH DATA; CREATE TABLE mybackupdb.geometry_columns AS sysspatial.geometry_columns WITH DATA;
- Upgrade your Teradata database.
- Connect to the database to which you had copied the tables.
- Restore the tables to your upgraded database.
--Restore the geometry columns table. INSERT INTO sysspatial.geometry_columns SELECT * FROM mybackupdb.geometry_columns; --Restore the spatial_ref_sys table. INSERT INTO sysspatial.spatial_ref_sys SELECT * FROM mybackupdb.spatial_ref_sys MINUS SELECT * FROM sysspatial.spatial_ref_sys;
- Once the contents of the tables are restored, you can delete the backup copies of the tables.
DROP TABLE mybackupdb.spatial_ref_sys; DROP TABLE mybackupdb.geometry_columns;