The following steps and examples describe how to export with Teradata GeoExport.
- 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;
- Run TDGeoExport to create an ESRI Shapefile from the customers table.
rm c:\temp\geodata\* cd c:\temp\TdGeoImportExport\bin java -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
- 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.