Process - Geospatial Utilities

Teradata Geospatial Utilities User Guide

Product
Geospatial Utilities
Release Number
15.00
Language
English (United States)
Last Update
2018-09-28
dita:id
B035-2519
lifecycle
previous
Product Category
Teradata Tools and Utilities

Process

The following steps and examples describe how to export with Teradata GeoExport.

1 Create a table of geospatial data in the database:DROP TABLE customers;CREATE TABLE customers(pkey integer, cust_name VARCHAR(10),cust_zipcode VARCHAR(6) , loc ST_Geometry);INSERT INTO customers(0, 'Anugu Raju', '500020', new ST_Geometry('POINT(20.34 80.78)'));INSERT INTO customers(1, 'Madhava', '500081', new ST_Geometry('POINT(20.56 89.44)'));INSERT INTO customers(2, 'Karthik', '500083', new ST_Geometry('POINT(19.12 88.22)'));INSERT INTO customers(3, 'Subbarao', '500012', new ST_Geometry('POINT(21.45 88.12)'));SELECT * FROM customers ORDER BY 1;

2 Run TDGeoExport to create an ESRI Shapefile from the customers table.rm c:\temp\geodata\*cd c:\temp\TdGeoImportExport\binjava -Xms256m -Xmx1024m -classpath .;tdgssconfig.jar;terajdbc4.jar com.teradata.geo.TDGeoExport -l hyvm20/geouser, geouser -s geouser -t customers -f "ESRI Shapefile" point -o c:\temp\geodata -n customers

3 Validate that the ESRI shape files were generated in the c:\temp\geodata directory. The output ESRI shape files will show up in c:\temp\geodata.

TDGeoExport Command

Syntax  

where

 

Parameter

Description

-l logon_string

Teradata Database logon string, where the format of logon_string is: Database/User,Password

-s database_name

Database name that contains the table to convert

-t table_name

Table name (or view) to convert

-f format_name

Output file format name. The valid values for format_name are:

o MapInfo File

o TIGER version_code

o KML

o ESRI Shapefile shape_type [ ONLY ]

Exported ESRI Shapefiles can contain only one shape type, which must be specified. If multiple shape types occur in the table that is to be exported, specify the optional ONLY keyword to restrict the export to only the specified type. Perform separate export operations to export several different shape types.

-o output_directory_name

Directory where the output data files will be generated

-n layer_name

Optional name of the layer to create.

If the -n option is omitted, then TDGeoExport uses the table name as the name of the layer to create.

-a_srs coordinate_system_name

Coordinate system. If not specified, the default is to use the coordinate system appropriate to the output file format type. -a_srs can be specified as one of the four well-known systems (WGS84, WGS72, NAD83, NAD27) or in the form of EPSG:n where n is EPSG GCS or PCS code.

-CSET charset_name

Specifies the client character set while logging onto Teradata Database.

If not present default character set is assumed. (ASCII for N/W clients)

Note: Applicable values are UTF8.

Note: Some large data files may exceed Java heap memory. In the example, the -Xms option sets the initial Java heap size to 256MB. The -Xmx option sets the maximum Java heap size to 1024 MB.

Usage Notes  

The table or view should consist of a single geometry column of type ST_Geometry and one or more additional columns which represent the feature attributes. Each row of the table is considered a feature and the entire table is considered a layer. All columns in the table will be converted to the layer. If a subset of columns in the table is desired instead of the entire table, a view that represents this subset should be created.

The program will place the output file(s) in the directory specified by the

-o output_directory_name

-a_srs

can be specified as one of the four well-known systems (WGS84, WGS72, NAD83, NAD27) or in the form of EPSG:n where n is the EPSG GCS or PCS code. Note that this does NOT perform a transformation. It sets the spatial reference system of the exported data so that an external program can interpret the data using the specified coordinate system.

When TIGER is specified as output format, we now require a version_code to be specified. This is because specific versions adhere to specific structures and other requirements, and must therefore be specified for correct export.

When ESRI Shapefile is specified as output format, we now require a shape_type to be specified. ESRI Shapefile can only contain one shape type, so we require the user to decide what shape type will be for any given export. If the shape type is incorrect (i.e. ANY value in the geometry column contains data of a different type) an error will be reported, and export will fail. If the user knows that multiple shape types are in one table which will be exported, the user can specify “only” following shape type and ONLY shapes of the specified type will be exported. All others will be skipped over. In this way, data which contains multiple shape types can be exported, with a different export/Shapefile for each shape type.