Geospatial data into Teradata Database

Not applicable

Geospatial data into Teradata Database


I am new to GeoSpatial data, I need to load Shape files into Teradata database. Could you please let me know what all the pre requisite softwares/utilities needs to be installed for loading this shape files into database.

Also suggest me on how the (.SHP, .SHX & .DBF) files are related to derive the geospacial data
Teradata Employee

Re: Geospatial data into Teradata Database


Teradata has a free tool, TD GeoImport/Export, that translates Shape files into a format that can be stored in Teradata. You can find that here:

The following documentation provides more information about geospatial support:

  • SQL Geospatial Types, B035-1181-098A, available from
  • Teradata Spatial Release 13.0 User’s Guide, Teradata Orange Book 541-0007514, available when you register through Teradata @ Your Service from the Support Services link at


Re: Geospatial data into Teradata Database

It looks like the TDGeoImport and GeoExport tools aren't available anymore.   What's the status on these ?


Not applicable

Re: Geospatial data into Teradata Database

Teradata Employee

Re: Geospatial data into Teradata Database


I am trying to use this tool, but get an error message ...

C:\Users\ML500000\Desktop\TDGeoImportExport>java -Xms256m -Xmx512m -classpath .;



port\tdgssconfig.jar";. com.teradata.geo.TDGeoImport -l tdlocal/sysdba,sysdba -s

 sysdba -f C:\Users\ML500000\Desktop\StatPlanet_Germany\map\map.shp -n co99_d00

Error: Could not find or load main class com.teradata.geo.TDGeoImport

What am I doing wrong?

Thanks in advance,



Re: Geospatial data into Teradata Database

Hi Martin,

Did you solve this ?    

I see you're in C:\Users\ML500000\Desktop\TDGeoImportExport.  

The release notes say 

"Change to the TdGeoImportExport\bin directory and  ...."   so I"m guessing you're not in the bin directory.   Can you see a geojni.dll file ?    Change to the bin directory and run the same script again.


Re: Geospatial data into Teradata Database


I have table in Teradata Express that contains the countries of the world. The NAME column contains the country names and the GEOM colum contains their geographical information (the GEOM colum is of type ST_Geography). I created this table by importing a shapefile using Teradata's TDGeospatialImporter tool.

I am looking for a query that will return the list of countries that are contained in a particular boundingbox. So the boundingbox is the input and the GEOM column will be the output.

I came up with this query that does the job.

Select Name, GEOM from where

GEOM.ST_MBR_Xmin() >= Xmin AND

GEOM.ST_MBR_Ymin() >= Ymin AND

GEOM.ST_MBR_Xmax() <= Xmax AND

GEOM.ST_MBR_Ymax() <= Ymax;

where obvioulsly (Xmin,Ymin,Xmax,Ymax) is the boundingbox.

However, this is just a test and in reality we will be querying tables that contain potentially millions or rows. So I guess the question is how can I be sure this is the most efficient query? Is this query using Teradata's spatial index? I have no idea. Is there a similar query that would be much faster?

Also, my technology department tells me that if the output (the GEOM colum in this case) can be in WKB format it would be much faster and better for us. I have tried using the ST_WKBToSQL method but I am not sure that's what I need. I guess what I need is a function that converts the ST_Geometry type to WTB format, so my query would be something like SELECT CONVERT(ST_GEOMETRY_TO_WKB, GEOM) from blablabla

Can you give me a hand?

I guess there are two questions in the end, not just one ;)



Re: Geospatial data into Teradata Database

Martin, regarding the error:

Error: Could not find or load main class com.teradata.geo.TDGeoImport

The main class is located in tdgeospatial.jar , which must also be added to the classpath. 


java -Xms256m -Xmx512m -classpath .;.\terajdbc4.jar;.\tdgssjava.jar;.\tdgssconfig.jar;.
\tdgeospatial.jar com.teradata.geo.TDGeoImport


In my case I need to specify a 32-bit JRE on my 64-bit machine:

"C:\Program Files (x86)\Java\jre1.8.0_171\bin\java" -Xms256m -Xmx512m -classpath .;.\terajdbc4.jar;.\tdgssjava.jar;.\tdgssconfig.jar;.\tdgeospatial.jar com.teradata.geo.TDGeoImport 


The program runs, but I am not able to authenticate with my usual Active Directory username and password, which work in Teradata Studio and through other ODBC drivers. I think I am missing the ability to set connection options that specify the account name or authentication method.