mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Merge pull request #47710 from den-crane/patch-57
Doc. fix greatCircleDistance example
This commit is contained in:
commit
217d683da4
@ -31,13 +31,13 @@ Generates an exception when the input parameter values fall outside of the range
|
||||
**Example**
|
||||
|
||||
``` sql
|
||||
SELECT greatCircleDistance(55.755831, 37.617673, -55.755831, -37.617673)
|
||||
SELECT greatCircleDistance(55.755831, 37.617673, -55.755831, -37.617673) AS greatCircleDistance
|
||||
```
|
||||
|
||||
``` text
|
||||
┌─greatCircleDistance(55.755831, 37.617673, -55.755831, -37.617673)─┐
|
||||
│ 14132374.194975413 │
|
||||
└───────────────────────────────────────────────────────────────────┘
|
||||
┌─greatCircleDistance─┐
|
||||
│ 14128352 │
|
||||
└─────────────────────┘
|
||||
```
|
||||
|
||||
## geoDistance
|
||||
@ -47,6 +47,37 @@ The performance is the same as for `greatCircleDistance` (no performance drawbac
|
||||
|
||||
Technical note: for close enough points we calculate the distance using planar approximation with the metric on the tangent plane at the midpoint of the coordinates.
|
||||
|
||||
``` sql
|
||||
geoDistance(lon1Deg, lat1Deg, lon2Deg, lat2Deg)
|
||||
```
|
||||
|
||||
**Input parameters**
|
||||
|
||||
- `lon1Deg` — Longitude of the first point in degrees. Range: `[-180°, 180°]`.
|
||||
- `lat1Deg` — Latitude of the first point in degrees. Range: `[-90°, 90°]`.
|
||||
- `lon2Deg` — Longitude of the second point in degrees. Range: `[-180°, 180°]`.
|
||||
- `lat2Deg` — Latitude of the second point in degrees. Range: `[-90°, 90°]`.
|
||||
|
||||
Positive values correspond to North latitude and East longitude, and negative values correspond to South latitude and West longitude.
|
||||
|
||||
**Returned value**
|
||||
|
||||
The distance between two points on the Earth’s surface, in meters.
|
||||
|
||||
Generates an exception when the input parameter values fall outside of the range.
|
||||
|
||||
**Example**
|
||||
|
||||
``` sql
|
||||
SELECT geoDistance(38.8976, -77.0366, 39.9496, -75.1503) AS geoDistance
|
||||
```
|
||||
|
||||
``` text
|
||||
┌─geoDistance─┐
|
||||
│ 212458.73 │
|
||||
└─────────────┘
|
||||
```
|
||||
|
||||
## greatCircleAngle
|
||||
|
||||
Calculates the central angle between two points on the Earth’s surface using [the great-circle formula](https://en.wikipedia.org/wiki/Great-circle_distance).
|
||||
|
Loading…
Reference in New Issue
Block a user