需要找到所有拉链codeS半径范围内英里从指定ZIP codeS范围内、半径、拉链、ZIP

由网友(抖音昵称)分享简介:我知道如何让经度和纬度,从一个zip code。我也有与他们的拉链codeS和协调多个位置的数据库。I know how to get longitudes and longitudes from a zip code. I also have a database with multiple locations...

我知道如何让经度和纬度,从一个zip code。 我也有与他们的拉链codeS和协调多个位置的数据库。

I know how to get longitudes and longitudes from a zip code. I also have a database with multiple locations with their zip codes and coordinates.

我想找到根据半径上的纬度和经度的界限,然后匹配起来反对我的数据库的可能性。

I want to find the limits of a latitude and longitude based on the radius and then to match them up against possibilities in my database.

我读了半正矢?式。但是,我不明白这和寻找如何找到纬度和经度的范围作出解释。

I read about the haversine?? formula. But, i don't understand it and looking for an explanation of how to find the limits of the latitude and longitudes.

推荐答案

半正弦波是地理计算,这里的弯曲全球影响的距离。特别是对于短距离无关。

Haversine is for geographic calculations, where the curving globe influences distances. Especially for short distances irrelevant.

鉴于地球半径R:

Δ y = (ΔLatitude mod 360)  * 2π R / 360

但到达一个极点(纬度=±90)。

But a Δ longitude gets 0 when reaching a pole (latitude = ±90).

Δ x = (ΔLongitude mod 360)  * 2π R * (90 - |avg latitude|) / 90 / 360
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~

(划线部分应该是像 COS弧度(平均纬度)但SQL很少提供了一个余弦函数。)的

(The underlined part should be something like cos(avg latitude in radians) but SQL rarely provides a cosine function.)

因此​​

distance = √(Δx² + Δy²)
阅读全文

相关推荐

最新文章