私は特定の緯度と経度で興味のあるPOI点を選択しており、50フィート先の非常に正確な点をいくつか生成したいと思います。私は50フィートを越えたいとは思っていませんが、ランダムなポイントを50フィートまで均等に配分したいと思っています。点から所定の半径内の球上に点を均等に生成
これまで私がこれまで持っていたことは、かなり良いように見えますが、距離が遠すぎます。
これまでの私の推測では、私の仮定の多くは球の代わりに円に基づいていると思います。
x0 = Longitude of POI
y0 = Latitude of POI
u = Uniformly random number between [0,1)
v = Uniformly random number between [0,1)
r = 50*0.3048/111,300
r = maximum 50 foot radius distance new point is away from POI
0.3048 is to convert feet to meters
111,300 is to convert meters to degrees for earth
θ (or t) = 2π*v
θ (or t) = Uniformly random rotation around the polar axis
w = r*sqrt(u)
w = Non-uniformly random distance based on polar coordinate system
so points don’t clump near the center.
Δy = w*sin(θ)
Δy = New random delta change to latitude
standard w*sin(θ) for converting from polar to Cartesian coordinates
y1 = y0+Δy
y1 = New random latitude of new point
Δx = w*cos(θ)/cos(y1*π/180)
Δx = New random delta change to longitude
cos(y1*π/180) used to adjust for shrinking east west distances
as you move further away from the equator
x1 = x0+Δx
x1 = New random longitude of new point
ただ、いくつかのより多くのコンテキストを追加するために、私はWKID 4326地理座標系とSTDistanceと私の仕事をチェックする使用してSQL Serverのこの内部をやっています。
私の公式を使用することができます... [等距離点球](http://stackoverflow.com/a/25031737/2521214)。あなたは地球全体をカバーしていないので、点を本当に等距離に保つために 'ceil'丸めを無視してください – Spektre