How to get street address from coordinated (latitude and longitude)

Dear all,
I have a table with timestamp and coordinated of the GPS position. For each row I would like to get street address of the position.
Is it possible to achieve that from SQL? I found some articles describing this: [SQL Server 2008 - Convert Lat/Long to Geography Point)
But it is returning some very long string, that is not readable.
I don't need additional column, If I can just get value of Streed address it would be superb.
FOr easier understanding I am adding format of the data:

drop table #Test

create table #Test
(
    datetime int,
    latitude float,
    longitude float,
)
insert into #Test (datetime, latitude, longitude)
VALUES
(1673867887, 46.015652, 14.41596)

SELECT *
FROM #Test

I am expecting to get Back: "Podpeška cesta 77B, 1351 Brezovica pri Ljubljani
Brezovica Slovenija"

You would have to pass those coordinates to an external geo-mapping service, like Google Maps API. Address lookup is not built-in to SQL Server. If you had a table of addresses that included latitude and longitude, then you could do a lookup using them via static methods on a Geography data type:

FYI, calling external/third-party APIs from within SQL Server is probably not the best way to do it, as it would involve CLR functions that have to be written specifically for SQL Server to use. It would be better to export the latitude/longitude to a file and have another program do the lookup, then add the address to the coordinates. You can then optionally import the address data into your database.

1 Like

Robert,
Thank you for the answer.
I got the street address through the connection to Google Maps API with the help of node-red.
Thank you!