Retrieving Latitude and Longitude from a Spatial Point

Database
WDE
Visitor

Retrieving Latitude and Longitude from a Spatial Point

Need some help.  I have a spatial point in a Teradata table stored as varchar(4000) populated from a SQL Server table which has the spatial point defined as "geography".  In SQL Server one can use 'columnname'.Lat and 'columnname'.Long to retrieve both the latitude and longitude.  I understand that st_geometry is an option in teradata, but what I am unsure of is how to get from the varchar spatial point to the actual lat/long.  Any suggestions?  Thanks in advance.

 

Example of data stored:

0xE6100000020C2861A6ED5F2D40408DEE2076A66656C0

2 REPLIES 2
Teradata Employee

Re: Retrieving Latitude and Longitude from a Spatial Point

The Teradata Geospatial Types manual documents loading and working with st_geometry objects. But you will need to have SQL Server convert the "geography" data to st_geometry Well-Known Text or Well-Known Binary form when you export it from SQL Server, and use that to load into Teradata as native geospatial types. (See the SQL Server documentation for information on ways to do that, e.g. STAsText method.)

 

Teradata will not be able to interpret a hex representation of SQL Server internal object storage.

Highlighted
Teradata Employee

Re: Retrieving Latitude and Longitude from a Spatial Point