Skip to Content

Converting X and Y cordinates to Latitude and Longitude

Mar 13 at 07:59 AM


avatar image
Former Member

Hi All,

I got a request to convert X and Y coordinates to Latitude and Longitude.

Is this possible in Webi or via SQL querry.


Jagdeep Singh

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Mar 13 at 09:07 AM

I guess it is possible with HANA Spatial functions. Maybe these hints will help you...

I have created X, Y coordinate within World Geodetic System 84 ( from Longitude and Latitude, like this:



Where 4326 is the SRID (

I guess you should seek to do this operation in the opposite order.

Look at HANA Spatial documentation:

Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member

i am having data in the form of X and Y co-ordinates

I want to convert these Co - ordinates to Latitude and longitude, and to put this data into the Table and use that table to display data in the Report.


X axis Y axis

460776.1125 2905247
Former Member

Since you have X and Y you want to convert to Longitude and Latitude, I assume your X and Y coordinates corresponds to a place on earth. If so, your coordinates are probably of type WGS 84 (planar), that means SRID = 1000004326.

I have not tried it myself, but I guess this will do the work:

LONGITUDE = new ST_POINT('POINT('||X_COORDINATE||' '||Y_COORDINATE||')',1000004326).ST_Transform(4326).ST_X()

LATITUDE = new ST_POINT('POINT('||X_COORDINATE||' '||Y_COORDINATE||')',1000004326).ST_Transform(4326).ST_Y()

ST_X() and ST_Y() are functions to extract X and Y coordinate of ST_POINT respectively. And since the point was transformed to SRID 4326 (ST_Transform(4326)), the ST_POINT is of the type that holds longitude and latidude as its coordinates

Output type, that is the type of LONGITUDE and LATITUDE will be DOUBLE.

Former Member
Former Member

I am having the data into the Oracle DB in the form X and Y axis and i need to put the data into the form of Latitude and Longitude.

The functions you specified are not valid in oracle.

could you please help me in this.

steps you can share or SQL query to fetch the data in the form of Latitude and longitude.

Former Member

Ok, then you should probably do some reading on spatial data in Oracle.

Similar principles probably apply, but you will have to learn the Oracle syntax for this.

Although spatial is not the most standard SQL, it is a part of HANA extension of SQL. SQL is not a standard, and varies from db to db, so Oracle should have implemented this differently.