v.20.1New Feature

Added greatCircleAngle function for sphere distance calculation in degrees

Added function greatCircleAngle which calculates the distance on a sphere in degrees. #8105 (alexey-milovidov)
Added the greatCircleAngle function to calculate the spherical distance in degrees between two points on a sphere.

Why it matters

This feature provides a simple and precise method to compute the great-circle distance, which is the shortest distance over the earth's surface, enabling geographic and location-based calculations directly within ClickHouse queries.

How to use it

Use the greatCircleAngle function by providing latitude and longitude coordinates (in degrees) of two points. For example:

SELECT greatCircleAngle(lat1, lon1, lat2, lon2) FROM table

This will return the distance in degrees on the sphere between the two points.